








				   SMB HOWTO

		    @: David Wood, dwood@plugged.net.au

		   Ķ: J.S. Lin, r6921068@ms.cc.ntu.edu.tw

			     v1.0, 10 August 1996



				   Abstract

     oO SMB HOWTO {pϥ SMB}.  oyzb Linux Wpϥ Session
     Message Block (SMB) protocol{w}, ]s NetBIOS  LanManager pro
     tocol.



1.  

oO SMB HOWTO {pϥ SMB} .  oyzb Linux Wpϥ Session Message
Block (SMB) protocol, ]s NetBIOS  LanManager protocol.

󪺺@̬O David Wood (dwood@plugged.net.au).
A,קέץiHH쨺,HKU@][ih.

SMB protocol QϥΦb Microsoft Windows 3.11, NT M 95 ΨӤɺϺФΦL.
ϥ Andrew Tridgell Ұ Samba uM, UNIX (]t Linux)
ɺϺлPL Windows D.

^Hϥ Samba |˪FiH:

  1.   linux Ϻе Windows .

  2.   Windows Ϻе linux .

  3.   linux L Windows .

  4.   Windows L linux .

oǪF賣w]tb.

Disclaimer: procedures M script n@̬OiH`B@,έnѨ(proce
duresMscript)Ѫ̳iiH`B@.
HboتTP]wi|ॿ`B@.pGADJx,AiH e-mail
@,Xĳӧi, @̨ä@O.AwO?
@̲uOU.....


2.  i@BT

o HOWTO ]khp]w򥻪 SMBɥHΦCLAȦb linux W. Samba


SMB HOWTO								      1





SMB HOWTO								      2



OӫD`B㪺]. boӦaSn]khƻsҦ Samba .

i@BT,ЬݥHU:

    Samba , io Samba oM{distribution}.
     oMiob: ftp://nimbus.anu.edu.au/pub/tridge/samba/1

    The linux Printing HOWTO.

    The Print2Win Mini-HOWTO.


3.  w

̷s Samba l{iHo:

ftp://nimbus.anu.edu.au/pub/tridge/samba/2

M,pGww linux  Redhat ,AiHϥγnM{package}
Ӧw˥.ǨL]]t Samba binaries{Gɵ{}.

HU daemon{޲zF}  Samba nM On. ̤@OQw˦b
/usr/sbin ,ӥib},qtΰ_ʪ scriptsinetdӰ. scriptҤlQiܦb
 Daemons (section 4., page 3).

	  smbd (The SMB daemon)
	  nmbd ( NetBIOS nameserver 䴩 clients)

@Ө,HU Samba  binaries Qw˦b /usr/bin, MmOiܩ.

	  smbclient (@بѵ UNIX Ϊ SMB  client{{})
	  smbprint  (@ script ΦbCL SMB D{host}WC)
	  smbprint.sysv  (PW, Oѵ SVR4 UNIX Ϊ)
	  smbstatus (CXaDثe SMB sp)
	  smbrun	 (@ 'glue' script Ψ²aε{ SMB D)

A,@إs 'print'  script Q]b HOWTO , Ψӷ@@ئΪ front
end{eݤ}  smbprint script.

Samba nMO²w˪.²aqWz}olX, B\ŪboM󤤪
README ɮ. boM󤤤]@ docs/INSTALL.txt
ɴѤ@²檺vBw˫.

ۦw˫,  daemons  /usr/sbin  binaries  /usr/bin.  man
pages{U} \b /usr/local/man.

Ab Samba nM, Ab Makefile |OպA,smb.conf,m.
o@Ob /etcU, iH⥦\Aw\Nm. oǨϥΤk{direc
tions}, ڭ̱N]AOոɦm /etc/smb.conf, log ɦm log file =

____________________

1. <URL:ftp://nimbus.anu.edu.au/pub/tridge/samba/>

2. <URL:ftp://nimbus.anu.edu.au/pub/tridge/samba/>







SMB HOWTO								      3



