bug-fileutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cp -p


From: Noel L Yap
Subject: cp -p
Date: Fri, 3 Nov 2000 10:00:02 -0500

I feel that "cp -p" should not ignore the umask (although I see that this is the
behaviour of Solaris's cp, too) because:
   Even if the user chmod's the file(s) afterwards, there is still a window of
   possibly excessive permissions.
   Users who wish to have the current behaviour can set their umask before the
   cp, then reset it afterwards.

This is the patch to "fix" the problem:
$ diff -c src/cp.c~ src/cp.c
*** src/cp.c~       Sat Sep 19 13:09:23 1998
--- src/cp.c        Fri Nov  3 09:16:21 2000
***************
*** 773,781 ****

    x.backup_type = (make_backups ? get_version (version) : none);

-   if (x.preserve_chmod_bits == 1)
-     x.umask_kill = 0777777;
-
    /* The key difference between -d (--no-dereference) and not is the version
       of `stat' to call.  */

--- 773,778 ----

Noel



This communication is for informational purposes only.  It is not intended as
an offer or solicitation for the purchase or sale of any financial instrument
or as an official confirmation of any transaction. All market prices, data
and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of J.P. Morgan & Co. Incorporated, its
subsidiaries and affiliates.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]