Bug 3567 - cli_nt_session_open removed, but not all references to it
cli_nt_session_open removed, but not all references to it
Status: RESOLVED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: python
3.0.21c
All Linux
: P3 normal
: none
Assigned To: Deryck Hodge
Samba QA Contact
http://viewcvs.samba.org/cgi-bin/view...
:
: 3466 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-03-01 07:31 UTC by Daniel Jarboe
Modified: 2006-05-01 17:55 UTC (History)
1 user (show)

See Also:


Attachments
Is this right? (9.05 KB, patch)
2006-03-01 10:22 UTC, Daniel Jarboe
no flags Details
This time with additional rpc client pipe python fixes (30.60 KB, patch)
2006-03-03 15:35 UTC, Daniel Jarboe
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Jarboe 2006-03-01 07:31:53 UTC
revision 10119 removed cli_nt_session_open (trunk/source/rpc_client/cli_pipe.c).

The one I bumped into was python/py_common.c.

$ python
Python 2.3.3 (#1, Feb  5 2005, 19:13:46)
[GCC 3.3.3 (SuSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from samba import winbind
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: /usr/lib/python2.3/lib-dynload/samba/winbind.so: undefined symbol: cli_nt_session_open



$ grep -R cli_nt_session_open samba-3.0.21c/source/
samba-3.0.21c/source/libsmb/libsmbclient.c:   DEBUG(1, ("cli_nt_session_open fail!\n"));
samba-3.0.21c/source/python/py_common.c: if (!cli_nt_session_open(cli, pipe_idx)) {
samba-3.0.21c/source/rpc_client/cli_lsarpc.c:    if (!cli_nt_session_open(&cli, PI_LSARPC)) {
samba-3.0.21c/source/rpcclient/cmd_reg.c:        res = res ? cli_nt_session_open(smb_cli, PI_WINREG) : False;
samba-3.0.21c/source/rpcclient/cmd_reg.c:        res = res ? cli_nt_session_open(smb_cli, PI_WINREG) : False;
samba-3.0.21c/source/rpcclient/cmd_reg.c:        res = res ? cli_nt_session_open(smb_cli, PI_WINREG) : False;
samba-3.0.21c/source/rpcclient/cmd_reg.c:        res = res ? cli_nt_session_open(smb_cli, PI_WINREG) : False;
samba-3.0.21c/source/rpcclient/cmd_reg.c:        res = res ? cli_nt_session_open(smb_cli, PI_WINREG) : False;
samba-3.0.21c/source/rpcclient/cmd_reg.c:        res = res ? cli_nt_session_open(smb_cli, PI_WINREG) : False;
samba-3.0.21c/source/rpcclient/cmd_reg.c:        res = res ? cli_nt_session_open(smb_cli, PI_WINREG) : False;
samba-3.0.21c/source/rpcclient/cmd_reg.c:        res = res ? cli_nt_session_open(smb_cli, PI_WINREG) : False;
samba-3.0.21c/source/rpcclient/cmd_wkssvc.c:     res = res ? cli_nt_session_open(smb_cli, PI_WKSSVC) : False;


Thanks,
~ Daniel
Comment 1 Daniel Jarboe 2006-03-01 10:22:37 UTC
Created attachment 1765 [details]
Is this right?

This at least fixes the undefined symbol error, but did I do the new cli_rpc_ and rpccli_ stuff correctly?

Thanks,
~ Daniel
Comment 2 Daniel Jarboe 2006-03-03 15:35:31 UTC
Created attachment 1773 [details]
This time with additional rpc client pipe python fixes

Missed tpot's change revision 10799 for python stuff to build again.  This patch should hopefully fix things between changesets 10799 and 10119 (obsoletes previous patch I attached).

Also fixed a problem in spoolss_hnd_enumprinterdataex.  Looks like its REGVAL_CTR must be TALLOC'ed (regval_ctr_addvalue treats ctr as a ctx).

At any rate, after this patch is applied to 3.0.21c, this kind of stuff is working again:

[daniel@localhost source]$ python
Python 2.3.4 (#1, Feb  2 2005, 12:11:53)
[GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from samba import printerdata
>>> pdex=printerdata.printerdata_ex('\\\\print-serv3\\tc6-w-tech',{'domain':'*mydomain*','username':'*myuser*','password':'*mypass*'})
>>> pdex.keys()
['PrinterDriverData', 'DsSpooler', 'DsDriver', 'DsUser']
>>> pdex['PrinterDriverData'].keys()
['PrinterDataSize', 'FeatureKeyword', 'LpdPrinterDontDetect', 'Forms?', 'TrayFormTable', 'InitDriverVersion', 'LpdPrinterPassThrough', 'FreeMem', 'PrinterData', 'Model', 'FeatureKeywordSize']
>>> pdex['PrinterDriverData']['Model']
'I\x00B\x00M\x00 \x00N\x00e\x00t\x00w\x00o\x00r\x00k\x00 \x00P\x00r\x00i\x00n\x00t\x00e\x00r\x00 \x002\x004\x00 \x00(\x00P\x00C\x00L\x00)\x00\x00\x00'
>>> print pdex['PrinterDriverData']['Model']
IBM Network Printer 24 (PCL)


Thanks!
Comment 3 Deryck Hodge 2006-04-27 14:00:00 UTC
*** Bug 3466 has been marked as a duplicate of this bug. ***
Comment 4 Deryck Hodge 2006-04-27 15:54:22 UTC
Parts of the attached patch were applied.
I didn't apply all the cli_state replacements.
Just allow open_pipe_creds to return cli_state.

Modules now import and work fine for me.
Comment 5 Daniel Jarboe 2006-04-28 09:24:44 UTC
Except I believe werror should have some value assigned before using in PyErr_SetObject, just in case the TALLOC_ZERO_P(hnd->mem_ctx, REGVAL_CTR) were to fail.  Probably NT_STATUS_NO_MEMORY (this problem existed in the patch I had attached).

~ Daniel

Comment 6 Gerald (Jerry) Carter 2006-05-01 06:52:05 UTC
open_pipe_creds can continue to return the cli_state*, but 
the rpccli_XXX() functions need to be passed cli->pipe_list
and not simply the cli*.
Comment 7 Deryck Hodge 2006-05-01 17:55:46 UTC
Fixed in trunk and SAMBA_3_0 branches.
See r 15385 and 15386.