/var/log/samba-log.%m , lock ؿ lock directory = /var/lock/samba.

w˲պA{configuration}, smb.conf. h Samba Ҧbؿ. ݤ@Ublؿ
example/simple ӥBŪ@U README . ƻsbӥؿU smb.conf ɨ /etc U.
`N! pGA@ linux oMww˦n Samba, A]\w Samba պAɦb /etc
U. γ\Aӱqɶ}l.

pGAQպAɩb /etc ؿU,iH⥦\bAQn\a,Mb /etc
U@U symlink{Ÿs}:

	  ln -s /path/to/smb.conf /etc/smb.conf


4.  o daemon

o daemon O /usr/sbin/smbd M /usr/sbin/nmbd.

AiH Samba daemon q inetd ηW{.
pGA]w@ӥä[ɮצA,Aӱq inetd
Ӱ,ҥHpGL̦,Ns}l.pGAuOQnϥ SMB
A,Ϊ̥Ψtκ޲zӻU,Aݭn,AiHǥѨϥ /etc/rc.d/init.d
script,άƦܪʪ.

nq inetd Ӱ daemon , ЩHUXb inetd պA, /etc/inetd.conf:


	      # SAMBA NetBIOS services (for PC file and print sharing)
	      netbios-ssn stream tcp nowait root /usr/sbin/smbd smbd
	      netbios-ns dgram udp wait root /usr/sbin/nmbd nmbd


MUOHKsҰ inetd daemon :

	 kill -HUP 1

nqtαҰʪ script Ӱ daemon, ЧHU script m@ӥs
/etc/rc.d/init.d/smb , ӥB symbolically link {comments}һɮ:

























SMB HOWTO								      4



	      #!/bin/sh

	      #
	      # /etc/rc.d/init.d/smb - starts and stops SMB services.
	      #
	      # The following files should be synbolic links to this file:
	      # symlinks: /etc/rc.d/rc1.d/K35smb  (Kills SMB services on shutdown)
	      # 	  /etc/rc.d/rc3.d/S91smb  (Starts SMB services in multiuser mode)
	      # 	  /etc/rc.d/rc6.d/K35smb  (Kills SMB services on reboot)
	      #

	      # Source function library.
	      . /etc/rc.d/init.d/functions

	      # Source networking configuration.
	      . /etc/sysconfig/network

	      # Check that networking is up.
	      [ ${NETWORKING} = "no" ] && exit 0

	      # See how we were called.
	      case "$1" in
		start)
	       echo -n "Starting SMB services: "
	       daemon smbd -D
	       daemon nmbd -D
	       echo
	       touch /var/lock/subsys/smb
	       ;;
		stop)
	       echo -n "Shutting down SMB services: "
	       killproc smbd
	       killproc nmbd
	       rm -f /var/lock/subsys/smb
	       echo ""
	       ;;
		*)
	       echo "Usage: smb {start|stop}"
	       exit 1
	      esac



5.  @պA]w (/etc/smb.conf)

b linux (ΨL UNIX)W Samba պA]wOQ@ɮ, /etc/smb.conf
,ұ. oɨMwAQnӨtθ귽ɵ~@ɥHΧAQL̰򭭨.

]HU`N|Bz linux ϺлPL Windows , p`Үiܪ
smb.conf ɾqOAүo²檺, uOHЩʬت.

ثe٤n߲Ӹ`. ᭱`N|ХDn.

bɮפCq{section}|ӬqY}l, YO [global], [homes],








SMB HOWTO								      5



[printers] .

[global] qwq@ܼ,  Samba NΨөwqҦ귽.

[homes] q\ݨϥΪ̨Ӧsba(linux)WL̪(BuL̪) home
directories{aؿ}. ]NO, pG@ Windows ϥΪ̱qL̪ Windows
n]ksoӤ, ḺNOsL̦ۤvӤH home directiory.
no˨Ʊ,ҭn`NO,L̥blinux boxWӱb.

