RE RE: 2nd attempt: Modify location of printerdriverfiles

Simo Sorce simo.sorce at xsec.it
Thu Nov 28 11:27:00 GMT 2002


Uhm not sure either if this will work, but you could try to use %S as
substitution

This way you may have a directory for each printer name ...
of course if you rename a printer you may get into troubles, but it is
unlikely that you like changing printer names every day :-)


Here it is a list of macros you may think to try:

       These substitutions are mostly noted in  the  descriptions
       below,  but  there  are  some  general substitutions which
       apply whenever they might be relevant. These are:

       %S     the name of the current service, if any.

       %P     the root directory of the current service, if  any.

       %u     user name of the current service, if any.

       %g     primary group name of %u.

       %U     session  user  name  (the user name that the client
              wanted, not necessarily the same as  the  one  they
              got).

       %G     primary group name of %U.

       %H     the home directory of the user given by %u.

       %v     the Samba version.

       %h     the Internet hostname that Samba is running on.

       %m     the  NetBIOS  name of the client machine (very use-
              ful).

       %L     the NetBIOS name of the server. This allows you  to
              change  your  config based on what the client calls
              you. Your server can have a "dual personality".

              Note that this  paramater  is  not  available  when
              Samba  listens  on  port  445, as clients no longer
              send this information

       %M     the Internet name of the client machine.


       %N     the name of your NIS home directory  server.   This
              is  obtained  from  your NIS auto.map entry. If you
              have not compiled Samba with  the  --with-automount
              option then this value will be the same as %L.

       %p     the  path of the service's home directory, obtained
              from your NIS  auto.map  entry.  The  NIS  auto.map
              entry is split up as "%N:%p".

       %R     the selected protocol level after protocol negotia-
              tion. It can be one  of  CORE,  COREPLUS,  LANMAN1,
              LANMAN2 or NT1.

       %d     The process id of the current server process.

       %a     the  architecture  of the remote machine. Only some
              are recognized, and those may not be 100% reliable.
              It  currently  recognizes Samba, WfWg, Win95, WinNT
              and  Win2k.  Anything  else  will   be   known   as
              "UNKNOWN". If it gets it wrong then sending a level
              3 log to samba at samba.org
               <URL:mailto:samba at samba.org> should allow it to be
              fixed.

       %I     The IP address of the client machine.

       %T     the current date and time.

       %$(envvar)
              The value of the environment variable envar.

       There are some quite creative things that can be done with
       these substitutions and other smb.conf options.





On Thu, 2002-11-28 at 12:16, "Kätzler, Ralf" wrote:
> I think the workaround will not work. I can´t predict which user on which machine will use which printer.
> Our users have in most case max. two networkprinters connected - for our luck long physikal ways prevent the "need" to connect to more printers.
> We have created a small script which erases all printerrelated registry-entries and files on the client.
> A user or admin can run this script and the client is clean for a new printer-installation. This way we work around the naming-problem on the client. (The users *theoretical* know which printers cannot be installed at the same time).
> Of course this works not on the printserver :)).
> 
> If there is no other solution, we have to "fight" another skirmish with HP ... maybe we can convince them to take more care when naming there files..........
> ... on the other hand maybe someone is happy to implement the needed variables to the samba-core?? :)
> The moto would be: Power is nothing without control
> 
> Simo: Thanks for your answer.
> 
> Have a nice day.
> Ralf
> 
> > -----Ursprüngliche Nachricht-----
> > Von: Simo Sorce [mailto:simo.sorce at xsec.it]
> > Gesendet: Donnerstag, 28. November 2002 11:34
> > An: Kätzler, Ralf
> > Cc: samba-technical at lists.samba.org
> > Betreff: Re: 2nd attempt: Modify location of printerdriverfiles
> > 
> > 
> > That would change nearly nothnig, because the printer drivers will be
> > copyed in the same structure on the client and there you will find the
> > same naming problem.
> > 
> > It is a known windows problem (just faces some day ago with 
> > drivers for
> > 2 HP laser printers on a windows 98 :-/)
> > 
> > If the Printer Manufacturer tell you so she is both right an wrong.
> > 
> > Right it is an OS problem, A windows OS problem.
> > 
> > Wrong the manufacter must know this issue and try not to make drivers
> > with overlapping names.
> > 
> > 
> > However you may try just a workaround. If any of your clients will use
> > only one printer, you may try some symlink + macro expansion tricks to
> > use different directories, but it may not work or corrupt badly your
> > printer settings and prnting related tdb file, so at your own risk:
> > 
> > - you may use a macro expansion on the print$ share path and 
> > then make a
> > number of directories that match that macro expansion
> > 
> > eg:
> > path = /usr/share/samba/%G/drivers
> > 
> > and have a pool of printers per group or other parameter.
> > 
> > Simo.
> > 
>  
-- 
Simo Sorce - simo.sorce at xsec.it
Xsec s.r.l.
via Durando 10 Ed. G - 20158 - Milano
tel. +39 02 2399 7130 - fax: +39 02 700 442 399
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20021128/9dd9b20b/attachment.bin


More information about the samba-technical mailing list