Possible NULL-pointer dereference in lib/util/charset/pull_push.c

Torsten Kurbad samba-technical at tk-webart.de
Tue Aug 27 13:55:11 MDT 2013


Hi Volker,

>For some reason it seems that the credentials passed in have
>a NULL domain. How in your python code do you initialize the
>credentials?

Like so:

--- snip ---

url = 'ldap://pdc.iwm-kmrc.de:389/'
username = 'administrator'
realm = 'ADS.IWM-KMRC.DE'
password = 'test'

lpOptions = dict(
    realm = realm,
    workgroup = 'KMRC',
)

# These are then passed (through a class method) to SamDB (simplified
# excerpt):

from samba.auth import system_session
from samba.credentials import Credentials
from samba.param import LoadParm
from samba.samdb import SamDB

class ActiveDirectory(object):

	def __init__(self)
		self._credentials=Credentials()
		self._lp=LoadParm()
		self._session_info=system_session()

	def connect(self, username, password, realm, url, lpOptions):
		if username is not None and realm is not None:
			self._credentials.set_realm(realm)
			self._credentials.set_username(username)
			self._credentials.set_password(password)

			for (key, value) in lpOptions.items():
				self._lp.set(key,value)

			connection = SamDB(url=url,
	                        session_info=self._session_info,
        			credentials=self._credentials,
                        	lp=self._lp)

--- snap ---

Do I understand you correctly in that I need to pass a 'domain'
parameter in addition to 'workgroup' and 'realm'?

Do you see any possible explanation, why the above code indeed does
work correctly without the domain, iff I provide the correct value for
'password'?

Thanks,
Torsten


More information about the samba-technical mailing list