From patchwork Sun Apr 4 02:09:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Lovenberg X-Patchwork-Id: 49346 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.samba.org (fn.samba.org [216.83.154.106]) by ozlabs.org (Postfix) with ESMTP id 4690FB7C8E for ; Sun, 4 Apr 2010 12:09:53 +1000 (EST) Received: from fn.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id 71344AD220; Sat, 3 Apr 2010 20:09:54 -0600 (MDT) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on fn.samba.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.8 tests=AWL, BAYES_00, HTML_MESSAGE, SPF_PASS autolearn=no version=3.2.5 X-Original-To: linux-cifs-client@lists.samba.org Delivered-To: linux-cifs-client@lists.samba.org Received: from mail-iw0-f172.google.com (mail-iw0-f172.google.com [209.85.223.172]) by lists.samba.org (Postfix) with ESMTP id 60880AD215 for ; Sat, 3 Apr 2010 20:09:48 -0600 (MDT) Received: by iwn2 with SMTP id 2so906053iwn.4 for ; Sat, 03 Apr 2010 19:09:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:received:message-id :subject:from:to:content-type; bh=5jnDSpnchxSf0zcxz0Kb+DbwMdDJsqL8fNuxZ/r93ik=; b=bWVHqXrBmc2OgHZxhgMIeF0bgiIWvwKLjjT6fTCjBs0hL0w9rqXou6QF/cxingsaTC vJAsAlCte04RjmmPVwNQh7HR+r5N/EM/xLlDjs6Ocr09idZFLNFnaOk/7TfQuKTGPksc OeiRYDmTClvtyQ1ybuwIbE/LTSWRPZaIV7jrM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=sP6BajdDC5aPrtJppYIJTrwzcZZ0rupbM8I1DPwPc3BIUr8l3qxdOvHAaY5zMZZLP9 Gc6UZVkattLsuWUAft1sLUOjIHx6tiXuMpKcaTRmc359/dWrwfz9n8TxUn4zZ+8sn4DP qKk3F1umvm2lAIEocQViWvF058G1325vB3v6w= MIME-Version: 1.0 Received: by 10.231.36.129 with HTTP; Sat, 3 Apr 2010 19:09:45 -0700 (PDT) Date: Sat, 3 Apr 2010 22:09:45 -0400 Received: by 10.231.146.66 with SMTP id g2mr1793908ibv.88.1270346985645; Sat, 03 Apr 2010 19:09:45 -0700 (PDT) Message-ID: From: Scott Lovenberg To: linux-cifs-client@lists.samba.org Subject: [linux-cifs-client] [Patch] Make credentials file parameters consistent with command line parameters X-BeenThere: linux-cifs-client@lists.samba.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: The Linux CIFS VFS client List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-cifs-client-bounces@lists.samba.org Errors-To: linux-cifs-client-bounces@lists.samba.org This patch makes the mount.cifs credentials file parameters consistent with the command line parameters to remove ambiguity between the command line parameter format and the credentials file format. That is, it parses for both short and long form of the 'username', 'password', and 'domain' parameters. This patch is against the current cifs-utils-4.2. I'm also thinking of adding a second patch that allows for parsing a "domain/user", "domain%user" and "domain/user%password" formats as allowed from the command line. Comments are appreciated. @@ -358,7 +358,7 @@ if (newline) *newline = '\0'; - if (strncasecmp("username", line_buf + i, 8) == 0) { + if (strncasecmp("user", line_buf + i, 4) == 0) { temp_val = strchr(line_buf + i, '='); if (temp_val) { /* go past equals sign */ @@ -380,7 +380,7 @@ strlcpy(parsed_info->username, temp_val, sizeof(parsed_info->username)); } - } else if (strncasecmp("password", line_buf + i, 8) == 0) { + } else if (strncasecmp("pass", line_buf + i, 4) == 0) { temp_val = strchr(line_buf + i, '='); if (!temp_val) continue; @@ -388,7 +388,7 @@ i = set_password(parsed_info, temp_val); if (i) return i; - } else if (strncasecmp("domain", line_buf + i, 6) == 0) { + } else if (strncasecmp("dom", line_buf + i, 3) == 0) { temp_val = strchr(line_buf + i, '='); if (temp_val) { /* go past equals sign */