Dynamic Configuration Values et al.

Christian A. Lademann cal at zls.de
Fri Sep 12 11:34:33 GMT 1997


**
** I posted this message quite a time ago. Some people use my patch and I
** receive queries for a recent version from time to time. This patch didn't
** make it into the mainstream distribution yet. Sorry.
**
** This is the updated version for Samba-1.9.17p1.
**

Hello, people.

I have implemented some enhancements for Samba:

  1. dynamic configuration-values
  2. configurable attribute-mappings
  3. configuration parameter to make a service mountable but offline
  4. volume-labels longer than 8 chars have to be sent as 8.n


Here are the details:

  1. dynamic configuration-values
  -------------------------------

  This enhancement allows the value of a configuration parameter to be
  read from a file or a command. 
  This is done whenever the parameter is needed by Samba, not when smb.conf
  is parsed.

  Syntax:

    parameter = < filename      sets 'parameter' to the first line of
                                the contents of the specified file
  
    parameter = <$ filename     sets 'parameter' to the first line of
                                the contents of the specified file after
                                applying the normal variable substititions
                                to it
  
    parameter = | command       sets 'parameter' to the first line of
                                the output of the specified command
  
    parameter = |$ command      sets 'parameter' to the first line of
                                the contents of the specified command after
                                applying the normal variable substititions
                                to it


  Example:

    volume = |/usr/local/bin/cdlbl /dev/cd0


  2. configurable attribute-mappings
  ----------------------------------
  These parameters allow to change the UNIX-representation of the DOS
  attributes. This can be handy when re-exporting non-unix-filesystems
  that have another representation of the DOS attributes than the Samba-
  default (CDROMs for example).

  Syntax:

    system mode = octal mode    sets the UNIX-mode-mask to represent the DOS-
                                system-file attribute (Default: 0010)

    archive mode = octal mode   sets the UNIX-mode-mask to represent the DOS-
                                archived attribute (Default: 0100)
                                 
    hidden mode = octal mode    sets the UNIX-mode-mask to represent the DOS-
                                hidden attribute (Default: 0001)


  Example:

    hidden mode = 01000
    archive mode = 02000
    system mode = 04000


  3. configuration parameter to make a service mountable but offline
  ------------------------------------------------------------------
  Sometimes you want to allow your clients to mount a share but not
  to do anything with it (example: ejected or empty CDROM: should
  be mountable but not readable). One way would be to set 'path =' to
  an empty directory but that doesn't really tell the truth to the
  client. This new parameter replies with an error-message if the client
  tries to do something else but mounting or unmounting the share.
  
  Syntax:
  
    online = boolean            on (default): service can be used
                                off: every action except connect and
                                     disconnect produces an error

  Example:

    online = | /usr/local/bin/cdmounted /dev/cd0
  

  4. volume-labels longer than 8 chars have to be sent as 8.n
  -----------------------------------------------------------
  Tracing a problem related to a CDROM-label longer than 8 characters
  I found that Windows sends such labels with a '.' after the 8th
  character. With this patch Samba does that as well.
  The problem was that a DOS program running in a DOS-Box did not
  recognize a CDROM that was exported by Samba.


I hope that these patches are useful for anybody else but me :-)
Please send comments and replies to <cal at zls.de>

--Christian

----------------------------------------------------------------------
Christian A. Lademann                              EMail: <cal at zls.de>
--------------------- speaking from, not for: ------------------------
    ZLS Software GmbH                         Tel.:  (+49) 6195 900500
     D-65779 Kelkheim                         Fax:   (+49) 6195 900600
----------------------------------------------------------------------
---( samba-dyn-1.9.17p1-970912.diff.gz.uu )---------------------------
begin 644 samba-dyn-1.9.17p1-970812.diff.gz
M'XL("($@&30"`W-A;6)A+61Y;BTQ+CDN,3=P,2TY-S`X,3(N9&EF9@"M&FM3
MVTCRL_TK)MY=L)`,%L80(&S"@A-<%S!E.WNYRJ5<0AYC;61)I9&3D,?]]NN>
M'DDCR0:275>"I>G'=/?T:V8\]68SUHJ75TPXBQNG96\?;ML'D=V*?,<+=D2X
MC%V^XX?.-'+BQ;9;0JLBU%NMUB-YU5[&'AOQB-F[\.]HKWO4[3#[\/"@;IKF
M at Q.5J+N=(UM1OWC!6KO[N]8^,_'+;K,7+^J,L3\&@]=LRPVCNX43'6<C-^?<
MYPD?<F<:!OZ=!GCI?."#R`_=#^*X;C+F!0G\&=V)A"\FBW#*M=$+;SKE07GT
M-';GWD>>#Q/C0>![`9<SN7,G9M/E8G'WKO/^F.ULL5D8,\?W;H,%!QY;.W7V
MG0D>?_1<I)#:=?:D=IV]_5R[JS>O7UL,&2 at -)2EC+QU?<`O'2XI6X9J^"`1Q
M1Y/^VU?#:^*K:Z[!!^,+!==LH,'?C(8*KEM#(8SC)2>H,HJ2JM%@^(%Q:1LR
M0Z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O"AYUKN[%'[ML%<>A'_(\
ML(SW4JU=UONHUB_S?53W+ON]TZUU at _NH?M at M'K+N_6YR'_6CW68%D\>Z$5-S
MW7*HG[$4E1Y3614`LM*;46](/Z%3ALHH1(%"%"B at -ESU>N>T%=?(W?F'*)E+
M<GI,R14 at GU!FM0,JQ9V#IYWTIX8U^E4B*`<IV1-,GN^YH<\"SJ?I7?DR8(Y@
MMTLNDN=2W_1`8^8[MP*[2Y5NJ4%Z<L/=$#;[DJ!IX!W.$W?.W0\3QW5AX9LM
M6S9#M?RRN=D;#@=#_#L:_FG!%V$:ZBJ-*HP241TM,3KTDP*92J`G+!.ILIQ2
MMB?:::'6WAOJ'*,LS,7P'(4)P at 3/)>\,JG>`ZCM0"+T`&C1H3.0W0AYYMK"X
M67N"*V$/GRH at UL\<7ZTBQ+-;[3RAN[N+#29^*1=)2^?U8#0>G0W[UV/5Z##6
M'%Q#[W.6&1)-#`:.0I$(-_:BI&CDC%6ECUK+"D^,Z;3S'E:%5NY>5NKPN<"J
MI;,J]I/W\E(GK24_NH?93_.J]J:L=+&UAK#:G++2%=<:PA5M=/FR:\UZ]-/]
M_>3Z='Q!+7WD)'.<VA,0,Q-\:S;EF*7=#[XC7N^W03H^\3W8G!39_MD;#WZ:
1Z4>>A!G3^O\!7B-O"2 at P``!\
`
end
---( EOF )------------------------------------------------------------


More information about the samba mailing list