Hello community,
here is the log from the commit of package cifs-utils for openSUSE:Factory
checked in at Tue May 25 13:17:31 CEST 2010.
--------
--- cifs-utils/cifs-utils.changes 2010-05-04 12:45:48.000000000 +0200
+++ /mounts/work_src_done/STABLE/cifs-utils/cifs-utils.changes 2010-05-24 06:35:55.000000000 +0200
@@ -1,0 +2,15 @@
+Mon May 24 04:19:38 UTC 2010 - sjayaraman@suse.de
+
+- Update to cifs-utils 4.5.
+ + strip leading delimiter off of prefixpath option in mount.cifs.
+ + remove magic number for max_username in parse_options.
+ + turn into a multicall binary for smb2.
+ + fix uninitialized variable in cred parsing error path.
+ + cleanup mount.cifs option parsing.
+
+-------------------------------------------------------------------
+Wed May 5 13:22:57 UTC 2010 - lmuelle@suse.de
+
+- BuildRequire libkeyutils-devel on Mandriva systems.
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
cifs-utils-4.4.tar.bz2
New:
----
cifs-utils-4.5.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ cifs-utils.spec ++++++
--- /var/tmp/diff_new_pack.9DM9Yb/_old 2010-05-25 13:13:29.000000000 +0200
+++ /var/tmp/diff_new_pack.9DM9Yb/_new 2010-05-25 13:13:29.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package cifs-utils (Version 4.4)
+# spec file for package cifs-utils (Version 4.5)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,7 +19,7 @@
Summary: Utilities for doing and managing mounts of the Linux CIFS filesystem
Name: cifs-utils
-Version: 4.4
+Version: 4.5
Release: 1
License: GPLv3+
Group: System/Filesystems
@@ -41,6 +41,9 @@
%if 0%{?suse_version} > 1110
BuildRequires: fdupes
%endif
+%if 0%{?mandriva_version}
+BuildRequires: libkeyutils-devel
+%endif
Requires: keyutils
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++ cifs-utils-4.4.tar.bz2 -> cifs-utils-4.5.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cifs-utils-4.4/autom4te.cache/output.0 new/cifs-utils-4.5/autom4te.cache/output.0
--- old/cifs-utils-4.4/autom4te.cache/output.0 2010-04-28 13:24:59.000000000 +0200
+++ new/cifs-utils-4.5/autom4te.cache/output.0 2010-05-21 22:06:12.000000000 +0200
@@ -1,6 +1,6 @@
@%:@! /bin/sh
@%:@ Guess values for system-dependent variables and create Makefiles.
-@%:@ Generated by GNU Autoconf 2.63 for cifs-utils 4.3.1.
+@%:@ Generated by GNU Autoconf 2.63 for cifs-utils 4.5.
@%:@
@%:@ Report bugs to .
@%:@
@@ -596,8 +596,8 @@
# Identity of this package.
PACKAGE_NAME='cifs-utils'
PACKAGE_TARNAME='cifs-utils'
-PACKAGE_VERSION='4.3.1'
-PACKAGE_STRING='cifs-utils 4.3.1'
+PACKAGE_VERSION='4.5'
+PACKAGE_STRING='cifs-utils 4.5'
PACKAGE_BUGREPORT='cifs-utils@samba.org'
ac_unique_file="replace.h"
@@ -1294,7 +1294,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures cifs-utils 4.3.1 to adapt to many kinds of systems.
+\`configure' configures cifs-utils 4.5 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1360,7 +1360,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of cifs-utils 4.3.1:";;
+ short | recursive ) echo "Configuration of cifs-utils 4.5:";;
esac
cat <<\_ACEOF
@@ -1454,7 +1454,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-cifs-utils configure 4.3.1
+cifs-utils configure 4.5
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1468,7 +1468,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by cifs-utils $as_me 4.3.1, which was
+It was created by cifs-utils $as_me 4.5, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@@ -2324,7 +2324,7 @@
# Define the identity of the package.
PACKAGE='cifs-utils'
- VERSION='4.3.1'
+ VERSION='4.5'
cat >>confdefs.h <<_ACEOF
@@ -8334,7 +8334,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by cifs-utils $as_me 4.3.1, which was
+This file was extended by cifs-utils $as_me 4.5, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -8397,7 +8397,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-cifs-utils config.status 4.3.1
+cifs-utils config.status 4.5
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cifs-utils-4.4/autom4te.cache/output.1 new/cifs-utils-4.5/autom4te.cache/output.1
--- old/cifs-utils-4.4/autom4te.cache/output.1 2010-04-28 13:25:02.000000000 +0200
+++ new/cifs-utils-4.5/autom4te.cache/output.1 2010-05-21 22:06:15.000000000 +0200
@@ -1,6 +1,6 @@
@%:@! /bin/sh
@%:@ Guess values for system-dependent variables and create Makefiles.
-@%:@ Generated by GNU Autoconf 2.63 for cifs-utils 4.3.1.
+@%:@ Generated by GNU Autoconf 2.63 for cifs-utils 4.5.
@%:@
@%:@ Report bugs to .
@%:@
@@ -596,8 +596,8 @@
# Identity of this package.
PACKAGE_NAME='cifs-utils'
PACKAGE_TARNAME='cifs-utils'
-PACKAGE_VERSION='4.3.1'
-PACKAGE_STRING='cifs-utils 4.3.1'
+PACKAGE_VERSION='4.5'
+PACKAGE_STRING='cifs-utils 4.5'
PACKAGE_BUGREPORT='cifs-utils@samba.org'
ac_unique_file="replace.h"
@@ -1294,7 +1294,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures cifs-utils 4.3.1 to adapt to many kinds of systems.
+\`configure' configures cifs-utils 4.5 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1360,7 +1360,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of cifs-utils 4.3.1:";;
+ short | recursive ) echo "Configuration of cifs-utils 4.5:";;
esac
cat <<\_ACEOF
@@ -1454,7 +1454,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-cifs-utils configure 4.3.1
+cifs-utils configure 4.5
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1468,7 +1468,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by cifs-utils $as_me 4.3.1, which was
+It was created by cifs-utils $as_me 4.5, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@@ -2324,7 +2324,7 @@
# Define the identity of the package.
PACKAGE='cifs-utils'
- VERSION='4.3.1'
+ VERSION='4.5'
cat >>confdefs.h <<_ACEOF
@@ -8334,7 +8334,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by cifs-utils $as_me 4.3.1, which was
+This file was extended by cifs-utils $as_me 4.5, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -8397,7 +8397,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-cifs-utils config.status 4.3.1
+cifs-utils config.status 4.5
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cifs-utils-4.4/autom4te.cache/traces.1 new/cifs-utils-4.5/autom4te.cache/traces.1
--- old/cifs-utils-4.4/autom4te.cache/traces.1 2010-04-28 13:25:02.000000000 +0200
+++ new/cifs-utils-4.5/autom4te.cache/traces.1 2010-05-21 22:06:15.000000000 +0200
@@ -1,5 +1,5 @@
m4trace:aclocal.m4:993: -1- m4_include([aclocal/libcap.m4])
-m4trace:configure.ac:4: -1- AC_INIT([cifs-utils], [4.3.1], [cifs-utils@samba.org], [cifs-utils], [http://linux-cifs.samba.org/cifs-utils/])
+m4trace:configure.ac:4: -1- AC_INIT([cifs-utils], [4.5], [cifs-utils@samba.org], [cifs-utils], [http://linux-cifs.samba.org/cifs-utils/])
m4trace:configure.ac:4: -1- m4_pattern_forbid([^_?A[CHUM]_])
m4trace:configure.ac:4: -1- m4_pattern_forbid([_AC_])
m4trace:configure.ac:4: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cifs-utils-4.4/configure new/cifs-utils-4.5/configure
--- old/cifs-utils-4.4/configure 2010-04-28 13:25:01.000000000 +0200
+++ new/cifs-utils-4.5/configure 2010-05-21 22:06:14.000000000 +0200
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for cifs-utils 4.3.1.
+# Generated by GNU Autoconf 2.63 for cifs-utils 4.5.
#
# Report bugs to .
#
@@ -596,8 +596,8 @@
# Identity of this package.
PACKAGE_NAME='cifs-utils'
PACKAGE_TARNAME='cifs-utils'
-PACKAGE_VERSION='4.3.1'
-PACKAGE_STRING='cifs-utils 4.3.1'
+PACKAGE_VERSION='4.5'
+PACKAGE_STRING='cifs-utils 4.5'
PACKAGE_BUGREPORT='cifs-utils@samba.org'
ac_unique_file="replace.h"
@@ -1294,7 +1294,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures cifs-utils 4.3.1 to adapt to many kinds of systems.
+\`configure' configures cifs-utils 4.5 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1360,7 +1360,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of cifs-utils 4.3.1:";;
+ short | recursive ) echo "Configuration of cifs-utils 4.5:";;
esac
cat <<\_ACEOF
@@ -1454,7 +1454,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-cifs-utils configure 4.3.1
+cifs-utils configure 4.5
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1468,7 +1468,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by cifs-utils $as_me 4.3.1, which was
+It was created by cifs-utils $as_me 4.5, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@@ -2324,7 +2324,7 @@
# Define the identity of the package.
PACKAGE='cifs-utils'
- VERSION='4.3.1'
+ VERSION='4.5'
cat >>confdefs.h <<_ACEOF
@@ -8334,7 +8334,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by cifs-utils $as_me 4.3.1, which was
+This file was extended by cifs-utils $as_me 4.5, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -8397,7 +8397,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-cifs-utils config.status 4.3.1
+cifs-utils config.status 4.5
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cifs-utils-4.4/configure.ac new/cifs-utils-4.5/configure.ac
--- old/cifs-utils-4.4/configure.ac 2010-04-28 13:13:17.000000000 +0200
+++ new/cifs-utils-4.5/configure.ac 2010-05-21 22:04:14.000000000 +0200
@@ -1,7 +1,7 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
-AC_INIT([cifs-utils], [4.3.1], [cifs-utils@samba.org], [cifs-utils], [http://linux-cifs.samba.org/cifs-utils/])
+AC_INIT([cifs-utils], [4.5], [cifs-utils@samba.org], [cifs-utils], [http://linux-cifs.samba.org/cifs-utils/])
AC_CONFIG_SRCDIR([replace.h])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cifs-utils-4.4/mount.cifs.c new/cifs-utils-4.5/mount.cifs.c
--- old/cifs-utils-4.4/mount.cifs.c 2010-04-28 13:13:17.000000000 +0200
+++ new/cifs-utils-4.5/mount.cifs.c 2010-05-21 22:04:14.000000000 +0200
@@ -1,6 +1,6 @@
/*
* Mount helper utility for Linux CIFS VFS (virtual filesystem) client
- * Copyright (C) 2003,2008 Steve French (sfrench@us.ibm.com)
+ * Copyright (C) 2003,2010 Steve French (sfrench@us.ibm.com)
* Copyright (C) 2008 Jeremy Allison (jra@samba.org)
* Copyright (C) 2010 Jeff Layton (jlayton@samba.org)
*
@@ -125,9 +125,41 @@
* Values for parsing a credentials file.
*/
#define CRED_UNPARSEABLE 0
-#define CRED_USER 1
-#define CRED_PASS 2
-#define CRED_DOM 4
+#define CRED_USER 1
+#define CRED_PASS 2
+#define CRED_DOM 4
+
+/*
+ * Values for parsing command line options.
+ */
+#define OPT_ERROR -1
+#define OPT_USERS 1
+#define OPT_USER 2
+#define OPT_USER_XATTR 3
+#define OPT_PASS 4
+#define OPT_SEC 5
+#define OPT_IP 6
+#define OPT_UNC 7
+#define OPT_CRED 8
+#define OPT_UID 9
+#define OPT_GID 10
+#define OPT_FMASK 11
+#define OPT_FILE_MODE 12
+#define OPT_DMASK 13
+#define OPT_DIR_MODE 14
+#define OPT_DOM 15
+#define OPT_NO_SUID 16
+#define OPT_SUID 17
+#define OPT_NO_DEV 18
+#define OPT_DEV 19
+#define OPT_NO_LOCK 20
+#define OPT_NO_EXEC 21
+#define OPT_EXEC 22
+#define OPT_GUEST 23
+#define OPT_RO 24
+#define OPT_RW 25
+#define OPT_REMOUNT 26
+
/* struct for holding parsed mount info for use by privleged process */
struct parsed_mount_info {
@@ -149,6 +181,7 @@
const char *thisprogram;
const char *cifs_fstype = "cifs";
+const char *smb2_fstype = "smb2";
static int parse_unc(const char *unc_name, struct parsed_mount_info *parsed_info);
@@ -257,6 +290,52 @@
return 0;
}
+static int mount_smb2_usage(FILE *stream)
+{
+ fprintf(stream, "\nUsage: %s <remotetarget> <dir> -o <options>\n",
+ thisprogram);
+ fprintf(stream, "\nMount the remote target, specified as a UNC name,");
+ fprintf(stream, " to a local directory.\n\nOptions:\n");
+ fprintf(stream, "\tuser=<arg>\n\tpass=<arg>\n\tdom=<arg>\n");
+ fprintf(stream, "\nLess commonly used options:");
+ fprintf(stream,
+ "\n\tcredentials=<filename>,guest,perm,noperm,rw,ro,");
+ fprintf(stream,
+ "\n\tsep=<char>,iocharset=<codepage>,exec,noexec");
+ fprintf(stream,
+ "\n\tnolock,directio,sec=<authentication mechanism>,sign");
+ fprintf(stream,
+ "\n\tuid=<uid>,gid=<gid>,dir_mode=<mode>,file_mode=<mode>");
+ fprintf(stream, "\n\nRarely used options:");
+ fprintf(stream,
+ "\n\tport=<tcpport>,rsize=<size>,wsize=<size>,unc=,ip=,");
+ fprintf(stream,
+ "\n\tdev,nodev,hard,soft,intr,");
+ fprintf(stream,
+ "\n\tnointr,ignorecase,noacl,prefixpath=<path>,nobrl");
+ fprintf(stream,
+ "\n\nOptions are described in more detail in the manual page");
+ fprintf(stream, "\n\tman 8 mount.smb2\n");
+ fprintf(stream, "\nTo display the version number of the mount helper:");
+ fprintf(stream, "\n\tmount.smb2 -V\n");
+
+ if (stream == stderr)
+ return EX_USAGE;
+ return 0;
+}
+
+static int mount_usage(FILE *stream)
+{
+ int rc;
+
+ if (strcmp(thisprogram, "mount.smb2") == 0)
+ rc = mount_smb2_usage(stream);
+ else
+ rc = mount_cifs_usage(stream);
+
+ return rc;
+}
+
/*
* CIFS has to "escape" commas in the password field so that they don't
* end up getting confused for option delimiters. Copy password into pw
@@ -559,7 +638,7 @@
struct parsed_mount_info *parsed_info)
{
char *line_buf;
- char *temp_val;
+ char *temp_val = NULL;
FILE *fs = NULL;
int i;
const int line_buf_size = 4096;
@@ -622,9 +701,9 @@
break;
case CRED_UNPARSEABLE:
if (parsed_info->verboseflag)
- fprintf(stderr,
- "Credential formatted incorrectly: %s",
- temp_val);
+ fprintf(stderr, "Credential formatted "
+ "incorrectly: %s\n",
+ temp_val ? temp_val : "(null)");
break;
}
}
@@ -695,17 +774,83 @@
return rc;
}
+/*
+ * Returns OPT_ERROR on unparsable token.
+ */
+static int parse_opt_token(const char *token)
+{
+ if (token == NULL)
+ return OPT_ERROR;
+
+ if (strncmp(token, "users", 5) == 0)
+ return OPT_USERS;
+ if (strncmp(token, "user_xattr", 10) == 0)
+ return OPT_USER_XATTR;
+ if (strncmp(token, "user", 4) == 0)
+ return OPT_USER;
+ if (strncmp(token, "pass", 4) == 0)
+ return OPT_PASS;
+ if (strncmp(token, "sec", 3) == 0)
+ return OPT_SEC;
+ if (strncmp(token, "ip", 2) == 0)
+ return OPT_IP;
+ if (strncmp(token, "unc", 3) == 0 ||
+ strncmp(token, "target", 6) == 0 ||
+ strncmp(token, "path", 4) == 0)
+ return OPT_UNC;
+ if (strncmp(token, "dom", 3) == 0 || strncmp(token, "workg", 5) == 0)
+ return OPT_DOM;
+ if (strncmp(token, "uid", 3) == 0)
+ return OPT_UID;
+ if (strncmp(token, "gid", 3) == 0)
+ return OPT_GID;
+ if (strncmp(token, "fmask", 5) == 0)
+ return OPT_FMASK;
+ if (strncmp(token, "file_mode", 9) == 0)
+ return OPT_FILE_MODE;
+ if (strncmp(token, "dmask", 5) == 0)
+ return OPT_DMASK;
+ if (strncmp(token, "dir_mode", 8) == 0)
+ return OPT_DIR_MODE;
+ if (strncmp(token, "nosuid", 6) == 0)
+ return OPT_NO_SUID;
+ if (strncmp(token, "suid", 4) == 0)
+ return OPT_SUID;
+ if (strncmp(token, "nodev", 5) == 0)
+ return OPT_NO_DEV;
+ if (strncmp(token, "nobrl", 5) == 0 || strncmp(token, "nolock", 6) == 0)
+ return OPT_NO_LOCK;
+ if (strncmp(token, "dev", 3) == 0)
+ return OPT_DEV;
+ if (strncmp(token, "noexec", 6) == 0)
+ return OPT_NO_EXEC;
+ if (strncmp(token, "exec", 4) == 0)
+ return OPT_EXEC;
+ if (strncmp(token, "guest", 5) == 0)
+ return OPT_GUEST;
+ if (strncmp(token, "ro", 2) == 0)
+ return OPT_RO;
+ if (strncmp(token, "rw", 2) == 0)
+ return OPT_RW;
+ if (strncmp(token, "remount", 7) == 0)
+ return OPT_REMOUNT;
+
+ return OPT_ERROR;
+}
+
static int
parse_options(const char *data, struct parsed_mount_info *parsed_info)
{
- char *value = NULL, *equals = NULL;
+ char *value = NULL;
+ char *equals = NULL;
char *next_keyword = NULL;
char *out = parsed_info->options;
unsigned long *filesys_flags = &parsed_info->flags;
int out_len = 0;
int word_len;
int rc = 0;
- int got_uid = 0, got_gid = 0;
+ int got_uid = 0;
+ int got_gid = 0;
char user[32];
char group[32];
@@ -742,15 +887,15 @@
value = equals + 1;
}
- /* FIXME: turn into a token parser? */
- if (strncmp(data, "users", 5) == 0) {
+ switch(parse_opt_token(data)) {
+ case OPT_USERS:
if (!value || !*value) {
*filesys_flags |= MS_USERS;
goto nocopy;
}
- } else if (strncmp(data, "user_xattr", 10) == 0) {
- /* do nothing - need to skip so not parsed as user name */
- } else if (strncmp(data, "user", 4) == 0) {
+ break;
+
+ case OPT_USER:
if (!value || !*value) {
if (data[4] == '\0') {
*filesys_flags |= MS_USER;
@@ -761,7 +906,11 @@
return EX_USAGE;
}
} else {
- if (strnlen(value, 260) >= 260) {
+ /* domain/username%password */
+ const int max = MAX_DOMAIN_SIZE +
+ MAX_USERNAME_SIZE +
+ MOUNT_PASSWD_SIZE + 2;
+ if (strnlen(value, max + 1) >= max + 1) {
fprintf(stderr, "username too long\n");
return EX_USAGE;
}
@@ -773,7 +922,8 @@
}
goto nocopy;
}
- } else if (strncmp(data, "pass", 4) == 0) {
+
+ case OPT_PASS:
if (parsed_info->got_password) {
fprintf(stderr,
"password specified twice, ignoring second\n");
@@ -787,18 +937,21 @@
if (rc)
return rc;
goto nocopy;
- } else if (strncmp(data, "sec", 3) == 0) {
+
+ case OPT_SEC:
if (value) {
if (!strncmp(value, "none", 4) ||
!strncmp(value, "krb5", 4))
parsed_info->got_password = 1;
}
- } else if (strncmp(data, "ip", 2) == 0) {
+ break;
+
+ case OPT_IP:
if (!value || !*value) {
fprintf(stderr,
- "target ip address argument missing");
+ "target ip address argument missing\n");
} else if (strnlen(value, MAX_ADDRESS_LEN) <=
- MAX_ADDRESS_LEN) {
+ MAX_ADDRESS_LEN) {
if (parsed_info->verboseflag)
fprintf(stderr,
"ip address %s override specified\n",
@@ -806,23 +959,24 @@
} else {
fprintf(stderr, "ip address too long\n");
return EX_USAGE;
+
}
- } else if ((strncmp(data, "unc", 3) == 0)
- || (strncmp(data, "target", 6) == 0)
- || (strncmp(data, "path", 4) == 0)) {
+ break;
+
+ /* unc || target || path */
+ case OPT_UNC:
if (!value || !*value) {
fprintf(stderr,
"invalid path to network resource\n");
- return EX_USAGE; /* needs_arg; */
+ return EX_USAGE;
}
rc = parse_unc(value, parsed_info);
if (rc)
return rc;
- } else if ((strncmp(data, "dom" /* domain */ , 3) == 0)
- || (strncmp(data, "workg", 5) == 0)) {
- /* note this allows for synonyms of "domain"
- such as "DOM" and "dom" and "workgroup"
- and "WORKGRP" etc. */
+ break;
+
+ /* dom || workgroup */
+ case OPT_DOM:
if (!value || !*value) {
fprintf(stderr, "CIFS: invalid domain name\n");
return EX_USAGE;
@@ -835,21 +989,23 @@
strlcpy(parsed_info->domain, value,
sizeof(parsed_info->domain));
goto nocopy;
- } else if (strncmp(data, "cred", 4) == 0) {
- if (value && *value) {
- rc = open_cred_file(value, parsed_info);
- if (rc) {
- fprintf(stderr,
- "error %d (%s) opening credential file %s\n",
- rc, strerror(rc), value);
- return rc;
- }
- } else {
+
+ case OPT_CRED:
+ if (!value || !*value) {
fprintf(stderr,
"invalid credential file name specified\n");
return EX_USAGE;
}
- } else if (strncmp(data, "uid", 3) == 0) {
+ rc = open_cred_file(value, parsed_info);
+ if (rc) {
+ fprintf(stderr,
+ "error %d (%s) opening credential file %s\n",
+ rc, strerror(rc), value);
+ return rc;
+ }
+ break;
+
+ case OPT_UID:
if (value && *value) {
got_uid = 1;
if (!isdigit(*value)) {
@@ -863,12 +1019,13 @@
}
snprintf(user, sizeof(user), "%u",
pw->pw_uid);
- } else {
- strlcpy(user, value, sizeof(user));
}
+ else
+ strlcpy(user, value, sizeof(user));
}
goto nocopy;
- } else if (strncmp(data, "gid", 3) == 0) {
+
+ case OPT_GID:
if (value && *value) {
got_gid = 1;
if (!isdigit(*value)) {
@@ -882,14 +1039,19 @@
}
snprintf(group, sizeof(group), "%u",
gr->gr_gid);
- } else {
- strlcpy(group, value, sizeof(group));
}
+ else
+ strlcpy(group, value, sizeof(group));
}
goto nocopy;
- /* fmask and dmask synonyms for people used to smbfs syntax */
- } else if (strcmp(data, "file_mode") == 0
- || strcmp(data, "fmask") == 0) {
+
+ /* fmask fall through to file_mode */
+ case OPT_FMASK:
+ fprintf(stderr,
+ "WARNING: CIFS mount option 'fmask' is\
+ deprecated. Use 'file_mode' instead.\n");
+ data = "file_mode"; /* BB fix this */
+ case OPT_FILE_MODE:
if (!value || !*value) {
fprintf(stderr,
"Option '%s' requires a numerical argument\n",
@@ -897,19 +1059,19 @@
return EX_USAGE;
}
- if (value[0] != '0') {
+ if (value[0] != '0')
fprintf(stderr,
"WARNING: '%s' not expressed in octal.\n",
data);
- }
+ break;
- if (strcmp(data, "fmask") == 0) {
- fprintf(stderr,
- "WARNING: CIFS mount option 'fmask' is deprecated. Use 'file_mode' instead.\n");
- data = "file_mode"; /* BB fix this */
- }
- } else if (strcmp(data, "dir_mode") == 0
- || strcmp(data, "dmask") == 0) {
+ /* dmask falls through to dir_mode */
+ case OPT_DMASK:
+ fprintf(stderr,
+ "WARNING: CIFS mount option 'dmask' is\
+ deprecated. Use 'dir_mode' instead.\n");
+ data = "dir_mode";
+ case OPT_DIR_MODE:
if (!value || !*value) {
fprintf(stderr,
"Option '%s' requires a numerical argument\n",
@@ -917,49 +1079,53 @@
return EX_USAGE;
}
- if (value[0] != '0') {
+ if (value[0] != '0')
fprintf(stderr,
"WARNING: '%s' not expressed in octal.\n",
data);
- }
+ break;
- if (strcmp(data, "dmask") == 0) {
- fprintf(stderr,
- "WARNING: CIFS mount option 'dmask' is deprecated. Use 'dir_mode' instead.\n");
- data = "dir_mode";
- }
- /* the following eight mount options should be
- stripped out from what is passed into the kernel
- since these eight options are best passed as the
- mount flags rather than redundantly to the kernel
- and could generate spurious warnings depending on the
- level of the corresponding cifs vfs kernel code */
- } else if (strncmp(data, "nosuid", 6) == 0) {
+ /* the following mount options should be
+ stripped out from what is passed into the kernel
+ since these options are best passed as the
+ mount flags rather than redundantly to the kernel
+ and could generate spurious warnings depending on the
+ level of the corresponding cifs vfs kernel code */
+ case OPT_NO_SUID:
*filesys_flags |= MS_NOSUID;
- } else if (strncmp(data, "suid", 4) == 0) {
+ break;
+ case OPT_SUID:
*filesys_flags &= ~MS_NOSUID;
- } else if (strncmp(data, "nodev", 5) == 0) {
+ break;
+ case OPT_NO_DEV:
*filesys_flags |= MS_NODEV;
- } else if ((strncmp(data, "nobrl", 5) == 0) ||
- (strncmp(data, "nolock", 6) == 0)) {
+ break;
+ /* nolock || nobrl */
+ case OPT_NO_LOCK:
*filesys_flags &= ~MS_MANDLOCK;
- } else if (strncmp(data, "dev", 3) == 0) {
+ break;
+ case OPT_DEV:
*filesys_flags &= ~MS_NODEV;
- } else if (strncmp(data, "noexec", 6) == 0) {
+ break;
+ case OPT_NO_EXEC:
*filesys_flags |= MS_NOEXEC;
- } else if (strncmp(data, "exec", 4) == 0) {
+ break;
+ case OPT_EXEC:
*filesys_flags &= ~MS_NOEXEC;
- } else if (strncmp(data, "guest", 5) == 0) {
+ break;
+ case OPT_GUEST:
parsed_info->got_user = 1;
parsed_info->got_password = 1;
- } else if (strncmp(data, "ro", 2) == 0) {
+ break;
+ case OPT_RO:
*filesys_flags |= MS_RDONLY;
goto nocopy;
- } else if (strncmp(data, "rw", 2) == 0) {
+ case OPT_RW:
*filesys_flags &= ~MS_RDONLY;
goto nocopy;
- } else if (strncmp(data, "remount", 7) == 0) {
+ case OPT_REMOUNT:
*filesys_flags |= MS_REMOUNT;
+ break;
}
/* check size before copying option to buffer */
@@ -1169,6 +1335,9 @@
}
prepath = share + sharelen;
+ if (*prepath != '\0')
+ prepath++;
+
prepathlen = strlen(prepath);
if (prepathlen + 1 > sizeof(parsed_info->prefix)) {
@@ -1280,7 +1449,7 @@
}
static int
-add_mtab(char *devname, char *mountpoint, unsigned long flags)
+add_mtab(char *devname, char *mountpoint, unsigned long flags, const char *fstype)
{
int rc = 0;
uid_t uid;
@@ -1339,7 +1508,7 @@
mountent.mnt_fsname = devname;
mountent.mnt_dir = mountpoint;
- mountent.mnt_type = (char *)(void *)cifs_fstype;
+ mountent.mnt_type = (char *)(void *)fstype;
mountent.mnt_opts = (char *)calloc(MTAB_OPTIONS_LEN, 1);
if (mountent.mnt_opts) {
if (flags & MS_RDONLY)
@@ -1526,6 +1695,7 @@
size_t dev_len;
struct parsed_mount_info *parsed_info = NULL;
pid_t pid;
+ const char *fstype;
rc = check_setuid();
if (rc)
@@ -1540,11 +1710,11 @@
textdomain(PACKAGE); */
if (!argc || !argv) {
- rc = mount_cifs_usage(stderr);
+ rc = mount_usage(stderr);
goto mount_exit;
}
- thisprogram = argv[0];
+ thisprogram = basename(argv[0]);
if (thisprogram == NULL)
thisprogram = "mount.cifs";
@@ -1566,7 +1736,7 @@
switch (c) {
case '?':
case 'h': /* help */
- rc = mount_cifs_usage(stdout);
+ rc = mount_usage(stdout);
goto mount_exit;
case 'n':
++parsed_info->nomtab;
@@ -1595,13 +1765,13 @@
break;
default:
fprintf(stderr, "unknown command-line option: %c\n", c);
- rc = mount_cifs_usage(stderr);
+ rc = mount_usage(stderr);
goto mount_exit;
}
}
if (argc < 3 || argv[optind] == NULL || argv[optind + 1] == NULL) {
- rc = mount_cifs_usage(stderr);
+ rc = mount_usage(stderr);
goto mount_exit;
}
@@ -1669,6 +1839,7 @@
goto mount_exit;
}
+ /* lengths of different strings + slashes + trailing \0 */
dev_len = strnlen(parsed_info->host, sizeof(parsed_info->host)) +
strnlen(parsed_info->share, sizeof(parsed_info->share)) +
strnlen(parsed_info->prefix, sizeof(parsed_info->prefix)) +
@@ -1684,6 +1855,7 @@
strlcat(dev_name, parsed_info->host, dev_len);
strlcat(dev_name, "/", dev_len);
strlcat(dev_name, parsed_info->share, dev_len);
+ strlcat(dev_name, "/", dev_len);
strlcat(dev_name, parsed_info->prefix, dev_len);
currentaddress = parsed_info->addrlist;
@@ -1716,8 +1888,8 @@
}
if (parsed_info->verboseflag)
- fprintf(stderr, "mount.cifs kernel mount options: %s",
- options);
+ fprintf(stderr, "%s kernel mount options: %s",
+ thisprogram, options);
if (parsed_info->got_password) {
/*
@@ -1737,8 +1909,13 @@
if (rc)
goto mount_exit;
+ if (strcmp(thisprogram, "mount.smb2") == 0)
+ fstype = smb2_fstype;
+ else
+ fstype = cifs_fstype;
+
if (!parsed_info->fakemnt
- && mount(dev_name, ".", cifs_fstype, parsed_info->flags, options)) {
+ && mount(dev_name, ".", fstype, parsed_info->flags, options)) {
switch (errno) {
case ECONNREFUSED:
case EHOSTUNREACH:
@@ -1751,7 +1928,7 @@
goto mount_retry;
case ENODEV:
fprintf(stderr,
- "mount error: cifs filesystem not supported by the system\n");
+ "mount error: %s filesystem not supported by the system\n", fstype);
break;
case ENXIO:
if (!already_uppercased &&
@@ -1767,14 +1944,14 @@
fprintf(stderr, "mount error(%d): %s\n", errno,
strerror(errno));
fprintf(stderr,
- "Refer to the mount.cifs(8) manual page (e.g. man "
- "mount.cifs)\n");
+ "Refer to the %s(8) manual page (e.g. man "
+ "%s)\n", thisprogram, thisprogram);
rc = EX_FAIL;
goto mount_exit;
}
if (!parsed_info->nomtab)
- rc = add_mtab(dev_name, mountpoint, parsed_info->flags);
+ rc = add_mtab(dev_name, mountpoint, parsed_info->flags, fstype);
mount_exit:
if (parsed_info) {
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org