From patchwork Sun Apr 4 02:09:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Make credentials file parameters consistent with command line parameters Date: Sat, 03 Apr 2010 16:09:45 -0000 From: Scott Lovenberg X-Patchwork-Id: 49346 Message-Id: To: linux-cifs-client@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 */