- assigned_to: chassell
Originally created by: nslay
Originally owned by: chassell
Hello Amanda developers,
Thanks for all your hard work on the Amanda backup system. It really works wonder and is relatively straightforward to setup.
Before I point out a possible problem with amsamba, I would like to emphasize that I am not using a typical setup with Amanda and smbclient. For example, I am using Amanda 3.3.3 which seems to be the current Amanda package for Ubuntu 14.04's package manager. Secondly, I am using smbclient 4.3 which is known to be incompatible with Amanda versions less than 3.3.9 (was it?).
However, that doesn't stop me. I've manually merged necessary changes (from studying github diffs) to amsamba to make 3.3.3 work properly with smbclient 4.x.
I have noticed something odd about amsamba's command_estimate() that prepares smbclient commands "archive 0|1;recurse;du". I agree that du should operate on the current working directory (specified by -D), but it doesn't in smbclient 4.3. It operates directly on the share. More specifically, if you have a Windows shared folder //server/share/subdir ... du operates on //server/share and NOT //server/share/subdir even though -D subdir was explicitly passed and your current working directory in smbclient is subdir. I have verified this by manually executing smbclient and trying du.
Furthermore, the man page documenting smbclient shows that "du" is to be passed a filename and does not appear to mention the behavior of the command in the absence of the filename. Smbclient appears to have never documented the use of "du" in the absence of an argument. Thus, I believe that amsamba is relying on undefined behavior in smbclient.
The fix is simple. You can omit the -D option entirely in command_estimate() and instead change the command to run to:
"archive 0|1;recurse;du \"/subdir\""
Even if there is no subdir, "archive 0|1;recurse;du \"/\"" will still be valid.
And all should work correctly afterward.