Bug 1014 - cli_write - fails where cli->max_mux==0
cli_write - fails where cli->max_mux==0
Product: Samba 3.0
Classification: Unclassified
Component: libsmbclient
All All
: P3 major
: none
Assigned To: Samba Bugzilla Account
Depends on:
  Show dependency treegraph
Reported: 2004-01-29 06:55 UTC by Mike Nix
Modified: 2005-08-24 10:22 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Mike Nix 2004-01-29 06:55:07 UTC
In cli_write, the line 

int mpx = MAX(cli->max_mux-1, 1);

fails for cli->max_mux==0 due to max_mux being type size_t (unsigned)
The result is mpx set to -1, and (issued - received < mpx) is always false -
preventing cli_issue_write from ever being called.

To fix:
int mpx = (cli->max_mux > 2) ? cli->max_mux-1 : 1;

I discovered this trying to get samba to work with my Intel print station, which
requires the use of splopen/splclose as opposed to open/close, but doesn't seem
to require splwrite.  I'll submit a full patch for that shortly.
Comment 1 alexej davidov 2004-10-01 08:25:03 UTC
See bug 1590!
Comment 2 Gerald (Jerry) Carter 2005-02-07 10:16:10 UTC
fixes in 3.0.11
Comment 3 Gerald (Jerry) Carter 2005-08-24 10:22:05 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.