enЗvХos NSPROTECTION 2 4 1 NSPROTECTION 1 4 By: Bill van Melle (vanMelle@Xerox.com) INTRODUCTION The module NSPROTECTION provides a tool that enables you to easily change the protection of files and directories on Xerox NS file servers. To install the module, load the file NSPROTECTION.LCOM. Also, Your NS file server must be running Services release 10.0 or later. THE PROTECTION MECHANISM An NS File Server maintains a protection for each file and (sub)directory on the server. In most cases, the protection is not specified explicitly, but rather is inherited from a file's parent directory, making it easy to maintain consistent protection over an entire branch of the file system hierarchy. The protection is specified as a set of pairs . The name can be the name of an individual user or a group. The name can also be a pattern of the restricted form *:domain:organization, *:*:organization, or *:*:*. The access rights granted to any particular user are the most general of those in the pairs that match the user's name (by exact match, pattern or membership). The following five kinds of access rights are independently specified (the term "file" here can also denote a directory in the places where that makes sense): Read The user may read the file's content and attributes. In the case of a directory, the user may enumerate files in it. Write The user may change the file's content and attributes, and may delete the file. In the case of a directory, the user may change the protection of any of the directory's immediate children. Add (Applies only to directories) The user may create files in the directory (i.e., add children). Delete (Applies only to directories) The user may delete files from the directory (i.e., remove children). Owner The user may change the file's access list. In the case of directories, it is also possible to independently specify the directory's own protection and the protection that its children inherit by default. In most cases, the latter simply defaults to the former, and it is usually best to keep it that way for simplicity. However, there might conceivably be cases where, for example, you would want a user to be able to read the files in a directory, but not be able to enumerate it, or vice-versa. Note that there can be problems when giving a more lenient protection to a file or directory than to its parents, depending on what software is going to be used to gain access to the file. For example, if your default directory protection grants access only to you, and you want to allow a user to read a particular file stored in your directory, then you can change the protection on just that file to allow Read access. However, the user will have to know the exact name of the file in order to read it, since she won't be able to enumerate the directory to search for the file. Specifying the exact file name works fine from Lisp, but other software that gets to a file by starting at the top and working its way down through the hierarchy would be unable to get to the file. USER INTERFACE To use the tool, select "NS Protection" from the background menu (if your menu has a "System" item, it's a subitem underneath it), or call the function (NSPROTECTION). You are prompted for a place to position the tool's window. Be sure to leave space below the window for the protection information that will follow. `УhџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрР`Р`Р`Р`Р`Р`Р`Р`Р`Р`Р`Р`Р`Р`Р`Р`Р`Р`џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџпџџџџџџћџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрћюРлџСџўџџЛџџр?џяџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрљэїпћџоџўџџПџџ§џџяџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрњэџплог 1у ‡G§№№яџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрћnСлwоЪіюнЛ{;§яooџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрћoяплСоірпЛ{{§яooџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрћЏїплпоіяпЛ{{§яooџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрћЭїплwпоіюнЛ{{§яooџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрћюплпп1уЫ‡{§№№яџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрР`Р`Р`Р`Р `УЬР|€`Р?0Р`Ц Р`€`1€0Р`Ц30Ч™˜`ћяfёѓцЬО>x0Я}ѓ7№`УŒйГ0Ьй˜xэŽf‘лЖЬŒиЬ0йА6Р`СЬйŸрЯЯ№`ЭŒl™›6иЯиЬ0пАћ6Р`РlйŸрЬ№`ЭŒ<љ›6xlЬ0и1›6Р`РlйŒРЬ``ЭŒ8 лЖplЬ1˜1›vР`ЧЬЯ РЧЦ`|Ьь ѓц0ЧЮx?Аљіp`Р0ƒ``Р0ƒ``РрƒР`Р`Р`Р`Р`РР`Чр<іРТp`С€"†РЂˆ`СŒп0"ZXtётЧŽиРЂ9՘qСБB`СŒнГ0"bd„ˆlи№Р’E&dŠЩ$`С™ПLisp or enter a file name in the usual Lisp syntax in the Dir/File field, e.g., Host: Dir/File: {Phylex:}Lisp> This latter form is intended to make it easy to copy-select the name of the directory or file from another source, such as a FileBrowser window; the host in the full name overrides any name in the Host line. To see the protection of a file or directory, click on the command Show. The protection is displayed as a series of editable one-line windows beneath the main window. In each line is a set of access rights and a Clearinghouse name or pattern to which those rights are granted; for example, `УЄџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрР`Р`Р`Р`Р`Р`Р`Р`Р`Р`Р`Р`Р`Р`Р`Р`Р`Р`џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџпџџџџџџћџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрћюРлџСџўџџЛџџр?џяџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрљэїпћџоџўџџПџџ§џџяџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрњэџплог 1у ‡G§№№яџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрћnСлwоЪіюнЛ{;§яooџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрћoяплСоірпЛ{{§яooџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрћЏїплпоіяпЛ{{§яooџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрћЭїплwпоіюнЛ{{§яooџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрћюплпп1уЫ‡{§№№яџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрР`Р`Р`Р`Р `УЬР|€`Р?0Р`Ц Р`€`1€0Р`Ц30Ч™˜`ћяfёѓцЬО>x0Я}ѓ7№`УŒйГ0Ьй˜xэŽf‘лЖЬŒиЬ0йА6Р`СЬйŸрЯЯ№`ЭŒl™›6иЯиЬ0пАћ6Р`РlйŸрЬ№`ЭŒ<љ›6xlЬ0и1›6Р`РlйŒРЬ``ЭŒ8 лЖplЬ1˜1›vР`ЧЬЯ РЧЦ`|Ьь ѓц0ЧЮx?Аљіp`Р0ƒ``Р0ƒ``РрƒР`Р`Р`Р`Р`РР`Чр<іРТp`С€"†РЂˆ`СŒп0"ZXtётЧŽиРЂ9՘qСБB`СŒнГ0"bd„ˆlи№Р’E&dŠЩ$`С™П`Ц00ˆ Aƒ `Ц1уќРШQШˆˆуŽ`РР`Р`Р `Р`Р`Р`Р`РА`Чу}А‚`Ц0`0€€`Ц{aГЦ8<[œё-Рр‚sРp`Цw}ЖfРd 2‚‚ `ЦfaЗрРCy!€‚b `ЦfaЖ8"@ˆ‰ @р‚ p`Ц3faЖ&@ˆ™ G‚#€`ЧуfaГцGi#€њуР`Р`Р`Р`Р`Р`џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџр€ € ŸџџўџџСџџќџќџџј?џ€ ŸџџњџџСџћєџєџџј?і€  џџњ §ўСяћєєџј=і€ pр ˜3р —џњ ўСяћєПєПџј=і€0 ˆ€2 —qУТ ЄAзУ„мtзv˜:і€0#‹9cХ‹sž%ИˆŽ8уХaR ю§К kžСзЛtлДзvh:і€|ё€$L&AL&@A&!‘SР –рсК kОСЛЛtи4кЎш7v€1™€$HфAШa$0 1ёф!ˆ’ —oнК kОСƒЛtлєкЎш0v€1˜$H‘$AH$ $!ˆ’ —oйКїОС}ЛtЛєНош/Ж€1˜$H“d@ˆШ$ d!D —АхТїП}У„|4}ош/Ж€1˜Уˆ Є@p€уHрЭ$pˆOpёЄC‘р ŸџџўџџСџџќџќџџј?џ€ё€€€ ŸџџўџџСџџќџќџџј?џ€€ ŸџџўџџСџџќџќџџј?џ€ ŸџџўџџСџџќџќџџј?џ€ € € џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџр€ € Ÿџџўџџќ Ÿџџњџћє   џџњяћє€€ ‚Р xСŸ —џњbяћє@@ 0€ D С —qУТb[зУ„#ˆ(‰` 0‚sФШN#-ФDqЧ,ы(@Ђ ю§К”aзЛt$H(‰ |ё€‚‚$$‘$H‘2xŠ1 ˆ(@Ђž –рсК”AЛЛt'Ш%Q‰1™€‚b$фŸ$HŸ!€Hљ!€D@” —oнК”AƒЛt$%Q‰1˜‚$$H @D€H!€|@” —oйКA}ЛtDB!I1˜‚$"$H @D€H!€‚ ˆ —АхТ@С}У„ƒШ‚!I1˜њуЧСу##„B{‡ шˆ‚ˆŸ Ÿџџўџџќё€ Ÿџџўџџќ€ Ÿџџўџџќ Ÿџџўџџќ € € џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџр€ € Ÿџџў Ÿџџњ  џџњ€€ Ј˜3р —џњb@@ 0p€2 —qУТb[€(Lisp>*" matches all files (including subdirectories) anywhere in the directory Lisp>, but does not include Lisp> itself. Note that applying a protection to a directory is different from applying the same protection to the files in it, because of defaulting. If you apply a protection to Lisp>*, it changes the protection of every file currently in the directory, but any new files added after the change still inherit the protection of the directory Lisp>. On the other hand, applying a protection to the directory Lisp> itself affects all current and future files in the directory, except any files that already have an explicit protection currently set. To reduce confusion, it is thus preferable to apply protections to subdirectories, rather than individual files, if you want to control a whole group of files. If you have a subdirectory containing files of miscellaneous protection that you would like to make uniform, the best procedure is to set the desired protection on the subdirectory itself, and then use the Set to Default command with a pattern (e.g., Lisp>*) to reset all the individual files to defaulted. The Apply command looks up in the Clearinghouse each of the names in the individual protection entries to make sure that they are valid, and replaces aliases (nicknames) with the canonical names. It then tells the file server to change the protection as indicated. The extent to which the Apply command checks names is controlled by the Check item in the second line of the tool window. It has four possible settings: New Names Only This is the default setting. The tool checks any names that you have entered or changed, but assumes that names returned by the Show command were correct. All Names The tool checks all names, regardless of source. You might want to do this to convert an existing protection entry into canonical form, or check that all the names are still valid. Never The tool never checks names; it assumes you meant exactly what you typed. You might want this setting, for example, if one of the names you are entering is registered only in a distant Clearinghouse not currently accessible. I really mean it Not only does the tool not check the names, it also doesn't balk if you tell it to take certain unlikely actions, such as changing a top-level directory to default protection, setting a completely null protection, or setting a protection in which nobody has Owner rights (which means the protection can only be changed by someone with Write access to the parent, if any). This setting is "one-shot"џџя%it reverts to "џNew Names Only" after you issue the next command. The Type item in the second line of the tool window controls which of a directory's two protection attributes is displayed or set. The initial setting is "Principal" and is the one that should normally be used (it coincides with the Lisp file attribute PROTECTION, or "Access List" in NS Filing parlance). The other setting is "Children Only". When the protection type is set this way, the tool deals with the protection that is inherited by default by the directory's children, the attribute called "Default Access List" in NS Filing parlance. Ordinarily, this attribute is defaulted, in which case the directory's principal protection is also used as its children's default protection. Using the Apply command changes the Default Access List to the value you specify; using the Set to Default command changes it back to defaulted. The Show command displays the directory's Default Access List if it has one; otherwise, it displays the principal protection and notes this fact in the prompt window. The Type item is irrelevant for non-directory files (and, in fact, the tool sets it back to "Principal" if it has been changed). When the file is a pattern, the tool always sets the Principal protection; in the case of any subdirectories matching the pattern, it sets the Principal protection to that specified in the window and the Default Access List to "default". As an additional convenience feature, when you request to Show the "Principal" protection of a top-level directory, the tool also displays in the prompt window the directory's current page usage and allocation.(LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "" "") STARTINGPAGE# 164) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "" "")) (174 42 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE NIL . LETTER) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO NIL) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE NIL . LETTER) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO NIL) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))))) 5lШ`l-ШT-ШT5HШ<H,Ш,HHШ,Ш,Ш ,Ш,ŠŠ8,ŠŠ8HШШ PAGEHEADING RUNNINGHEADCLASSICCLASSICCLASSICMODERN MODERN MODERN MODERN MODERN    HRULE.GETFNMODERN   HRULE.GETFNMODERN   HRULE.GETFNMODERN    HRULE.GETFNMODERN   HRULE.GETFNMODERN  ( Œƒ2Œ |Хdl3Ш?œ BMOBJ.GETFN3MODERN NДKx>  5 ХCн%4 BMOBJ.GETFN3MODERN #u%ŠP L.%1 §vZ-e…CёГb+MЌСщЁ#4ЗM,Ÿh:”ksМzК