[jcifs] problem with jCIFS and samba (security=share)

s-jacobi at web.de s-jacobi at web.de
Thu Sep 30 09:21:01 GMT 2004


hi,

why do i can't login/access a samba-server that is configured with: "security=share"
everything works fine with "security=user" but not all of the target machines
are configured that way.
as i can see from the jcifs-log, that the user "joker" is set to guest!?
guest is not allowed so it fails ...


im using:
 jcifs_1.0.1
 java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition
 java.vm.version=1.4.2_04-b05
 os.arch=x86
 os.name=Windows 2000

i set:
 jcifs.smb.client.logonShare=share1
 jcifs.util.loglevel=3
 jcifs.netbios.baddr=192.168.90.255

i tried it with:
 SmbSession.logon()
 SmbFile.exists()
 SmbFile.canRead()

some samba config-settings:
 [global]
  guest account = noboddy
  map to guest = Bad User
  security = share

 [share1]
  comment = myTemp
  path = /tmp
  valid users = joker
  public = no
  writable = yes
  create mask = 0765


logs:

[jCIFS]
connecting to :smb://192.168.90.90/share1/
requesting negotiation with 0.0.0.0<00>/192.168.90.90
session established ok with 0.0.0.0<00>/192.168.90.90
SmbComNegotiate[command=SMB_COM_NEGOTIATE,
  received=false,
  errorCode=The operation completed successfully.,
  flags=0x0018,
  flags2=0xC003,
  signSeq=0,   tid=0,
  pid=61539,
  uid=0,
  mid=1,
  wordCount=0,
  byteCount=12,
  wordCount=0,
  dialects=NT LM 0.12]
  new data read from socket: 0.0.0.0<00>/192.168.90.90
  byteCount=14 but readBytesWireFormat returned 13
  SmbComNegotiateResponse[command=SMB_COM_NEGOTIATE,
  received=true,
  errorCode=The operation completed successfully.,
  flags=0x0088,
  flags2=0x0001,
  signSeq=0,
  tid=0,
  pid=61539,
  uid=0,
  mid=1,
  wordCount=17,
  byteCount=14,
  wordCount=17,
  dialectIndex=0,
  securityMode=0x2,
  security=share,
  encryptedPasswords=true,
  maxMpxCount=50,
  maxNumberVcs=1,
  maxBufferSize=16644,
  maxRawSize=65536,
  sessionKey=0x000003AB,
  capabilities=0x0000E3F9,
  serverTime=Wed Sep 29 11:33:17 CEST 2004,
  serverTimeZone=65416,
  encryptionKeyLength=8,
  byteCount=14,
  oemDomainName=J0KER]
treeConnect: unc=\\192.168.90.90\SHARE1,service=?????
sessionSetup: accountName=joker,primaryDomain=?
SmbComSessionSetupAndX[command=SMB_COM_SESSION_SETUP_ANDX,
received=false,
  errorCode=The operation completed successfully.,
  flags=0x0018,
  flags2=0x4003,
  signSeq=0,
  tid=0,
  pid=61539,
  uid=0,
  mid=2,
  wordCount=13,
  byteCount=27,
  andxCommand=0x75,
  andxOffset=88,
  snd_buf_size=16644,
  maxMpxCount=10,
  VC_NUMBER=1,
  sessionKey=0,
  passwordLength=0,
  unicodePasswordLength=0,
  capabilities=80,
  accountName=JOKER,
  primaryDomain=?,
  NATIVE_OS=Windows 2000,
  NATIVE_LANMAN=jCIFS]
  SmbComTreeConnectAndX[command=SMB_COM_TREE_CONNECT_ANDX,
  received=false,
  errorCode=The operation completed successfully.,
  flags=0x0018,
  flags2=0x0000,
  signSeq=0,
  tid=0,
  pid=61539,
  uid=0,
  mid=0,
  wordCount=4,
  byteCount=53,
  andxCommand=0xFF,
  andxOffset=0,
  disconnectTid=false,
  passwordLength=24,
  password=,
  path=\\192.168.90.90\SHARE1,
  service=?????]
new data read from socket: 0.0.0.0<00>/192.168.90.90
SmbComSessionSetupAndXResponse[command=SMB_COM_SESSION_SETUP_ANDX,
  received=true,
  errorCode=The operation completed successfully.,
  flags=0x0088,
  flags2=0x0001,
  signSeq=0,
  tid=1,
  pid=61539,
  uid=0,
  mid=2,
  wordCount=3,
  byteCount=24,
  andxCommand=0x75,
  andxOffset=68,
  isLoggedInAsGuest=true,
  nativeOs=Unix,
  nativeLanMan=Samba 2.2.7a,
  primaryDomain=J0KER]
  SmbComTreeConnectAndXResponse[command=SMB_COM_TREE_CONNECT_ANDX,
  received=true,
  errorCode=The operation completed successfully.,
  flags=0x0088,
  flags2=0x0001,
  signSeq=0,
  tid=1,
  pid=61539,
  uid=0,mid=2,
  wordCount=3,
  byteCount=8,
  andxCommand=0xFF,
  andxOffset=0,
  supportSearchBits=true,
  shareIsInDfs=false,
  service=A:,
  nativeFileSystem=NTFS]
Logon failure: unknown user name or bad password.
 
 
[console]
  #smbclient //192.168.90.90/share1 -U joker
  added interface ip=192.168.90.90 bcast=192.168.90.255 nmask=255.255.255.0
  Password:
  Domain=[J0KER] OS=[Unix] Server=[Samba 2.2.7a]
  smb: \> dir
  .  D 0 Thu Nov 13 14:00:57 2003
  .. D 0 Mon Nov 17 18:34:51 2003
  ...

-------------------------
thanks sven
__________________________________________________________
Mit WEB.DE FreePhone mit hoechster Qualitaet ab 0 Ct./Min.
weltweit telefonieren! http://freephone.web.de/?mc=021201



More information about the jcifs mailing list