HU smb.conf ɮ׼˥\ݨϥΪ̨ӥηaWL̪ home directories
ӥBg@ӼȦsؿ. @ Windows ϥΪ,nQݨoǤ, linux box
Obϰ{local network}. M,ϥΪ²aq Windows File Manager 
Windows Explorer sϺ.

bHUqn`NO, oɤB~رN|ΨӤ\h귽Q.


	  ; /etc/smb.conf
	  ;
	  ; Make sure and restart the server after making changes to this file, ex:
	  ; /etc/rc.d/init.d/smb stop
	  ; /etc/rc.d/init.d/smb start

	  [global]
	  ; Uncomment this if you want a guest account
	  ; guest account = nobody
	     log file = /var/log/samba-log.%m
	     lock directory = /var/lock/samba
	     share modes = yes

	  [homes]
	     comment = Home Directories
	     browseable = no
	     read only = no
	     create mode = 0750

	  [tmp]
	     comment = Temporary file space
	     path = /tmp
	     read only = no
	     public = yes



6.   Linux Ϻе Windows 

HWҮiܪ smb.conf ˥,  linux Ϻе Windows ϥΪ̬Oܮe. M,
 Samba LF, AiHܤj{. HUǨҤl :

Fɥؿjaϥ, Nإ߭Wz [tmp] q, Y[JoӪF
smb.conf:











SMB HOWTO								      6



	  [public]
	     comment = Public Stuff
	     path = /home/public
	     public = yes
	     writable = yes
	     printable = yes

FϥHWؿѤjiŪ,usզ{group
staff}igJ,Эק䶵عo:


	  [public]
	     comment = Public Stuff
	     path = /home/public
	     public = yes
	     writable = yes
	     printable = no
	     write list = @staff


LϺФɪޥ,Ь Samba  man pages.


7.   Windows Ϻе Linux 

@ص UNIX Ϊ SMB client {Q]tb Samba
oM󤧤.Ѥ@ئbROCUftp.

QnݦbwDWǤɥio, :

	 /usr/sbin/smbclient -L host

oت 'host' OAQnsWl. oN|^@ 'service' W - ]NO,
ҤɵAϺЩΦLW. D SMB ASwW]w,
_hNnDAJKX.  'guest'
bKXάOAӤHbxWbKX.

|ӨҤl:

	 smbclient -L zimmerman

oӫOXӬݰ_ӹOo:




















SMB HOWTO								      7



	  Server time is Sat Aug 10 15:58:27 1996
	  Timezone is UTC+10.0
	  Password:
	  Domain=[WORKGROUP] OS=[Windows NT 3.51] Server=[NT LAN Manager 3.51]

	  Server=[ZIMMERMAN] User=[] Workgroup=[WORKGROUP] Domain=[]

		  Sharename	 Type	   Comment
		  ---------	 ----	   -------
		  ADMIN$	 Disk	   Remote Admin
		  public	 Disk	   Public
		  C$		 Disk	   Default share
		  IPC$		 IPC	   Remote IPC
		  OReilly	 Printer   OReilly
		  print$	 Disk	   Printer Drivers


	  This machine has a browse list:

		  Server	       Comment
		  ---------	       -------
		  HOPPER	       Samba 1.9.15p8
		  KERNIGAN	       Samba 1.9.15p8
		  LOVELACE	       Samba 1.9.15p8
		  RITCHIE	       Samba 1.9.15p8
		  ZIMMERMAN


o browse list CXL귽ɵ SMB A.

nϥΦ client, а:

	 /usr/sbin/smbclient service <password>

oت 'service' O@xMɦW. |ҦӨ,pGA]ks@xs zimmer
man WH 'public' ɦW٪ؿ , service ns  \\zimmerman\pub
lic. M,] shell , A|ݭn backslashes, ҥHAno˪:

	 /usr/sbin/smbclient \\\\zimmerman\\public mypasswd

o˪ 'mypasswd' OAKXr{literal string}.

AN| smbclient ܲŸ{prompt}X{:


	  Server time is Sat Aug 10 15:58:44 1996
	  Timezone is UTC+10.0
	  Domain=[WORKGROUP] OS=[Windows NT 3.51] Server=[NT LAN Manager 3.51]
	  smb: \>


J 'h' oϥ smbclient  help:










SMB HOWTO								      8



	  smb: \> h
	  ls		 dir		lcd	       cd	      pwd
	  get		 mget		put	       mput	      rename
	  more		 mask		del	       rm	      mkdir
	  md		 rmdir		rd	       prompt	      recurse
	  translate	 lowercase	print	       printmode      queue
	  cancel	 stat		quit	       q	      exit
	  newer 	 archive	tar	       blocksize      tarmode
	  setmode	 help		?	       !
	  smb: \>


pGAϥftp,AӤݭnd smbclient  man pages.


8.   Linux L Windows 

F Linux L Windows , ATwALwg˳]n.
pGAq linux WCL,]w SMB LɱN|ܪ.

Ш Printing HOWTO ӳ]waCL.

]@̨ϥγQs Windows NT L,
op`ӳQܧ㪺,ӥuOĳ.󦳸ԲӸƥiɥXӪH,
бNoǸƱH dwood@plugged.net.au ϱoop`.

[JCL]wA smb.conf:



































SMB HOWTO								      9



	  [global]
	     printing = bsd
	     printcap name = /etc/printcap
	     load printers = yes
	     log file = /var/log/samba-log.%m
	     lock directory = /var/lock/samba

	  [printers]
	     comment = All Printers
	     security = server
	     path = /var/spool/lpd/lp
	     browseable = no
	     printable = yes
	     public = yes
	     writable = no
	     create mode = 0700

	  [ljet]
	     security = server
	     path = /var/spool/lpd/lp
	     printer name = lp
	     writable = yes
	     public = yes
	     printable = yes
	     print command = lpr -r -h -P %p %s


T{L|(ҤlOb[ljet]U)nP /etc/printcap spool ؿ۲ŦX!

`N:  ϥ Samba Ӥ UNIX boxes WL Windows NT @ǰD.
䤤@ӰDOϥ NT AaݨɪL. QnץoӰD, Ь Samba
oMW, Y docs/WinNT.txt ɮ.LOBzKXD.
oZHDFѻPন\ץ,ЬݬۦPW.


