CIFS clients can follow symbolic links, which are created by NFS clients. A symbolic link is a special file that points to another file or directory. A symbolic link is, in some respects, like a shortcut in the Windows environment.
There are two kinds of symbolic links: absolute and relative:
You can control CIFS access to symbolic links in three ways:
When the symbolic links for CIFS feature is enabled, which is the default setting, if the object being accessed by a CIFS client is an absolute or relative symbolic link, the filer follows the link under the following conditions:
CIFS client applications often perform operations such as writing to a temporary file, renaming the original file to a backup name, then renaming the temporary file to the original name. Therefore, take care in using symbolic links whose ultimate target is a file, as opposed to a directory. If the original file were targeted directly by a symbolic link, this sequence of operations would have the result--unintended by the application--of the file being stored in the directory where the symbolic link was, and the renamed symbolic link pointing at the original file rather than to the updated file. For symbolic links to directories, this type of situation does not arise.
Because many PC applications work as described previously, if there are symbolic links that point to files, a PC could encounter such symbolic links. It is best to disable symbolic links for CIFS when there are symbolic links that point to files.
If you expect many files to be changed by applications that update files as described, you might want to disable symbolic links for CIFS.
You enable and disable symbolic links with the cifs.symlinks.enable option. The option is On by default.
To disable symbolic links for CIFS, use
options cifs.symlinks.enable off
To reenable symbolic links for CIFS, use
options cifs.symlinks.enable on
In a UNIX environment, the NFS client interprets the file system location represented by an absolute symbolic link. The CIFS client cannot do this. In a CIFS environment, the filer enables you to redirect absolute symbolic links on the filer.
For example, you might want to redirect symbolic links pointing at the /u/users/charlie directory to the /home/charlie directory on the filer. You do so by specifying symbolic link redirection mappings in a text file named /etc/symlink.translations.
The format of the /etc/symlink.translations file is
Map link target
where both link and target are absolute symbolic link path names.
For example, the entry
Map /u/users/charlie/* /home/charlie/*
makes symbolic links pointing at the /u/users/charlie directory point to the /home/charlie directory.
You can create directory structures that are cyclic by creating a symbolic link that refers to a directory higher in the same tree, through use of a symbolic link having a "dot" or "dot-dot" component. Therefore, a simple recursive descent of the tree goes deeper and deeper until the maximum path length is reached. At that point an error is returned. For example, if you used Windows Explorer to search for files in such a cyclic directory, the same files show up repeatedly.
The cifs.symlinks.cycleguard option controls whether symbolic links that might include a directory higher in the same tree are followed.
To eliminate the possibility of cyclic directory structures, make sure that the cifs.symlinks.cycleguard option is On, which is the default, with the following command:
options cifs.symlinks.cycleguard on
If you use symbolic links having dot or dot-dot components and want the filer to follow the links, set the cifs.symlinks.cycleguard option to Off with the following command:
options cifs.symlinks.cycleguard off
When you list the contents of a directory, symbolic links that are valid references to files or directories are listed as if the target of the symbolic link existed in the directory. If the symbolic link cannot be expanded, it still looks like a file in a directory listing; however, any attempt by an application to open the link results in an access error.
Copyright © 1999, Network Appliance, Inc. All rights reserved.
Part No. 210-02334
File: multi2.htm
Last updated: 04/26/99 08:11:26