/*
- * $Id: unix.c,v 1.33 2002-04-14 10:53:37 srittau Exp $
+ * $Id: unix.c,v 1.35 2002-06-06 10:14:26 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
return( mbits );
}
+/* --------------------------------
+ cf AFP 3.0 page 63
+*/
void utommode( stat, ma )
struct stat *stat;
struct maccess *ma;
ma->ma_owner = utombits( mode );
+ /* ma_user is a union of all permissions */
+
if ( (uuid == stat->st_uid) || (uuid == 0)) {
ma->ma_user = ma->ma_owner | AR_UOWN;
- } else if ( gmem( stat->st_gid )) {
- ma->ma_user = ma->ma_group;
- } else {
- ma->ma_user = ma->ma_world;
}
+ if ( gmem( stat->st_gid )) {
+ ma->ma_user |= ma->ma_group;
+ }
+ ma->ma_user |= ma->ma_world;
/*
* There are certain things the mac won't try if you don't have
* the "owner" bit set, even tho you can do these things on unix wiht
* only write permission. What were the things?
+ *
+ * FIXME and so what ?
*/
+#if 0
if ( ma->ma_user & AR_UWRITE ) {
ma->ma_user |= AR_UOWN;
}
+#endif
}
return( mode );
}
+/* ----------------------------------
+ from the finder's share windows (menu--> File--> sharing...)
+ and from AFP 3.0 spec page 63
+ the mac mode should be save somewhere
+*/
mode_t mtoumode( ma )
struct maccess *ma;
{
mode_t mode;
mode = 0;
- mode |= mtoubits( ma->ma_owner );
+ mode |= mtoubits( ma->ma_owner |ma->ma_world);
mode = mode << 3;
- mode |= mtoubits( ma->ma_group );
+ mode |= mtoubits( ma->ma_group |ma->ma_world);
mode = mode << 3;
mode |= mtoubits( ma->ma_world );