9.   Windows L Linux 

F Windows WL, AHUBJ:

a) Ab /etc/printcap AO,ӥBL̥Paؿc ( spool
ؿ) ۲ŦX.

b) A script  /usr/bin/smbprint. o|Hb Samba source,
OHҦ Samba binary oM. @ӵyLק睊bHUQ.

c) pGAQnഫ ASCII ɨ Postscript,Anetscript,λP䵥Ī.
netscipt O@ Postscript ഫӥB@Ow˦b /usr/bin.

d) AiHƱǥѦϥΪ frond end Ө Samba CLe. @إΩBz
ASCII, Postscript Ϋإ Postscript ² perl script bUw.

HU /etc/printcap إΦb Windows NT DW HP 5MP L. oǶئpU:










SMB HOWTO								     10



	  cm - comment
		  {}
	  lp - device name to open for output
		  {FX,ӭn}Ҫ]ƦW}
	  sd - the printer's spool directory (on the local machine)
		  {L spool ؿ (baW)}
	  af - the accounting file
		  {bɮ}
	  mx - the maximum file size (zero is unlimited)
		  {̤jɮפjp (sܨS)}
	  if - name of the input filter (script)
		  {JLoW (script)}

nohT,Ь Printing HOWTO Ϊ printcap  man page.


	  # /etc/printcap
	  #
	  # //zimmerman/oreilly via smbprint
	  #
	  lp:\
		  :cm=HP 5MP Postscript OReilly on zimmerman:\
		  :lp=/dev/lp1:\
		  :sd=/var/spool/lpd/lp:\
		  :af=/var/spool/lpd/lp/acct:\
		  :mx#0:\
		  :if=/usr/bin/smbprint:


