Search code examples
csamba

Hacking samba - how to get a directory from struct fd_handle


i'm hacking some samba internals, and I want to log, what's written in read_file and write_file, exactly I want to get file name, directory, and how much bytes are written.

in struct files_struct, there is defined file name (char* fsp_name), and I can count number of written bytes, but in files_struct there is no field with directory.

Is there any way, how to determine opened file's directory in samba guts?


Solution

  • OK, so - solution: files_struct contains 'conn' field, which has 'char * origpath' - which contains current file's directory.