Bug 13745 - print command %J substitution
print command %J substitution
Status: NEW
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Printing
All All
: P5 regression
: ---
Assigned To: printing-maintainers
Samba QA Contact
Depends on:
  Show dependency treegraph
Reported: 2019-01-15 11:22 UTC by Heinrich Mislik
Modified: 2019-01-16 00:57 UTC (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Heinrich Mislik 2019-01-15 11:22:46 UTC
Samba 4.8 introduced new replacement %J, %j for pathsafe IP address. Unfortunatly this conflicts with with %J in "print command". All submitted print jobs get the client IP address as jobname. This happens because %J is implemented in talloc_sub_basic, which is called before the substitutions of "print command".

Another clash is %p. This works, because it is implemented in talloc_sub_advanced, which is called after the substitutions of "print command". Other commands (lppause, lpresume use %j) may also be affected.


Comment 1 David Disseldorp 2019-01-15 13:52:14 UTC
Arg, this looks like a nasty regression from ca66efc24181ba6a7a4c13397af514b0972b4855 .
Any thoughts on how we can resolve this?
IMO we should probably add a special case handler for "print command", lppause and lpresume to ensure that printing specific replacements are handled there before the generic talloc_sub_basic() case.
Comment 2 Jeremy Allison 2019-01-16 00:57:53 UTC
Can you get me a debug level 10 log showing when the string in 'print command' is getting clobbered by the new call to talloc_sub_basic() ?

I'm hoping we can differentiate by share type, or some other way of deciding this is a print share/string so we can protect the print substitutions.