Bug 15165 - Print shares are unable to identify the client IP (samba 4.16 and later).
Summary: Print shares are unable to identify the client IP (samba 4.16 and later).
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Printing (show other bugs)
Version: 4.16.5
Hardware: x64 Linux
: P5 major (vote)
Target Milestone: ---
Assignee: printing-maintainers
QA Contact: Samba QA Contact
Depends on:
Reported: 2022-09-09 17:49 UTC by Paul FM
Modified: 2022-09-09 17:53 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Paul FM 2022-09-09 17:49:59 UTC
This was not a problem in 4.15; but is a problem in both 4.16 and 4.17.

I use lpr printing:
print command = /links/samba/etc/bin.smbd/lpr-print.sh '%M' '%I' '%m' '%U' '%T' '%c' '%p' '%J' '%s'
The Client IP passed to the script (%I) is always
This also seems to affect the enforcement of the "hosts allow" parameter (but only for printer shares, other shares work correctly).

Another note: a preexec script:
preexec = /links/samba/etc/bin.smbd/preexec.sh '%P' '%S' '%a' '%M' '%I' '%m' '%U' '%T'
does get the ip address (%I) of the client connecting to a printer share
(I use this mostly for access debugging, and for more precise access controls on some shares).

I finally figured out what the problem was when trying to get 4.16.5 working (although it seems to also be a problem with 4.17.0rc5).

I am surprised that I couldn't find another bug report of this problem (I was hoping to just add on to it).

Comment 1 Jeremy Allison 2022-09-09 17:53:19 UTC
Spoolss is now a separate process. I'm guessing we need to fix up the substitution parameter. Just a quick guess.