How do you get linux to honor setuid directories?

Setuid for directories does not behave like setgid. Unless, the shell output was from FreeBSD, some one was bored and having a little fun at your expense.

The setuid permission set on a directory is ignored on UNIX and Linux systems.[4] FreeBSD can be configured to interpret it analogously to setgid, namely, to force all files and sub-directories to be owned by the top directory owner.[5]

In FreeBSD, directories behave as if their setgid bit was always set, regardless of its actual value. As is stated in open(2), "When a new file is created it is given the group of the directory which contains it."

http://en.wikipedia.org/wiki/Setuid#setuid_and_setgid_on_directories


Partial answer / work around:

I was trying to do the same thing, I decided not to fight it and try another method. What I tried was access control lists, to set default permissions. (Note: you may need to enable them first).

setfacl -R --set-file=- . <<EOF
# file: testdir/
# owner: testuser
# group: testgroup
user::rwx
group::rwx
group:normaluser:rwx
mask::rwx
other::r-x
default:group::rwx
default:group:normaluser:rwx
default:mask::rwx
default:other::r-x
EOF

Here testuser is used to run tests, and normal user can delete the results, without resulting to using root (each time).