high sierra file ownership

I've been developing UNIX software on Macs for a quite a while. They were set up to use NIS ("Yellow Pages") identity management and mounted drives from our network servers like any UNIX machine, using NFS. I'm thoroughly familiar with UNIX permissions, "ls -l", "chmod", "chown", and so on.


But High Sierra can't do that, because the NIS support has been removed. So I have a machine attached to our Windows domain, and I can log in using my Windows account. I can mount drives from our network servers using SMB, and that works OK. But looking at permissions and ownership on the network drives is a bit weird.


On Macs connected to NIS, "ls -l" for a file on a network drive shows me the username that owns the file, and the user group that is associated with the file. It also shows me permissions associated with that file and group.


But on this Mac using SMB, "ls -l" shows me the username I'm logged in as, and the primary group of that username. This is different information, and it isn't about the file that I'm looking at. "ls -l" also seems to be trying to show me the effective permissions I have on the file, but it isn't getting that right.


I tried using the Finder, by selecting a file in its window and using File=>Get Info. That shows me more detailed permissions information under the "Sharing and permissions" heading. It displays "Fetching ..." rather than the name of the user who the file belongs to, and thus has permissions for it. It also doesn't seem to have any way to find out who actually owns a file. On a Mac being used in the ordinary way, that isn't necessary, but it is important when a Mac is part of a distributed multi-platform development environment.


Questions:

  1. Is there a way to get "ls -l" to display information about a file, rather than about the account that is running the ls command? I can't find anything in the ls manpage.
  2. Is there a way to get file ownership information, through ls, the Finder, or in any other way?


Thanks,


John Dallman

Mac mini, macOS High Sierra (10.13.4), cbm6w029

Posted on Jul 17, 2018 4:05 AM

Reply

Similar questions

18 replies

Jul 17, 2018 7:48 AM in response to John Dallman

John Dallman wrote:


using the machine as an isolated Mac doing stand-alone development is not realistic. The software in question is produced on many platforms

That was not my suggestion. My suggestion was to use git, which is the standard method for development on all platforms.


The test data is far too large to fit on one machine. If networked development is not practical, then our only real choice is to drop support for macOS and iOS.

So are you talking about development or testing? There are many alternatives to SMB and the Finder. iOS is a different beast altogether. But it doesn't make much sense to try to avoid problems that users would likely encounter on their own networks. If dropping support for macOS and iOS is something you can easily do, then you should do it. Otherwise, you are spending time and effort on a platform that isn't worth it for you.


This is a user-to-user support forum. Our focus here are Apple's consumer products and their end users, not enterprise developers. That is a completely different world. You can use a Mac in that environment, but you have to realize that it is a Mac, not Windows and not Linux. It is not reasonable to expect one platform to conform to all the features of the others. Linux and Windows certainly can't complete with the Mac's best features, but that isn't a problem for people who need to use or develop for those platforms. And that works the same way on the Mac side.


I would be happy to help you find workarounds for developing and testing on the Mac. I did all of my recent .gov development on my Mac. Like many developers these days, I did most of that work remotely. There is no way I would have been able to access all 400 TB of my data over an SMB mount. But if you are just looking for an excuse to drop macOS and iOS, by all means, use this one.

Jul 18, 2018 6:43 AM in response to John Dallman

To back up a bit...


You were complaining about the lack of NIS and the different way that the macOS SMB client works. You are using a NetApp server. I have no idea what level of support that product has for SMB, Active Directory, and macOS. Perhaps you should ask them. I'm sure you pay a fair amount for support. Their engineers could tell you more about this than I could.


I can tell you that, even under the best of conditions, with well-run Windows networks, or 100% Mac networks, SMB on the Mac is just flaky. The Finder is flaky too. So if you access your SMB mounts with the Finder or other high-level services (anything other than a straight copy file to or from), you are going to experience even more flakiness. Is it good enough to edit MS Office documents on the server? Sure. You probably won't have to restart your Mac more than once or twice a week with that kind of usage.


But you implied that you were using the SMB network for something more demanding than that, where ownership and permissions are critical. I'm not entirely sure what kind of use you are talking about there.


As far as ownership and permissions go, maybe NetApp can help with that. If not, macOS is going to do what it can do and you aren't going to have much luck getting it to do more. I can verify that permissions are respected. On one occasion I had to make some data read-only because people (Windows users) kept accidentally modifying the data. My account had write privileges to that data but no one else did. Yet my permissions were not sufficient to access some other restricted data that I had no reason to access. So, permissions seemed to work. At least it worked on Sierra. Generally, macOS cross-platform support will get a little bit worse each year.


I cannot confirm that the Mac wouldn't screw up ownership. If anything, I'm pretty confident that the Mac would scramble ownership. Most modern Mac apps that use the document-based API use "atomic writes" to avoid corrupting data with a partial data update. This works by writing to a temp file and swapping the old file for the new one in an atomic operation. I can see how this might trash ownership in a networked environment if the temp file was not created with exactly the same ownership metadata as the original. I'm not saying it does trash ownership. I don't know. But I can see how it could happen.


You also mentioned things like "updated daily", "test data is far too large to fit on one machine", and "networked development". When you say "updated daily", I assume you mean the source, not the test data. That's not an issue. Modern source control system support non-stop updates. I'm not sure what you mean by "networked development". Git was designed for distributed development, which isn't quite the same thing. In Git, everyone has their own local copy of the source. But this is true of most source control systems. What makes Git unique is that the "master" copy only exists in terms of procedural consensus among users. In Git, each copy of the source is its own, self-contained source control system that can be forked into a completely new version, with its own clients and their own copies, at any time.


Git is how source control is done these days. If you aren't using Git, you need to start. Do this today. If you weren't already using Git, using Git will result in better luck recruiting new developers and lower attrition rates.


Regarding test data, there are innumerable ways to get data from here to here. I don't know what you are testing, so I don't know why even flaky SMB wouldn't work. If your system is writing to the test data, then using writeable SMB sounds like a Very Bad Idea. If your data is on the network, you are going to have to get that data to the local machine to test. Why use a flaky SMB protocol, potentially corrupting the test data, when you can just copy the test data locally and run it there? All of the data is on the network. It isn't like you would ever by copying any more data. It's all the same data over the same network. If anything, moving this data data onto another network protocol, maybe with dedicated and/or distributed servers, would really be appreciated by the people trying to use the SMB network for their Word documents. You could use rsync, scp, a local cloud, NFS, HTTP, FTP, SFTP, FTPS, and probably a dozen other funky protocols that were designed specifically for such use.


I don't know what the climate is like at your organization. But from the sound of things, having any excuse to drop the Mac would be appreciated and rewarded, at least in the short term. If you do that, make sure to update your resume. Without iOS support, you might all get laid off. If not, then maybe you never really needed Mac and iOS support to begin with.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

high sierra file ownership

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.