нTw spool M accounting{b} ؿsbBigJ. нTHY榳A|
smbprint script (bU|) ӥBTwA]ƳQ ( /dev UY).

UӬO smbprint script . q`Q\b /usr/bin ӥBO] Andrew Tridgell
tG,ӾڧکҪOLгyF Samba. Hb Samba source oM, bY
binary oMèS, ҥHboڦAy@.

AiHƱJӦaݳo. YǸpקwgҩ̬OܦΪ.

























SMB HOWTO								     11



	  #!/bin/sh -x

	  # This script is an input filter for printcap printing on a unix machine. It
	  # uses the smbclient program to print the file to the specified smb-based
	  # server and service.
	  # For example you could have a printcap entry like this
	  #
	  # smb:lp=/dev/null:sd=/usr/spool/smb:sh:if=/usr/local/samba/smbprint
	  #
	  # which would create a unix printer called "smb" that will print via this
	  # script. You will need to create the spool directory /usr/spool/smb with
	  # appropriate permissions and ownerships for your system.

	  # Set these to the server and service you wish to print to
	  # In this example I have a WfWg PC called "lapland" that has a printer
	  # exported called "printer" with no password.

	  #
	  # Script further altered by hamiltom@ecnz.co.nz (Michael Hamilton)
	  # so that the server, service, and password can be read from
	  # a /usr/var/spool/lpd/PRINTNAME/.config file.
	  #
	  # In order for this to work the /etc/printcap entry must include an
	  # accounting file (af=...):
	  #
	  #   cdcolour:\
	  #    :cm=CD IBM Colorjet on 6th:\
	  #    :sd=/var/spool/lpd/cdcolour:\
	  #    :af=/var/spool/lpd/cdcolour/acct:\
	  #    :if=/usr/local/etc/smbprint:\
	  #    :mx=0:\
	  #    :lp=/dev/null:
	  #
	  # The /usr/var/spool/lpd/PRINTNAME/.config file should contain:
	  #   server=PC_SERVER
	  #   service=PR_SHARENAME
	  #   password="password"
	  #
	  # E.g.
	  #   server=PAULS_PC
	  #   service=CJET_371
	  #   password=""

	  #
	  # Debugging log file, change to /dev/null if you like.
	  #
	  logfile=/tmp/smb-print.log
	  # logfile=/dev/null


	  #
	  # The last parameter to the filter is the accounting file name.
	  #
	  spool_dir=/var/spool/lpd/lp








SMB HOWTO								     12



	  config_file=$spool_dir/.config

	  # Should read the following variables set in the config file:
	  #   server
	  #   service
	  #   password
	  #   user
	  eval `cat $config_file`

	  #
	  # Some debugging help, change the >> to > if you want to same space.
	  #
	  echo "server $server, service $service" >> $logfile

	  (
	  # NOTE You may wish to add the line `echo translate' if you want automatic
	  # CR/LF translation when printing.
		  echo translate
	       echo "print -"
	       cat
	  ) | /usr/bin/smbclient "\\\\$server\\$service" $password -U $user -N -P >> $logfile


j linux oMH nenscript Ψഫ ASCII  Postscript. HU
perl script g smbprint ϧeѤ@²椶 linux CL.

     Usage: print [-a|c|p] <filename>
	    -a prints <filename> as ASCII
	    -c prints <filename> formatted as source code
	    -p prints <filename> as Postscript
	     If no switch is given, print attempts to
	     guess the file type and print appropriately.

ϥ smbprint ӦCL ASCII ɮ׫KI_L. pGi઺,o script
I_ťB(Nbr).

榡ƹLlXOQ nenscript BzL. Bz ASCII ɦӥBέӯS諸Y(
date,filename)榡Ʀ. ]ip. ϥγo@Ҥl,
L榡AiHF.

Postscript wgAa榡ƤF,ҥH̪qL.





















