Bill Smith
2003-Apr-10 21:59 UTC
[Samba] Bug in Samba v2.2.8a with Windows API GetFileAttributes ?
Before my company was bought out by another company, we were using Samba v1.9.3 and I'm pretty certain that the GetFileAttributes was working properly but I can't be absolutely sure. Since the move, we're using v2.2.5 and just recently upgraded to v2.2.8a on Solaris 2.7. I'm doing my testing on an XP machine. I'm seeing that GetFileAttributes is always returning 0 instead of a hex value for any valid file pathname accessed via the samba server. If I access the same file locally or via another NT server, I get valid results: Accessign a file locally: D:\temp>test d:\temp\wyb.zip SUCCESS: pathname [d:\temp\wyb.zip] is a file! rc=2820 Accessing a file on an NT server: D:\temp>test \\absolut\home\b\bsmith\xmas01.xls SUCCESS: pathname [\\absolut\home\b\bsmith\xmas01.xls] is a file! rc=20 Accessing a file via a solaris samba server D:\temp>test \\crystal\h\crystal\16\du-crystal16 FAILURE: pathname [\\crystal\h\crystal\16\du-crystal16] is not a file! rc=0 D:\temp>ls -al \\crystal\h\crystal\16\du-crystal16 -rwxrwxrwx 1 CRYSTAL\root CRYSTAL\other 991546 Apr 10 02:34 \\crystal\h\ crystal\16\du-crystal16 Here the test program that I used with VC++ 6.0: #include <windows.h> #include <iostream.h> int main (int argc, char** argv) { if (argc != 2) { cout << "Usage: test <pathname>" << endl; return 1; } const char* pn = argv[1]; DWORD rc = GetFileAttributes(pn); if (0xFFFFFFFF != rc && (rc & (FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_READONLY)) && !(rc & (FILE_ATTRIBUTE_DIRECTORY))) { cout << " SUCCESS: pathname [" << pn << "] is a file! rc=" << hex << rc << endl; return 0; } else { cout << " FAILURE: pathname [" << pn << "] is not a file! rc=" << hex << rc << endl; return 1; } } Thanks in advance for any advice or suggestions. --Bill Smith