Rixstep
 About | ACP | Buy | Industry Watch | Learning Curve | News | Products | Search | Substack
Home » Learning Curve » Developers Workshop

/home & /net

Two new root level directories on Leopard.


Get It

Try It

Back in the days of the Leopard beta programme several corporate clients wrote to say they experienced 'slow startup times' with Xfile. This was unusual because otherwise the program is so bloody fast.

We were of course puzzled but hung onto things patiently because the program otherwise performed admirably (as online screenshots demonstrated).

Then someone started digging inside root and found two strange new root level directories.

/home and /net.

Info on Mount

The ACP offers a look at mounts through several applications.



What immediately stands out here are the flags - that '00500000' is strange to say the least.

There are of course a lot of other things too. Neither of these file systems have any blocks or inodes.

mounts

There's also an ACP command line tool that details comprehensive info on all your mounts.

/home
-----
          blocks: 0
     blocks free: 0
blocks available: 0
      block size: 1024
          inodes: 0
     inodes free: 0
           flags: 00500000
                  MNT_DONTBROWSE
                  MNT_AUTOMOUNTED
  file system ID: 2C000003 00000014
file system type: autofs
        I/O size: 512
    mounted from: map auto_home
           owner: 0
            type: 20
/net
----
          blocks: 0
     blocks free: 0
blocks available: 0
      block size: 1024
          inodes: 0
     inodes free: 0
           flags: 00500000
                  MNT_DONTBROWSE
                  MNT_AUTOMOUNTED
  file system ID: 2C000002 00000014
file system type: autofs
        I/O size: 512
    mounted from: map -hosts
           owner: 0
            type: 20

Note the 'MNT_DONTBROWSE' flag - that's part of the '0050000' seen earlier.

Actually there are a whole slew of new flags for Leopard.

/*
 * User specifiable flags.
 *
 * Unmount uses MNT_FORCE flag.
 */
#define	MNT_RDONLY	0x00000001	/* read only filesystem */
#define	MNT_SYNCHRONOUS	0x00000002	/* file system written synchronously */
#define	MNT_NOEXEC	0x00000004	/* can't exec from filesystem */
#define	MNT_NOSUID	0x00000008	/* don't honor setuid bits on fs */
#define	MNT_NODEV	0x00000010	/* don't interpret special files */
#define	MNT_UNION	0x00000020	/* union with underlying filesystem */
#define	MNT_ASYNC	0x00000040	/* file system written asynchronously */

/*
 * NFS export related mount flags.
 */
#define	MNT_EXPORTED	0x00000100	/* file system is exported */

/*
 * MAC labeled / "quarantined" flag
 */
#define MNT_QUARANTINE	0x00000400	/* file system is quarantined */

/*
 * Flags set by internal operations.
 */
#define	MNT_LOCAL	0x00001000	/* filesystem is stored locally */
#define	MNT_QUOTA	0x00002000	/* quotas are enabled on filesystem */
#define	MNT_ROOTFS	0x00004000	/* identifies the root filesystem */
#define	MNT_DOVOLFS	0x00008000	/* FS supports volfs (deprecated flag in Mac OS X 10.5) */


#define MNT_DONTBROWSE	0x00100000	/* file system is not appropriate path to user data */
#define MNT_IGNORE_OWNERSHIP 0x00200000 /* VFS will ignore ownership information on filesystem objects */
#define MNT_AUTOMOUNTED 0x00400000	/* filesystem was mounted by automounter */
#define MNT_JOURNALED   0x00800000  	/* filesystem is journaled */
#define MNT_NOUSERXATTR	0x01000000	/* Don't allow user extended attributes */
#define MNT_DEFWRITE	0x02000000	/* filesystem should defer writes */
#define MNT_MULTILABEL	0x04000000	/* MAC support for individual labels */
#define MNT_NOATIME	0x10000000	/* disable update of file access time */

/* backwards compatibility only */
#define MNT_UNKNOWNPERMISSIONS MNT_IGNORE_OWNERSHIP


/*
 * XXX I think that this could now become (~(MNT_CMDFLAGS))
 * but the 'mount' program may need changing to handle this.
 */
#define	MNT_VISFLAGMASK	(MNT_RDONLY	| MNT_SYNCHRONOUS | MNT_NOEXEC	| \
			MNT_NOSUID	| MNT_NODEV	| MNT_UNION	| \
			MNT_ASYNC	| MNT_EXPORTED	| MNT_QUARANTINE | \
			MNT_LOCAL	| MNT_QUOTA | \
			MNT_ROOTFS	| MNT_DOVOLFS	| MNT_DONTBROWSE | \
			MNT_IGNORE_OWNERSHIP | MNT_AUTOMOUNTED | MNT_JOURNALED | \
			MNT_NOUSERXATTR | MNT_DEFWRITE	| MNT_MULTILABEL | MNT_NOATIME)
/*
 * External filesystem command modifier flags.
 * Unmount can use the MNT_FORCE flag.
 * XXX These are not STATES and really should be somewhere else.
 * External filesystem control flags.
 */
#define	MNT_UPDATE	0x00010000	/* not a real mount, just an update */
#define	MNT_RELOAD	0x00040000	/* reload filesystem data */
#define	MNT_FORCE	0x00080000	/* force unmount or readonly change */
#define MNT_CMDFLAGS	(MNT_UPDATE|MNT_RELOAD|MNT_FORCE)

But the important one in this context is 'MNT_DONTBROWSE'.

#define MNT_DONTBROWSE	0x00100000	/* file system is not appropriate path to user data */

In other words: 'don't surf here'.

The one of these two directories is nastier than the other: it will in fact timeout for perhaps six seconds under certain circumstances, seemingly looking for a 'connection'. Trying to get in here with Apple's Finder results in a spinning beach ball. Of course by then you're outside the
— Corral and totally on your own.

Trying to get outside the
— Corral with a 'Finder replacement' will net you the same thing.

Even digging in with Terminal will get you nowhere fast. The most prudent thing to do when browsing is to simply not touch these directories until you really want to go there. Which is what Xfile's been doing since the Leopard beta programme.

See Also
Test Drive Xfile
Rixstep: The ACP

About | ACP | Buy | Industry Watch | Learning Curve | News | Products | Search | Substack
Copyright © Rixstep. All rights reserved.