Comment 30 for bug 2007055

Revision history for this message
Nicholas Neumann (aggienick02) wrote :

So just to make sure I was clear, "fixing" the client to send cleaner messages does avoid the problem. But (imho) the real issue is on the server, since other servers can deal with the less clean messages just fine, and there's nothing wrong (again, imho) with the less clean messages.

Is that uname -r, etc, on your client machine?

A script to test all of this is a good idea. I started with what you put and tried to simplify it a bit. This is where I ended up:

#!/bin/bash

source_path=/tmp/mod_time_test_file
target_path=/media/rn214/user/Temp/mod_time_test_file

rm "$source_path"
rm "$target_path"
echo abcd > "$source_path"

#Set date to January 1 2020 at 12:34.56 PM
touch -t "202001011234.56" "$source_path"

cp -p "$source_path" "$target_path"

echo "Copy complete; sleeping 10 seconds before stat"
#We sleep, as smbd actually does work after the cp -p returns.
#An immediate stat may return the current time for the modified timestamp
#even though it will be corrected shortly
sleep 10

source_time=$(stat -c "%y" "$source_path")
target_time=$(stat -c "%y" "$target_path")

echo "Source modtime: $source_time"
echo "Target modtime: $target_time"

if [ "$source_time" = "$target_time" ]; then echo "PASS: Modtime preserved"; else echo "FAIL: Modtime not preserved"; fi