From owner-freebsd-bugs@freebsd.org Sat Apr 1 16:08:30 2017 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CA5DD29644 for ; Sat, 1 Apr 2017 16:08:30 +0000 (UTC) (envelope-from lew@perftech.com) Received: from smtp-gw.pt.net (smtp-gw.pt.net [206.210.194.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp-gw.pt.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52C94E2D for ; Sat, 1 Apr 2017 16:08:29 +0000 (UTC) (envelope-from lew@perftech.com) X-ASG-Debug-ID: 1491062055-09411a12f82193130001-rqrMvB Received: from mail.pt.net (mail.pt.net [206.210.194.11]) by smtp-gw.pt.net with ESMTP id oQtEnA2b4PE7qlDp (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sat, 01 Apr 2017 10:54:15 -0500 (CDT) X-Barracuda-Envelope-From: lew@perftech.com X-Barracuda-Effective-Source-IP: mail.pt.net[206.210.194.11] X-Barracuda-Apparent-Source-IP: 206.210.194.11 Received: from localhost (localhost [IPv6:::1]) by mail.pt.net (Postfix) with ESMTP id 9005B8425F7 for ; Sat, 1 Apr 2017 10:54:15 -0500 (CDT) Received: from mail.pt.net ([IPv6:::1]) by localhost (mail.pt.net [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id 7Yvt2UcWgOJq for ; Sat, 1 Apr 2017 10:54:15 -0500 (CDT) Received: from localhost (localhost [IPv6:::1]) by mail.pt.net (Postfix) with ESMTP id 61D748425F8 for ; Sat, 1 Apr 2017 10:54:15 -0500 (CDT) X-Virus-Scanned: amavisd-new at pt.net Received: from mail.pt.net ([IPv6:::1]) by localhost (mail.pt.net [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id DcJr6ElfRoz2 for ; Sat, 1 Apr 2017 10:54:15 -0500 (CDT) Received: from lewhome-dhcp-179.pt.net (lewhome-dhcp-179.pt.net [206.210.207.179]) (Authenticated sender: lew@pt.net) by mail.pt.net (Postfix) with ESMTPSA id 3BA9B8425F7 for ; Sat, 1 Apr 2017 10:54:15 -0500 (CDT) From: Lewis Donzis Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Fix cp not to give chflags error on NFS Message-Id: <8FDBAA2C-93B8-49FA-B3CD-5B709A93A5C4@perftech.com> X-ASG-Orig-Subj: Fix cp not to give chflags error on NFS Date: Sat, 1 Apr 2017 10:54:14 -0500 To: freebsd-bugs@FreeBSD.org X-Mailer: Apple Mail (2.3259) X-Barracuda-Connect: mail.pt.net[206.210.194.11] X-Barracuda-Start-Time: 1491062055 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://smtp-gw.pt.net:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 671 X-Virus-Scanned: by bsmtpd at pt.net X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.37718 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 16:08:30 -0000 It's fairly annoying that cp has no way to suppress the chflags error = when the destination file is on an NFS mount. A bigger problem than the = error message is that it returns exit status 1, which causes things like = make to fail when there really was no error. What do you think about the following change to /usr/src/bin/cp/utils.c: 398c398 < if (fdval ? --- > if ((fdval ? 401c401 < chflags(to.p_path, fs->st_flags))) { --- > chflags(to.p_path, fs->st_flags))) && errno !=3D = ENOTSUP) { which simply ignores the error if the destination filesystem doesn't = support chflags? Thanks, lew