Subject: bug#8527: cp/mv in coreutils don't respect the default ACL of parent

From: Linda Walsh <[email-masked]>
Date: Tue, 07 Oct 2014 18:06:45 -0700

Sorry, I didn't forward this to the right list...

The user data / extended attribute forks are where linux store the 
ACL's.  ext4 should
be configurable to do what you want to do, but I haven't personally used 
it -- but
I understand it has similar functionality as xfs.  The process umask is 
a masking
off of privs/permissions one sets on a normal file (ACL's aside).  It 
affects the
permission bits on the file   So if your umask was 077, then you open a 
file for
rwx rwx rwx, it would mask off group and other allowing the permissions 
to be
700 or rwx, --- ---.  (I might have the order backwards, but it's the 
standard
order you see in ls with numeric permissions)...Your umask will affect 
your file
mode creation, but it depends on what flags you use when you use 'cp' -- 
which is one
of the main points of my "detail"... after everything was shown to be 
working correctly
in my case, a setting I have in an "alias" to my "cp" would have 
over-ridden any
other settings and made it look like 'cp' ignored directory ACL or 
(sounds like you might
be talking group-owner ship -- of a dir -- or are you talking both).

Really, I'm not a member of the core utils devel group, so I really 
prefer you send your
answers and questions there, as they'll catch alot more things than I 
would -- I was
just showing an example of how your setting can override everything you 
think you are
setting -- so you'll need to provide more detail about what your umask 
is, (type umask at
prompt to see), and whether or not you have any aliases or ENV vars in 
effect that could
alter things.  If you can give an exact formula along the lines of what 
I did to
demonstrate your problem, that will help the developers the most.  The 
detail I gave
was only to show how things you don't think of may be affecting you and 
to be sure to check for them.  I'm cc'ing the list on my reply, but 
leaving your email off of it, so if you want to ask them if they need 
more information that's fine... otherwise, write down the exact
commands you typed and your environment, to repeat it.. (umask included).

If you want to use my lsacl script.. it's a trivial build on top of the 
chacl
program.  But please post to the list so everyone can be on the same 
page....
----lsacl script ----
 more lsacl
#!/bin/bash
acllen=0
for fn in "$@"; do
  out="$(chacl -l "$fn")"
  qfn=$(printf "%q " "$fn")
  perm="${out#$qfn}"
  thislen=${#perm}
  if ((thislen>acllen)); then acllen=$thislen; fi
  printf "%-${acllen}s %s\n" "$perm" "$fn"
done
=====================================
Very trivial... but allowed  me to look at multiple files at a time...

IF you can give a recipe or script that duplicates the problem you saw, 
that would
be the best way to move this bug along (toward cockpit error or new 
special case found!).
Best of luck either way!