• Aucun résultat trouvé

Mangling Options

Dans le document Browsing andAdvanced Disk Shares 5 (Page 32-36)

Samba allows you to give it more refined instructions on how it should perform name mangling, including those controlling the case sensitivity, the character inserted to form a mangled name, and the ability to manually map filenames from one format to another. These options are shown in Table 5-7.

Table 5-7. Name Mangling Options

Option Parameters Function Default Scope

case sensitive (casesignames)

boolean Ifyes, Samba will treat file-names as case-sensitive (Windows doesn’t).

no Share

default case (upper or lower)

Case to assume as default (only used when preserve case isno).

Lower Share

case sensitive

This share-level option, which has the obtuse synonym casesignames, specifies whether Samba should preserve case when resolving filenames in a specific share.

The default value for this option is no, which is how Windows handles file resolu-tion. If clients are using an operating system that takes advantage of case-sensitive filenames, you can set this configuration option toyes as shown here:

[accounting]

case sensitive = yes

Otherwise, we recommend that you leave this option set to its default.

default case

Thedefault caseoption is used withpreserve case. This specifies the default case (upper or lower) that Samba will use when it creates a file on one of its shares on behalf of a client. The default case is lower, which means that newly created files will use the mixed-case names given to them by the client. If you need to, you can override this global option by specifying the following:

[global]

default case = upper

preserve case boolean Ifyes, keep the case the client supplied (i.e., do not convert todefault case).

yes Share

short preserve case

boolean Ifyes, preserve case of 8.3-format names that the client provides.

yes Share

mangle case boolean Mangle a name if it is mixed case.

no Share

mangled names boolean Mangles long names into 8.3 DOS format.

yes Share

mangling char string (single character)

Gives mangling character. ~ Share

mangled stack numerical Number of mangled names to keep on the local man-gling stack.

50 Global

mangled map string (list of patterns)

Allows mapping of filena-mes from one format into another.

None Share Table 5-7. Name Mangling Options (continued)

Option Parameters Function Default Scope

Name Mangling and Case 147

If you specify this value, the names of newly created files will be translated into uppercase, and cannot be overridden in a program. We recommend that you use the default value unless you are dealing with a Windows for Workgroups or other 8.3 client, in which case it should beupper.

preserve case

This option specifies whether a file created by Samba on behalf of the client is cre-ated with the case provided by the client operating system, or the case specified by thedefault caseconfiguration option above. The default value is yes, which uses the case provided by the client operating system. If it is set tono, the value of thedefault case option is used.

Note that this option does not handle 8.3 file requests sent from the client—see the short preserve caseoption below. You may want to set this option toyes if applications that create files on the Samba server are sensitive to the case used when creating the file. If you want to force Samba, for example, to mimic the behavior of a Windows NT filesystem, you can leave this option to its default,yes.

short preserve case

This option specifies whether an 8.3 filename created by Samba on behalf of the client is created with the default case of the client operating system, or the case specified by the default case configuration option. The default value is yes, which uses the case provided by the client operating system. You can let Samba choose the case through thedefault case option by setting it as follows:

[global]

short preserve case = no

If you want to force Samba to mimic the behavior of a Windows NT filesystem, you can leave this option set to its default,yes.

mangled names

This share-level option specifies whether Samba will mangle filenames for 8.3 cli-ents in that share. If the option is set tono, Samba will not mangle the names and (depending on the client), they will either be invisible or appear truncated to those using 8.3 operating systems. The default value is yes. You can override it per share as follows:

[data]

mangled names = no

mangle case

This option tells Samba whether it should mangle filenames that are not com-posed entirely of the case specified using thedefault caseconfiguration option.

The default for this option is no. If you set it to yes, you should be sure that all clients will be able to handle the mangled filenames that result. You can override it per share as follows:

[data]

mangle case = yes

We recommend that you leave this option alone unless you have a well-justified need to change it.

mangling char

This share-level option specifies the mangling character used when Samba man-gles filenames into the 8.3 format. The default character used is a tilde (~). You can reset it to whatever character you wish, for instance:

[data]

mangling char = #

mangled stack

Samba maintains a local stack of recently mangled 8.3 filenames; this stack can be used to reverse map mangled filenames back to their original state. This is often needed by applications that create and save a file, close it, and need to modify it later. The default number of long filename/mangled filename pairs stored on this stack is 50. However, if you want to cut down on the amount of processor time used to mangle filenames, you can increase the size of the stack to whatever you wish, at the expense of memory and slightly slower file access.

[global]

mangled stack = 100

mangled map

If the default behavior of name mangling is not sufficient, you can give Samba fur-ther instructions on how to behave using the mangled map option. This option allows you to specify mapping patterns that can be used before or even in place of name mangling performed by Samba. For example:

[data]

mangled map =(*.database *.db) (*.class *.cls)

Here, Samba is instructed to search each file it encounters for characters that match the first pattern specified in the parenthesis and convert them to the modi-fied second pattern in the parenthesis for display on an 8.3 client. This is useful in

Dans le document Browsing andAdvanced Disk Shares 5 (Page 32-36)

Documents relatifs