Just-in-time mounts when following symlinks

Albert Chin-A-Young china at pprd.abbott.com
Thu Jun 4 20:54:28 GMT 1998

On Thu, 4 Jun 1998, Luke Kenneth Casson Leighton wrote:

>[cross-posted to samba-technical, samba-ntdom and samba].
>On Thu, 4 Jun 1998, Albert Chin-A-Young wrote:
>> [description removed]
>my suggestion to solve this was to have a function that either calls lstat
>or stat with a boolean switch.  then, identify _all_ SMB calls that make a
>stat or lstat calls.  then, subdivide them into calls that need to have
>the real file/directory time/date and those that could get away with the
>file/directory link time/date.  this _may_ require an smb.conf file list
>at a first guess, you could do lstat on directories, and stat on files.
>my second guess is simply that stat is being accidentally called (which
>triggers the automount lookup) in places where lstat should only be
>called (under the control of lp_symlinks() whatever).
>opinions / comments welcomed.

Ok, following discussions with Paul Epp <epp at clrtech.bc.ca>, there are
a total of three ways to solve this problem:
	1. Add the following options to smb.conf:
		jit symlinks = yes/no
		file symlinks = [pointer to file with REs]
		directory symlinks = [pointer to file with REs]
	   Then wrap calls to stat() accordingly so that symbolic
	   links in a particular directory are treated as files
	   or directories and force lstat() on them. The
	   'jit symlinks' stands for 'just-in-time symlinks' and
	   would enable this feature. This would be a general-
	   purpose mechanism for anyone with trees of symbolic
	2. Move Samba to a Solaris 2.6 platform running the Solaris
	   automounter. Due to the new browsability feature that
	   exists in this automounter, Samba can walk the list of
	   automounter keys without causing a mount storm because
	   the automounter lies when stat() is called (so nothing
	   is mounted). An added benefit to this is that we
	   can point shares directly at the automounter namespace
	   and get rid of our utility to create a tree of links
	   from the automounter maps.
	3. Modify the Berkeley AMD automounter to lie about stat()
	   as the Solaris 2.6 automounter does.

What do you all think? Paul is already coding up solution #1 and
will be done shortly. I have tested solution #2 and it works just
fine (though we're running AMD here).


albert chin (china at pprd.abbott.com)

More information about the samba-technical mailing list