From patchwork Tue Feb 19 01:43:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kenneth Dsouza X-Patchwork-Id: 10819123 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AD4296CB for ; Tue, 19 Feb 2019 01:43:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A7C72B8D9 for ; Tue, 19 Feb 2019 01:43:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8B2922B8E6; Tue, 19 Feb 2019 01:43:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39C6D2B8D9 for ; Tue, 19 Feb 2019 01:43:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732836AbfBSBnp (ORCPT ); Mon, 18 Feb 2019 20:43:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44548 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732665AbfBSBnp (ORCPT ); Mon, 18 Feb 2019 20:43:45 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A7B7E11B793; Tue, 19 Feb 2019 01:43:45 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.76.1.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 50DAC5D717; Tue, 19 Feb 2019 01:43:44 +0000 (UTC) From: Kenneth D'souza To: linux-cifs@vger.kernel.org Cc: piastryyy@gmail.com, smfrench@gmail.com Subject: [PATCH] getcifsacl: Do not go to parse_sec_desc if getxattr fails. Date: Tue, 19 Feb 2019 07:13:43 +0530 Message-Id: <20190219014343.29526-1-kdsouza@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 19 Feb 2019 01:43:45 +0000 (UTC) Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add more to the error message by printing the filename and error. Signed-off-by: Kenneth D'souza Reviewed-by: Steve French --- getcifsacl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/getcifsacl.c b/getcifsacl.c index f08cdea..7f6e673 100644 --- a/getcifsacl.c +++ b/getcifsacl.c @@ -399,7 +399,12 @@ cifsacl: bufsize += BUFSIZE; goto cifsacl; } else - printf("getxattr error: %d\n", errno); + { + fprintf(stderr, "getxattr failed on %s: %s\n", filename, strerror(errno) ); + free(attrval); + ret = -1; + goto out; + } } parse_sec_desc((struct cifs_ntsd *)attrval, attrlen, raw);