Bug 7864 - cli_errstr() usage is wrong
Summary: cli_errstr() usage is wrong
Alias: None
Product: Samba 3.6
Classification: Unclassified
Component: Client Tools (show other bugs)
Version: unspecified
Hardware: Other Linux
: P3 normal
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
Depends on:
Blocks: 8399
  Show dependency treegraph
Reported: 2010-12-14 02:32 UTC by Stefan Metzmacher
Modified: 2011-08-25 16:35 UTC (History)
2 users (show)

See Also:

Patch for v3-6-test (16.92 KB, patch)
2011-07-30 08:33 UTC, Stefan Metzmacher
vl: review+

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Metzmacher 2010-12-14 02:32:13 UTC
We have a lot of places where we have code like this:

        if (!NT_STATUS_IS_OK(cli_session_setup(cli, l_username,
                                               l_password, strlen(l_password),
                                               l_password, strlen(l_password),
                                               lp_workgroup()))) {
                d_printf("session setup failed: %s\n", cli_errstr(cli));
                return -1;

This prints:
session setup failed: SUCCESS - 0

Instead of using cli_errstr(cli) we should use the NTSTATUS returned by the function.

At the same time we could use remove the cli_* calls from the if statement...

As a quick hack we might add a change that updates the info that cli_errstr()
Comment 1 Volker Lendecke 2010-12-14 03:55:14 UTC
This is part of the continuous refactoring of the client libs. Feel free to contribute :-)

Comment 2 Björn Jacke 2011-03-04 10:34:38 UTC
Comment 3 Stefan Metzmacher 2011-07-30 08:33:51 UTC
Created attachment 6736 [details]
Patch for v3-6-test

I think this should be included in 3.6.1.
Comment 4 Volker Lendecke 2011-07-31 20:47:51 UTC
Comment on attachment 6736 [details]
Patch for v3-6-test

Yep, 3.6.1 material. Thanks!

Comment 5 Karolin Seeger 2011-08-18 18:49:10 UTC
Pushed to v3-6-test.
Closing out bug report.