Page 1 of 1

Rotten apples

Posted: Wed Jan 20, 2021 12:40 am
by WaxfordSqueers
I presume this is off-topic. Trying to help a friend install a printer on the newest MacOS... Big Sur. Of course, Apple has gone mad and made it completely 64-bit and unable to run 32-bit apps. Naturally, the drivers for my friend's printer are 32-bit.

Not asking for help with the Mac but under the hood it's all ancient Unix. Wonder if anyone is proficient with Unix? I get the basic structure, having gone masochistic and tried to learn Linux version of Unix. Could never get past using ancient apps like Emacs. Never made sense to me, probably because Emacs was developed in the teletype era.

Apple has a mental problem with security. I am sure they wear at least 3 belts to hold up their pants and countless suspenders in case the belts should fail. Anytime on the MacOS I try to use the sudo command in Terminal, for root, I get asked for a password. I have noticed with my friend that if the Mac is left alone a for a few minutes, a logon is required to get the machine going again.

All I am trying to do is copy a couple of generic printer drivers from one directory to the other. If my users directory is in foo/users/downloads, I just want to use the cp command to copy the driver files to Users/Shared. If I do an ls -l command in Terminal, I can see the Shared directory under the same users directory as my foo/users directory but I cannot copy files between them. The macos file manager, Finder, seems absolutely useless for such minor copy routines since it won't even list the hidden shared folder under users.

I suspect I am doing something wrong like not using capitals in the right spot or trying to copy to a protected directory. Or, it's something really annoying abou the cp command.

I have tried cp -a ~/foo/users/downloads/*.* ~/users/shared Maybe I need to include foo in both, that just occured to me. However, when the cp command fails in macos it gives you nary a reason as to why. All it does is belch out command line values without an explanation of what each means. [/whine off].

Re: Rotten apples

Posted: Wed Jan 20, 2021 7:27 pm
by Kayaker
Permissions suck. But if you're root you should be able to do anything. Maybe try copying the files in place, chown/chmod them and try copying that instead of the originals? Or test directory permissions and copy syntax on a simple text file you create.

As an aside, I usually like to cd to the directory I want to copy TO and use the "." character to copy "here", avoids having to write the <destination> directory and messing up the syntax.
copy -rp <source> .

Re: Rotten apples

Posted: Thu Jan 21, 2021 6:18 am
by WaxfordSqueers
Kayaker wrote: Wed Jan 20, 2021 7:27 pm... if you're root you should be able to do anything.
Yeah...I've learned a lot since I posted. Know how to get root using sudo and beginning to find my way around the file system. Same as the Unix used on Linux except Mac tends to get choosy about what they'll let you see.

Have a version of Mac running on a VM so it limits me as far as connecting printers and testing Mac drivers. However, I figured out how to generate generic drivers and hopefully my friend's MacOS which is now purely 64-bit, will have the same features. Like Linux, Mac has sample drivers which are templates for generic drivers. You can use cups-driverd to generate a generic driver for several popular models. You can see them using lpinfo -m.

Also discovered that executables in the MacOS come with a bit set to prevent execution. chmod works for this as:
chmod +x ./foo where foo = filename.
Kayaker wrote: Wed Jan 20, 2021 7:27 pmAs an aside, I usually like to cd to the directory I want to copy TO and use the "." character to copy "here"
Great idea. I d/l'd an app for MacOS called mucommander. It's a dual-pane file manager that lets me drag files from Window to Window. Works on Linux as well, apparently.

Re: Rotten apples

Posted: Tue Jan 26, 2021 5:12 pm
by WaxfordSqueers
I've had to take a crash course in CUPS, the Common Unix Printer System. I managed to load a printer driver from the command line that worked but it's only in a MacOS Mojave version on a VM. Apparently, the latest MacOS, Big Sur, is pure 64-bit and unable to load 32 bit drivers.

I'm calling bs on that one. There is no reason why a 64 bit system could not run a 32 bit driver unless, of course, it is designed not to do that. I guess one major issue would be the memory addressable by a 32-bit system. Not sure how Microsoft pulls that off in the WOW system.

Apple has built in many protections against running apps that are not purchased through the App Store, one of them being sandboxes to cordon off certain parts of the OS. I understand that CUPS runs in a sandbox but in the CUPS config file there are provisions to 'relax' the sandbox, which I have yet to try on a real MacOS 64-bit system.

It's interesting that the current Apple CEO believes the future of Apple is in printers. That should read printer ink, where the real profits lie. HP has bent over backwards to prevent users using refilled ink cartridges and they have been cooperating with Apple by not supply drivers for certain printers. I have an HP with a LED readout and I have been checking under the hood. They know the serial numbers of cartridges and I'm sure that's what they check to see if the cartridge is HP or not. I am looking into a way to check the data being sent to the printer but I really need to get inside the printer electronics and interrogate the firmware.

Don't know if that would be a suitable topic for the reversing forum.