FEATURE REQ: safe % expansion via new syntax

Nicolas Williams Nicolas.Williams at wdr.com
Tue Feb 1 19:52:11 GMT 2000


On Wed, Feb 02, 2000 at 06:42:14AM +1100, Luke Kenneth Casson Leighton wrote:
> if anyone's proposing changes to these, please bear in mind that i need to
> have the functions and all uses of those functions work across process
> boundaries (e.g smbd creates it; smbd and netlogond, spoolssd etc read
> it).

Yes.

Particularly I want to make the use of various parameters that end up
calling smbrun() safe.

So far as I know ALL of those parameters are implemented in smbd only
(as they are SMB-specific) and, specifically, 'print command' and the
open/close command parameters call string_sub() directly with values
that are too dynamic to ever store in a TDB.

Hmmmm.

For an immediate solution I guess the best thing to do is to include a
function called, say, safe_quote() that takes a string and a buffer and
copies to the buffer a shell-quoted version of the given string, then
update 'print command' and Andy Bakun's open/close command patch to
safe_quote() the filename passed by the client prior to calling
string_sub().

For the long term the whole % token system will have to be modified as
Luke suggests, though %f will probably never end up in a TDB.

> luke


Nico
-DISCLAIMER: an automatically appended disclaimer may follow. By posting-
-to a public e-mail mailing list I hereby grant permission to distribute-
-and copy this message.-

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.



More information about the samba-technical mailing list