If I use smbclient to create a tar file at /dev/null, it skips most of the steps. This behavior is unexpected, and I suggest a change, for which I have included a patch. I'm using samba-3.0.10, on a Debian x86 machine, Debian version 3.0.10-1, which includes patches, but nothing relevant to this problem. If I type something like this: smbclient '\\puffin\c$' -U 'amanda%password' -E -d1 -Tca /dev/null '/Kathy/DATA/2120 WNmod/*' I receive the following message: Output is /dev/null, assuming dry_run source/client/clitar.c: if (tar_type=='c' && (dry_run || strcmp(argv[Optind], "/dev/null")==0)) { if (!dry_run) { DEBUG(0,("Output is /dev/null, assuming dry_run\n")); dry_run = True; } This is unexpected behavior. If a person wants to use a dry run, the "-n" option is available. The OS will decide what to do when /dev/null is encountered; smbclient shouldn't know or care whether its output is thrown away or kept. By performing a dry_run, smbclient is skipping the list of the files in the tar file and the actual transfer of data, something which setting the output device to /dev/null should not do. If the usern wants to throw away the data, that is the user's decision. To quote from the GNU standards document, which is generally a worthy document even when the project is not GNU: Likewise, please don't make the behavior of the program depend on the type of output device it is used with. Device independence is an important principle of the system's design I have included a patch below: --- working directory: /home/kevin/src/samba-3.0.10/ % diff -u source/client/clitar.c.orig source/client/clitar.c --- source/client/clitar.c.orig 2005-02-28 13:14:08.000000000 -0800 +++ source/client/clitar.c 2005-02-28 12:07:02.000000000 -0800 @@ -1791,11 +1791,7 @@ } } else { - if (tar_type=='c' && (dry_run || strcmp(argv[Optind], "/dev/null")==0)) { - if (!dry_run) { - DEBUG(0,("Output is /dev/null, assuming dry_run\n")); - dry_run = True; - } + if (tar_type=='c' && dry_run) { tarhandle=-1; } else if ((tar_type=='x' && (tarhandle = sys_open(argv[Optind], O_RDONLY, 0)) == -1) || (tar_type=='c' && (tarhandle=sys_creat(argv[Optind], 0644)) < 0)) {
Applied, thanks ! Jeremy.
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.