Discussion:
[jcifs] Domain usage
Jeff Schindler
2016-09-06 15:23:11 UTC
Permalink
Hi,

We are using JCIFS from a Mac to get certain NTFS attributes from a SMB
share (via SmbFile::getAttributes). We can log into the SMB share without
a domain via the Mac OS and all seems to function normally. We can also
make a connection to the SmbFile via JCIFS without the domain, however,
when we call getAttributes on that SmbFile, it always returns 0. If we add
the domain back in, it returns the correct attributes. Does anyone have
any idea why this might be happening?

Thanks,
Jeff
Michael B Allen
2016-09-09 05:29:03 UTC
Permalink
Hi Jeff,

Are you using an account that is also on the local machine (like
Administrator)? If yes, and you leave out the domain, the server might
use the local account instead of the domain account of the same name
in which case you might see a difference in bahavior.

This is a wild guess though. You could test this by a) using an
account that is only in the domain or b) use the local machine name as
the domain (look at netbios name in ipconfig /all on server but it's
almost always the first label of the DNS name). If you no longer see a
difference in behavior then that would suggest the server is using
different accounts that happen to have the same name.

This is why you should ALWAYS supply a domain in your credentials.

If tha'ts not the problem, whats is the server? Is it special in any
way (like a NAS appliance or really old)?

Mike
--
Michael B Allen
Java Active Directory Integration
http://www.ioplex.com/
Post by Jeff Schindler
Hi,
We are using JCIFS from a Mac to get certain NTFS attributes from a SMB
share (via SmbFile::getAttributes). We can log into the SMB share without a
domain via the Mac OS and all seems to function normally. We can also make
a connection to the SmbFile via JCIFS without the domain, however, when we
call getAttributes on that SmbFile, it always returns 0. If we add the
domain back in, it returns the correct attributes. Does anyone have any
idea why this might be happening?
Thanks,
Jeff
Jeff Schindler
2016-09-15 19:00:27 UTC
Permalink
Hi Mike,

Thanks for the response. My responses inline below...
Post by Michael B Allen
Hi Jeff,
Are you using an account that is also on the local machine (like
Administrator)? If yes, and you leave out the domain, the server might
use the local account instead of the domain account of the same name
in which case you might see a difference in bahavior.
No - the account I am testing with is unique to the CIFS server.
Post by Michael B Allen
This is a wild guess though. You could test this by a) using an
account that is only in the domain or b) use the local machine name as
the domain (look at netbios name in ipconfig /all on server but it's
almost always the first label of the DNS name). If you no longer see a
difference in behavior then that would suggest the server is using
different accounts that happen to have the same name.
The account I am using is only in the "test" domain on the server. The
account was setup specifically for me to test with, so I'm fairly certain
its the only account with that name on that server.
Post by Michael B Allen
This is why you should ALWAYS supply a domain in your credentials.
The client's concern (I'm developing an FS for the client) is that since
the Mac users *can* login without a domain, then they *will* and then run
into these issues. I am not sure why SMB is allowing it. I've tried
passing in various "default" domains to JCIFS (".", "$HOSTNAME", "NONE"),
but nothing seems to work but the actual domain name. I should also note
that we are using NTLM authentication, but that doesn't seem to make a
difference - specifying the credentials inline with the URL has the same
effect sans domain name.
Post by Michael B Allen
If tha'ts not the problem, whats is the server? Is it special in any
way (like a NAS appliance or really old)?
The client says "Yes, we are using NAS as the source share and it's SMB
protocol stack could well be old."

Thanks for any other insight you can provide.

Jeff
Post by Michael B Allen
Mike
--
Michael B Allen
Java Active Directory Integration
http://www.ioplex.com/
Post by Jeff Schindler
Hi,
We are using JCIFS from a Mac to get certain NTFS attributes from a SMB
share (via SmbFile::getAttributes). We can log into the SMB share
without a
Post by Jeff Schindler
domain via the Mac OS and all seems to function normally. We can also
make
Post by Jeff Schindler
a connection to the SmbFile via JCIFS without the domain, however, when
we
Post by Jeff Schindler
call getAttributes on that SmbFile, it always returns 0. If we add the
domain back in, it returns the correct attributes. Does anyone have any
idea why this might be happening?
Thanks,
Jeff
Continue reading on narkive:
Loading...