On Wed, 18 Aug 1999, Bill Studenmund wrote:

> On Tue, 17 Aug 1999, Brian C. Grayson wrote:
> 
> > On Tue, Aug 17, 1999 at 07:17:45PM -0700, Wilfredo Sanchez wrote:
> > >   A group of us at Apple are trying to figure out how to handle  
> > > situations where a filesystem with "foreign" user ID's are present.   
> > 
> >   Have you looked at mount_umap(8)?  I (naively) think it would
> > solve most of your concerns.
> 
> I don't think so. umap is for translating credentials between domains. I
> think what Fred wants to do is different, and that is to ignore the
> credentials on the system.
> 
> Fred, right now what happens in MacOS when I take a disk which has sharing
> credentials set up, and hook it into another machine? How are the
> credentials handled there?
> 
> Also, one of the problems which has been brought up in the thread is that
> umap needs to know what credentials to translate to. For that, we'd need
> to stash the credentails on the drive.

I'm probably being extremely naive myself, but I just envisioned a
scenario like this (pardon me if someone else has already suggested
this):

When a filesystem is mounted as foreign (HOW that is determined I
won't talk about), every file in the filesytem has its credentials
mapped to that of the mountpoint.  File mode bits are not remapped in
any way.  New files gain the credentials of their _foreign_ parent.

That's the skinny.  Now I'll give a (much longer) example to clarify.

An origin filesystem (created by and mounted on the same system) which
happens to have stuff owned by several different users (this is all
pseudo... don't mind sizes, dates, and link counts in this example):

drwxr-xr-x   4 root  wheel    512 Aug 18 15:42 ./
drwxr-x---   4 harry users    512 Mar 10 10:21 dir1/
drwxr-xr-x   2 john  users    512 Jul  1 18:40 dir2/

ls -la dir1
-rw-r-----   1 harry users    0 Aug 18 15:48 bar
-rw-r-----   1 harry users    0 Aug 18 15:48 foo

Take this filesystem and mount it as a "foreign" filesystem on another
machine.  User 'jake' owns the mountpoint on the machine.

drwxr-xr-x   2 jake  users    512 Jan  4  1999 /mnt/

mount_foreign /dev/whatever /mnt

ls -la /mnt
drwxr-xr-x   4 jake  users    512 Aug 18 15:42 ./
drwxr-x---   4 jake  users    512 Mar 10 10:21 dir1/
drwxr-xr-x   2 jake  users    512 Jul  1 18:40 dir2/

ls -la /mnt/dir1/
-rw-r-----   1 jake  users    0 Aug 18 15:48 bar
-rw-r-----   1 jake  users    0 Aug 18 15:48 foo

Note file mode bits were not affected, but everything gained the
user/group of the mountpoint.

Now what happens if user 'jake' adds something to the filesystem?

touch /mnt/dir1/baz

ls -la /mnt/dir1/
-rw-r-----   1 jake  users    0 Aug 18 15:48 bar
-rw-r-----   1 jake  users    0 Aug 18 15:48 foo
-rw-r-----   1 jake  users    0 Aug 18 15:50 baz

Reply via email to