From patchwork Sun Jan 13 10:53:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 1969741 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id C7A55DF280 for ; Sun, 13 Jan 2013 10:53:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754206Ab3AMKxl (ORCPT ); Sun, 13 Jan 2013 05:53:41 -0500 Received: from mail-qa0-f47.google.com ([209.85.216.47]:46472 "EHLO mail-qa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754219Ab3AMKxk (ORCPT ); Sun, 13 Jan 2013 05:53:40 -0500 Received: by mail-qa0-f47.google.com with SMTP id a19so822734qad.20 for ; Sun, 13 Jan 2013 02:53:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=V0QXR7Hpz9qIGxdixyipaxclD+LCc4B5dDvXCdtVNso=; b=mxlZ7kvKM0qsXoyAYhARl3Our4glMOZQrQg2F0cc/kbaJVmkDzBKcVbkdCFoKvhViL XxysAKges1PAsx5ZZSr3Qe2tLzDRHELRxEgCRb+BwIrSSMQlxBHY8M7A0XEjNhgKY7ml 4ZFIgWdwm1Qh6bQPMle8UH8iyJ0I0CMJdkcX10kZJa2mwtAH6mIgtAxWIKRdOhe7YUBb PmtNxDJbT28Pu4+OaqvjQGZGAsLk2uXQ9FAaZbHeyP2PA96gTjWWTAx8s/2vJKaRRzmC 8LkYmrKLQ+oj3NHf+OeyhiZAljnWkPA9FM2QYbs9dyWUphcTwq7hhClzl8M3ZplLHQlM bRQw== X-Received: by 10.229.76.162 with SMTP id c34mr16448137qck.25.1358074419550; Sun, 13 Jan 2013 02:53:39 -0800 (PST) Received: from salusa.poochiereds.net (cpe-107-015-113-143.nc.res.rr.com. [107.15.113.143]) by mx.google.com with ESMTPS id i15sm7606338qah.21.2013.01.13.02.53.37 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 13 Jan 2013 02:53:38 -0800 (PST) From: Jeff Layton To: linux-cifs@vger.kernel.org Cc: grawity@gmail.com Subject: [PATCH] mount.cifs: set parsed_info->got_user when a cred file supplies a username Date: Sun, 13 Jan 2013 05:53:31 -0500 Message-Id: <1358074411-29601-1-git-send-email-jlayton@samba.org> X-Mailer: git-send-email 1.7.11.7 X-Gm-Message-State: ALoCoQkHxisDyQNSOrh3y18x7lQlVknzf6Z6PEXvr3kTORfFr7tVQu+8uHedyB6SxA7UWNFeM+DS Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org commit 85d18a1ed introduced a regression when using a credentials file. It set the username in the parsed mount info properly, but didn't set the "got_user" flag in it. Also, fix an incorrect strlcpy length specifier in open_cred_file. Reported-by: "Mantas M." Signed-off-by: Jeff Layton --- mount.cifs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mount.cifs.c b/mount.cifs.c index c7c3055..40b77e9 100644 --- a/mount.cifs.c +++ b/mount.cifs.c @@ -581,7 +581,8 @@ static int open_cred_file(char *file_name, switch (parse_cred_line(line_buf + i, &temp_val)) { case CRED_USER: strlcpy(parsed_info->username, temp_val, - sizeof(parsed_info->domain)); + sizeof(parsed_info->username)); + parsed_info->got_user = 1; break; case CRED_PASS: i = set_password(parsed_info, temp_val);