Bug 7960 - TRANSACT2_SETPATHINFO is not handled correctly, RAW-SFILEINFO/disposition_information smbtorture4 test fails with NT_STATUS_INVALID_HANDLE
TRANSACT2_SETPATHINFO is not handled correctly, RAW-SFILEINFO/disposition_inf...
Status: NEW
Product: Samba 3.5
Classification: Unclassified
Component: File services
x64 Linux
: P3 normal
: ---
Assigned To: Volker Lendecke
Samba QA Contact
Depends on:
  Show dependency treegraph
Reported: 2011-02-18 04:10 UTC by Volodymyr Khomenko
Modified: 2011-02-18 04:10 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Volodymyr Khomenko 2011-02-18 04:10:15 UTC
Samba 4 torture test RAW-SFILEINFO/disposition_information test fails when running on Samba 3.5.x:

# ./bin/smbtorture //<samba_IP>/Admin -U Admin%password RAW-SFILEINFO
test disposition_information level
(torture/raw/setfileinfo.c:341) DISPOSITION_INFORMATION - NT_STATUS_INVALID_HANDLE (should be NT_STATUS_OK)

The reason of failure is inside call_trans2setfilepathinfo: when tran_call == TRANSACT2_SETPATHINFO==6 subcommand is handled, only file path is processed (fsp remains to be NULL), but then it calls smbd_do_setfilepathinfo with info_level == SMB_FILE_DISPOSITION_INFORMATION=1013, and afterwards call to smb_set_file_disposition_info expects that fsp is set (returns NT_STATUS_INVALID_HANDLE if fsp is NULL).

I see also comment relevant to this bug from smbd_do_setfilepathinfo:

#if 0
            /* JRA - We used to just ignore this on a path ?
             * Shouldn't this be invalid level on a pathname
             * based call ?
            if (tran_call != TRANSACT2_SETFILEINFO) {
                return ERROR_NT(NT_STATUS_INVALID_LEVEL);
            status = smb_set_file_disposition_info(conn,

It seems like TRANSACT2_SETPATHINFO was not supported by smbd_do_setfilepathinfo, but it was planned to handle this subrequest (so not only TRANSACT2_SETFILEINFO is allowed to enter smb_set_file_disposition_info); still required changes was not made, so smb_set_file_disposition_info fails because it still needs fsp (but we haven't it resolved for SETPATHINFO).

Relevant logs (fnum=-1 is reported because fsp is not set):

[2011/02/18 10:44:16.071223,  3, pid=29799] smbd/process.c:1300(switch_message)
  switch message SMBtrans2 (pid 29799) conn 0xf806daa0
[2011/02/18 10:44:16.073757,  3, pid=29799] smbd/vfs.c:1008(check_reduced_name)
  check_reduced_name: testsfileinfo/fname_test_67.txt reduced to /mnt/cifs_share/testsfileinfo/fname_test_67.txt
[2011/02/18 10:44:16.073771,  3, pid=29799] smbd/trans2.c:7823(call_trans2setfilepathinfo)
  call_trans2setfilepathinfo(6) testsfileinfo/fname_test_67.txt (fnum -1) info_level=1013 totdata=4
[2011/02/18 10:44:16.073783,  3, pid=29799] smbd/trans2.c:7421(smbd_do_setfilepathinfo)
  smbd_do_setfilepathinfo: testsfileinfo/fname_test_67.txt (fnum -1) info_level=1013 totdata=4
[2011/02/18 10:44:16.073797,  3, pid=29799] smbd/error.c:80(error_packet_set)
  error packet at smbd/trans2.c(7860) cmd=50 (SMBtrans2) NT_STATUS_INVALID_HANDLE