SMB HOWTO								     13



	  #!/usr/bin/perl

	  # Script:   print
	  # Authors:  Brad Marshall, David Wood
	  #	   Plugged In Communications
	  # Date:     960808
	  #
	  # Script to print to oreilly which is currently on zimmerman
	  # Purpose:  Takes files of various types as arguments and
	  # processes them appropriately for piping to a Samba print script.
	  #
	  # Currently supported file types:
	  #
	  # ASCII      - ensures that lines longer than $line_length characters wrap on
	  #		 whitespace.
	  # Postscript - Takes no action.
	  # Code       - Formats in Postscript (using nenscript) to display
	  #		 properly (landscape, font, etc).
	  #

	  # Set the maximum allowable length for each line of ASCII text.
	  $line_length = 76;

	  # Set the path and name of the Samba print script
	  $print_prog = "/usr/bin/smbprint";

	  # Set the path and name to nenscript (the ASCII-->Postscript converter)
	  $nenscript = "/usr/bin/nenscript";

	  unless ( -f $print_prog ) {
	       die "Can't find $print_prog!";
	  }
	  unless ( -f $nenscript ) {
	       die "Can't find $nenscript!";
	  }

	  &ParseCmdLine(@ARGV);

	  # DBG
	  print "filetype is $filetype\n";

	  if ($filetype eq "ASCII") {
	       &wrap($line_length);
	  } elsif ($filetype eq "code") {
	       &codeformat;
	  } elsif ($filetype eq "ps") {
	       &createarray;
	  } else {
	       print "Sorry..no known file type.\n";
	       exit 0;
	  }
	  # Pipe the array to smbprint
	  open(PRINTER, "|$print_prog") || die "Can't open $print_prog: $!\n";
	  foreach $line (@newlines) {








SMB HOWTO								     14



	       print PRINTER $line;
	  }
	  # Send an extra linefeed in case a file has an incomplete last line.
	  print PRINTER "\n";
	  close(PRINTER);
	  print "Completed\n";
	  exit 0;

	  # --------------------------------------------------- #
	  #	   Everything below here is a subroutine	#
	  # --------------------------------------------------- #

	  sub ParseCmdLine {
	       # Parses the command line, finding out what file type the file is

	       # Gets $arg and $file to be the arguments (if the exists)
	       # and the filename
	       if ($#_ < 0) {
		    &usage;
	       }
	       # DBG
	  #    foreach $element (@_) {
	  #	    print "*$element* \n";
	  #    }

	       $arg = shift(@_);
	       if ($arg =~ /\-./) {
		    $cmd = $arg;
	       # DBG
	  #    print "\$cmd found.\n";

		    $file = shift(@_);
	       } else {
		    $file = $arg;
	       }

	       # Defining the file type
	       unless ($cmd) {
		    # We have no arguments

		    if ($file =~ /\.ps$/) {
			 $filetype = "ps";
		    } elsif ($file =~ /\.java$|\.c$|\.h$|\.pl$|\.sh$|\.csh$|\.m4$|\.inc$|\.html$|\.htm$/) {
			 $filetype = "code";
		    } else {
			 $filetype = "ASCII";
		    }

		    # Process $file for what type is it and return $filetype
	       } else {
		    # We have what type it is in $arg
		    if ($cmd =~ /^-p$/) {
			 $filetype = "ps";
		    } elsif ($cmd =~ /^-c$/) {








SMB HOWTO								     15



			 $filetype = "code";
		    } elsif ($cmd =~ /^-a$/) {
			 $filetype = "ASCII"
		    }
	       }
	  }

	  sub usage {
	       print "
	  Usage: print [-a|c|p] <filename>
		 -a prints <filename> as ASCII
		 -c prints <filename> formatted as source code
		 -p prints <filename> as Postscript
		  If no switch is given, print attempts to
		  guess the file type and print appropriately.\n
	  ";
	       exit(0);
	  }

	  sub wrap {
	       # Create an array of file lines, where each line is < the
	       # number of characters specified, and wrapped only on whitespace

	       # Get the number of characters to limit the line to.
	       $limit = pop(@_);

	       # DBG
	       #print "Entering subroutine wrap\n";
	       #print "The line length limit is $limit\n";

	       # Read in the file, parse and put into an array.
	       open(FILE, "<$file") || die "Can't open $file: $!\n";
	       while(<FILE>) {
		    $line = $_;

		    # DBG
		    #print "The line is:\n$line\n";

		    # Wrap the line if it is over the limit.
		    while ( length($line) > $limit ) {

			 # DBG
			 #print "Wrapping...";

			 # Get the first $limit +1 characters.
			 $part = substr($line,0,$limit +1);

			 # DBG
			 #print "The partial line is:\n$part\n";

			 # Check to see if the last character is a space.
			 $last_char = substr($part,-1, 1);
			 if ( " " eq $last_char ) {
			     # If it is, print the rest.








SMB HOWTO								     16



			     # DBG
			     #print "The last character was a space\n";

			     substr($line,0,$limit + 1) = "";
			     substr($part,-1,1) = "";
			     push(@newlines,"$part\n");
			 } else {
			      # If it is not, find the last space in the
			      # sub-line and print up to there.

			     # DBG
			     #print "The last character was not a space\n";

			      # Remove the character past $limit
			      substr($part,-1,1) = "";
			      # Reverse the line to make it easy to find
			      # the last space.
			      $revpart = reverse($part);
			      $index = index($revpart," ");
			      if ( $index > 0 ) {
				substr($line,0,$limit-$index) = "";
				push(@newlines,substr($part,0,$limit-$index)
				    . "\n");
			      } else {
				# There was no space in the line, so
				# print it up to $limit.
				substr($line,0,$limit) = "";
				push(@newlines,substr($part,0,$limit)
				    . "\n");
			      }
			 }
		    }
		    push(@newlines,$line);
	       }
	       close(FILE);
	  }

	  sub codeformat {
	       # Call subroutine wrap then filter through nenscript
	       &wrap($line_length);

	       # Pipe the results through nenscript to create a Postscript
	       # file that adheres to some decent format for printing
	       # source code (landscape, Courier font, line numbers).
	       # Print this to a temporary file first.
	       $tmpfile = "/tmp/nenscript$$";
	       open(FILE, "|$nenscript -2G -i$file -N -p$tmpfile -r") ||
		    die "Can't open nenscript: $!\n";
	       foreach $line (@newlines) {
		    print FILE $line;
	       }
	       close(FILE);

	       # Read the temporary file back into an array so it can be








SMB HOWTO								     17



	       # passed to the Samba print script.
	       @newlines = ("");
	       open(FILE, "<$tmpfile") || die "Can't open $file: $!\n";
	       while(<FILE>) {
		    push(@newlines,$_);
	       }
	       close(FILE);
	       system("rm $tmpfile");
	  }

	  sub createarray {
	       # Create the array for postscript
	       open(FILE, "<$file") || die "Can't open $file: $!\n";
	       while(<FILE>) {
		    push(@newlines,$_);
	       }
	       close(FILE);
	  }



10.  v

1996 ~ HOWTO vOݩ David Wood.
iHΥ󫬦AвͥHΦۥѪ,unoɭʤ,]toqԭz.


11.  PE

unAgHڴѷN, ڱN|bo()U@PEA.
































SMB HOWTO								     18





































































				   CONTENTS



1.   .................................................................... 1

2.  i@BT .............................................................. 1

3.  w .................................................................... 2

4.  o daemon ....................................................... 3

5.  @պA]w (/etc/smb.conf) ............................................ 4

6.   Linux Ϻе Windows  .......................................... 5

7.   Windows Ϻе Linux  .......................................... 6

8.   Linux L Windows  ........................................ 8

9.   Windows L Linux  ........................................ 9

10. v ................................................................... 17

11. PE ................................................................... 17































				       i


