From 25fd3e18591eb0030fcb06c17934b8c0e8c9031c Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 01 2017 03:36:01 +0000 Subject: import cifs-utils-6.2-10.el7 --- diff --git a/SOURCES/0007-aclocal-fix-typo-in-idmap.m4.patch b/SOURCES/0007-aclocal-fix-typo-in-idmap.m4.patch new file mode 100644 index 0000000..8ef8633 --- /dev/null +++ b/SOURCES/0007-aclocal-fix-typo-in-idmap.m4.patch @@ -0,0 +1,33 @@ +From 2c907f120c77166e44e645e46a8fa1218f25bb5d Mon Sep 17 00:00:00 2001 +From: Jeff Layton +Date: Tue, 12 Jul 2016 16:53:25 -0400 +Subject: [PATCH 07/12] aclocal: fix typo in idmap.m4 + +We really don't want to do the same check twice. + +Signed-off-by: Jeff Layton +(cherry picked from commit bbbf7133aec555c5d27ee3163d6045ecfc4673d9) + +Resolves bz: 1427337 + +Signed-off-by: Sachin Prabhu +--- + aclocal/idmap.m4 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/aclocal/idmap.m4 b/aclocal/idmap.m4 +index 3ccdae3..4e16a46 100644 +--- a/aclocal/idmap.m4 ++++ b/aclocal/idmap.m4 +@@ -19,7 +19,7 @@ if test $enable_cifsidmap != "no" -o $enable_cifsacl != "no"; then + ]) + fi + +-if test $enable_cifsacl != "no" -o $enable_cifsacl != "no"; then ++if test $enable_cifsidmap != "no" -o $enable_cifsacl != "no"; then + ac_wbc_save_LDFLAGS="$LDFLAGS" + ac_wbc_save_LIBS="$LIBS" + LDFLAGS="$LDFLAGS $WBCLIENT_LIBS" +-- +2.9.3 + diff --git a/SOURCES/0008-mount.cifs-Removed-extra-comma-in-front-of-domain.patch b/SOURCES/0008-mount.cifs-Removed-extra-comma-in-front-of-domain.patch new file mode 100644 index 0000000..4da6e3a --- /dev/null +++ b/SOURCES/0008-mount.cifs-Removed-extra-comma-in-front-of-domain.patch @@ -0,0 +1,31 @@ +From 19ca816d222899e38e2b74b15ace16669050e475 Mon Sep 17 00:00:00 2001 +From: Germano Percossi +Date: Fri, 18 Nov 2016 18:54:49 +0000 +Subject: [PATCH 08/12] mount.cifs: Removed extra comma in front of domain + +Signed-off-by: Germano Percossi +(cherry picked from commit 76da9405575d484b33eb4e56466366c8dbe87046) + +Resolves bz: 1427337 + +Signed-off-by: Sachin Prabhu +--- + mount.cifs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mount.cifs.c b/mount.cifs.c +index 5c5734f..ebb4260 100644 +--- a/mount.cifs.c ++++ b/mount.cifs.c +@@ -1808,7 +1808,7 @@ assemble_mountinfo(struct parsed_mount_info *parsed_info, + if (*parsed_info->options) + strlcat(parsed_info->options, ",", + sizeof(parsed_info->options)); +- strlcat(parsed_info->options, ",domain=", ++ strlcat(parsed_info->options, "domain=", + sizeof(parsed_info->options)); + strlcat(parsed_info->options, parsed_info->domain, + sizeof(parsed_info->options)); +-- +2.9.3 + diff --git a/SOURCES/0009-mount.cifs-Accept-empty-domains-on-the-command-line.patch b/SOURCES/0009-mount.cifs-Accept-empty-domains-on-the-command-line.patch new file mode 100644 index 0000000..a146979 --- /dev/null +++ b/SOURCES/0009-mount.cifs-Accept-empty-domains-on-the-command-line.patch @@ -0,0 +1,70 @@ +From 61ef4ecfa58f28ab7c98bac7ae2a4b826d843204 Mon Sep 17 00:00:00 2001 +From: Germano Percossi +Date: Fri, 18 Nov 2016 18:54:50 +0000 +Subject: [PATCH 09/12] mount.cifs: Accept empty domains on the command line + +If we do not allow empty domains on the command line we are preventing +the kernel module from taking different actions if the domain has not +been specified at all or just passed empty. + +In fact, with this fix the cifs module behaves differently once an empty +domain is passed: the find_domain_name function is not invoked when an +empty domain is passed. + +It is possible to pass both 'domain=' or 'domain=""' even though the +kernel module will accept the former only when associated with the +sloppy option. + +Signed-off-by: Germano Percossi +(cherry picked from commit 57e4e22de7ea79f56471e7eb8cec9db926087f8d) + +Resolves bz: 1427337 + +Signed-off-by: Sachin Prabhu +--- + mount.cifs.c | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/mount.cifs.c b/mount.cifs.c +index ebb4260..88a3618 100644 +--- a/mount.cifs.c ++++ b/mount.cifs.c +@@ -189,6 +189,7 @@ struct parsed_mount_info { + unsigned int nomtab:1; + unsigned int verboseflag:1; + unsigned int nofail:1; ++ unsigned int got_domain:1; + }; + + static const char *thisprogram; +@@ -904,9 +905,14 @@ parse_options(const char *data, struct parsed_mount_info *parsed_info) + + /* dom || workgroup */ + case OPT_DOM: +- if (!value || !*value) { +- fprintf(stderr, "CIFS: invalid domain name\n"); +- return EX_USAGE; ++ if (!value) { ++ /* ++ * An empty domain has been passed ++ */ ++ /* not necessary but better safe than.. */ ++ parsed_info->domain[0] = '\0'; ++ parsed_info->got_domain = 1; ++ goto nocopy; + } + if (strnlen(value, sizeof(parsed_info->domain)) >= + sizeof(parsed_info->domain)) { +@@ -1812,6 +1818,9 @@ assemble_mountinfo(struct parsed_mount_info *parsed_info, + sizeof(parsed_info->options)); + strlcat(parsed_info->options, parsed_info->domain, + sizeof(parsed_info->options)); ++ } else if (parsed_info->got_domain) { ++ strlcat(parsed_info->options, ",domain=", ++ sizeof(parsed_info->options)); + } + + assemble_exit: +-- +2.9.3 + diff --git a/SOURCES/0010-mount.cifs-Fixed-command-line-parsing-and-aligned-wi.patch b/SOURCES/0010-mount.cifs-Fixed-command-line-parsing-and-aligned-wi.patch new file mode 100644 index 0000000..b57b924 --- /dev/null +++ b/SOURCES/0010-mount.cifs-Fixed-command-line-parsing-and-aligned-wi.patch @@ -0,0 +1,163 @@ +From 1f82a2588ac4c8975de0ebe52ad84393b8420e5b Mon Sep 17 00:00:00 2001 +From: Germano Percossi +Date: Fri, 18 Nov 2016 18:54:51 +0000 +Subject: [PATCH 10/12] mount.cifs: Fixed command line parsing and aligned with + kernel + +The way token matching was done was consuming the parameters namespace +quickly. For example, anything starting with "dom" was interpreted with +domain, while it could have been a completely different word. The same +is true even for "ro". + +Moreover, many perfectly valid options like "addr" where not accepted. + +The cifs kernel module is very strict when it comes to names: 'dom' and +'domain' are valid while 'domai' is not, so the userspace tool needs to +comply otherwise it becomes very difficult to come up with new names for +options. + +Now, checking is strict and as close as possible to kernel. When it is +not, it is just to avoid breaking compatibility with some users. +However, workg has been removed because it is too lazy and undocumented. + +The only variable left without strict checking is 'x-' because the +intent is to ignore anything starting in that way + +Signed-off-by: Germano Percossi +(cherry picked from commit a1f3acd40b265f134a97a739a6898b3958d206b9) + +Resolves bz: 1427337 + +Signed-off-by: Sachin Prabhu +--- + mount.cifs.c | 82 ++++++++++++++++++++++++++++++++++-------------------------- + 1 file changed, 47 insertions(+), 35 deletions(-) + +diff --git a/mount.cifs.c b/mount.cifs.c +index 88a3618..6eb0e6b 100644 +--- a/mount.cifs.c ++++ b/mount.cifs.c +@@ -689,73 +689,85 @@ static int parse_opt_token(const char *token) + if (token == NULL) + return OPT_ERROR; + +- if (strncmp(token, "users", 5) == 0) ++ /* ++ * token is NULL terminated and contains exactly the ++ * keyword so we can match exactly ++ */ ++ if (strcmp(token, "users") == 0) + return OPT_USERS; +- if (strncmp(token, "user_xattr", 10) == 0) ++ if (strcmp(token, "user_xattr") == 0) + return OPT_USER_XATTR; +- if (strncmp(token, "user", 4) == 0) ++ if (strcmp(token, "user") == 0 || ++ strcmp(token, "username") == 0) + return OPT_USER; +- if (strncmp(token, "pass", 4) == 0) ++ if (strcmp(token, "pass") == 0 || ++ strcmp(token, "password") == 0) + return OPT_PASS; +- if (strncmp(token, "sec", 3) == 0) ++ if (strcmp(token, "sec") == 0) + return OPT_SEC; +- if (strncmp(token, "ip", 2) == 0) ++ if (strcmp(token, "ip") == 0 || ++ strcmp(token, "addr") == 0) + return OPT_IP; +- if (strncmp(token, "unc", 3) == 0 || +- strncmp(token, "target", 6) == 0 || +- strncmp(token, "path", 4) == 0) ++ if (strcmp(token, "unc") == 0 || ++ strcmp(token, "target") == 0 || ++ strcmp(token, "path") == 0) + return OPT_UNC; +- if (strncmp(token, "dom", 3) == 0 || strncmp(token, "workg", 5) == 0) ++ if (strcmp(token, "dom") == 0 || ++ strcmp(token, "domain") == 0 || ++ strcmp(token, "workgroup") == 0) + return OPT_DOM; +- if (strncmp(token, "cred", 4) == 0) ++ if (strcmp(token, "cred") == 0 || /* undocumented */ ++ strcmp(token, "credentials") == 0) + return OPT_CRED; +- if (strncmp(token, "uid", 3) == 0) ++ if (strcmp(token, "uid") == 0) + return OPT_UID; +- if (strncmp(token, "cruid", 5) == 0) ++ if (strcmp(token, "cruid") == 0) + return OPT_CRUID; +- if (strncmp(token, "gid", 3) == 0) ++ if (strcmp(token, "gid") == 0) + return OPT_GID; +- if (strncmp(token, "fmask", 5) == 0) ++ if (strcmp(token, "fmask") == 0) + return OPT_FMASK; +- if (strncmp(token, "file_mode", 9) == 0) ++ if (strcmp(token, "file_mode") == 0) + return OPT_FILE_MODE; +- if (strncmp(token, "dmask", 5) == 0) ++ if (strcmp(token, "dmask") == 0) + return OPT_DMASK; +- if (strncmp(token, "dir_mode", 4) == 0 || strncmp(token, "dirm", 4) == 0) ++ if (strcmp(token, "dir_mode") == 0 || ++ strcmp(token, "dirm") == 0) + return OPT_DIR_MODE; +- if (strncmp(token, "nosuid", 6) == 0) ++ if (strcmp(token, "nosuid") == 0) + return OPT_NO_SUID; +- if (strncmp(token, "suid", 4) == 0) ++ if (strcmp(token, "suid") == 0) + return OPT_SUID; +- if (strncmp(token, "nodev", 5) == 0) ++ if (strcmp(token, "nodev") == 0) + return OPT_NO_DEV; +- if (strncmp(token, "nobrl", 5) == 0 || strncmp(token, "nolock", 6) == 0) ++ if (strcmp(token, "nobrl") == 0 || ++ strcmp(token, "nolock") == 0) + return OPT_NO_LOCK; +- if (strncmp(token, "mand", 4) == 0) ++ if (strcmp(token, "mand") == 0) + return OPT_MAND; +- if (strncmp(token, "nomand", 6) == 0) ++ if (strcmp(token, "nomand") == 0) + return OPT_NOMAND; +- if (strncmp(token, "dev", 3) == 0) ++ if (strcmp(token, "dev") == 0) + return OPT_DEV; +- if (strncmp(token, "noexec", 6) == 0) ++ if (strcmp(token, "noexec") == 0) + return OPT_NO_EXEC; +- if (strncmp(token, "exec", 4) == 0) ++ if (strcmp(token, "exec") == 0) + return OPT_EXEC; +- if (strncmp(token, "guest", 5) == 0) ++ if (strcmp(token, "guest") == 0) + return OPT_GUEST; +- if (strncmp(token, "ro", 2) == 0) ++ if (strcmp(token, "ro") == 0) + return OPT_RO; +- if (strncmp(token, "rw", 2) == 0 && strlen(token) == 2) ++ if (strcmp(token, "rw") == 0) + return OPT_RW; +- if (strncmp(token, "remount", 7) == 0) ++ if (strcmp(token, "remount") == 0) + return OPT_REMOUNT; +- if (strncmp(token, "_netdev", 7) == 0) ++ if (strcmp(token, "_netdev") == 0) + return OPT_IGNORE; +- if (strncmp(token, "backupuid", 9) == 0) ++ if (strcmp(token, "backupuid") == 0) + return OPT_BKUPUID; +- if (strncmp(token, "backupgid", 9) == 0) ++ if (strcmp(token, "backupgid") == 0) + return OPT_BKUPGID; +- if (strncmp(token, "nofail", 6) == 0) ++ if (strcmp(token, "nofail") == 0) + return OPT_NOFAIL; + if (strncmp(token, "x-", 2) == 0) + return OPT_IGNORE; +-- +2.9.3 + diff --git a/SOURCES/0011-mount.cifs-Remove-unneeded-stdbool-header-include.patch b/SOURCES/0011-mount.cifs-Remove-unneeded-stdbool-header-include.patch new file mode 100644 index 0000000..5ebd42f --- /dev/null +++ b/SOURCES/0011-mount.cifs-Remove-unneeded-stdbool-header-include.patch @@ -0,0 +1,30 @@ +From 4a7a8a8a6d3dc9466eb437517d16e8ab0ac52704 Mon Sep 17 00:00:00 2001 +From: Germano Percossi +Date: Fri, 18 Nov 2016 18:54:52 +0000 +Subject: [PATCH 11/12] mount.cifs: Remove unneeded stdbool header include + +Signed-off-by: Germano Percossi +(cherry picked from commit 743301da5bf502197beb1f91f98e11eea9070e4e) + +Resolves bz: 1427337 + +Signed-off-by: Sachin Prabhu +--- + mount.cifs.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/mount.cifs.c b/mount.cifs.c +index 6eb0e6b..b2bcb7f 100644 +--- a/mount.cifs.c ++++ b/mount.cifs.c +@@ -45,7 +45,6 @@ + #include + #include + #include +-#include + #ifdef HAVE_SYS_FSUID_H + #include + #endif /* HAVE_SYS_FSUID_H */ +-- +2.9.3 + diff --git a/SOURCES/0012-manpage-document-mfsymlinks-in-the-mount.cifs-man-pa.patch b/SOURCES/0012-manpage-document-mfsymlinks-in-the-mount.cifs-man-pa.patch new file mode 100644 index 0000000..e181f45 --- /dev/null +++ b/SOURCES/0012-manpage-document-mfsymlinks-in-the-mount.cifs-man-pa.patch @@ -0,0 +1,36 @@ +From d020fbf352ec9c2c4cfd66b8bd1b956e5e8ed9fb Mon Sep 17 00:00:00 2001 +From: Sachin Prabhu +Date: Wed, 4 Jan 2017 07:45:17 -0500 +Subject: [PATCH 12/12] manpage: document mfsymlinks in the mount.cifs man page + +Information from the cifs README in the kernel sources is used. + +Signed-off-by: Sachin Prabhu +(cherry picked from commit d73a52e50d43f07638f34cb860e9824a932508b8) + +Resolves bz: 1252725 + +Signed-off-by: Sachin Prabhu +--- + mount.cifs.8 | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/mount.cifs.8 b/mount.cifs.8 +index af6b097..01579f6 100644 +--- a/mount.cifs.8 ++++ b/mount.cifs.8 +@@ -450,6 +450,11 @@ sfu + When the CIFS Unix Extensions are not negotiated, attempt to create device files and fifos in a format compatible with Services for Unix (SFU)\&. In addition retrieve bits 10\-12 of the mode via the SETFILEBITS extended attribute (as SFU does)\&. In the future the bottom 9 bits of the mode mode also will be emulated using queries of the security descriptor (ACL)\&. [NB: requires version 1\&.39 or later of the CIFS VFS\&. To recognize symlinks and be able to create symlinks in an SFU interoperable form requires version 1\&.40 or later of the CIFS VFS kernel module\&. + .RE + .PP ++mfsymlinks ++.RS 4 ++Enable support for Minshall+French symlinks(see http://wiki.samba.org/index.php/UNIX_Extensions#Minshall.2BFrench_symlinks). This option is ignored when specified together with the 'sfu' option. Minshall+French symlinks are used even if the server supports the CIFS Unix Extensions. ++.RE ++.PP + serverino + .RS 4 + Use inode numbers (unique persistent file identifiers) returned by the server instead of automatically generating temporary inode numbers on the client\&. Although server inode numbers make it easier to spot hardlinked files (as they will have the same inode numbers) and inode numbers may be persistent (which is userful for some sofware), the server does not guarantee that the inode numbers are unique if multiple server side mounts are exported under a single share (since inode numbers on the servers might not be unique if multiple filesystems are mounted under the same shared higher level directory)\&. Note that not all servers support returning server inode numbers, although those that support the CIFS Unix Extensions, and Windows 2000 and later servers typically do support this (although not necessarily on every local server filesystem)\&. Parameter has no effect if the server lacks support for returning inode numbers or equivalent\&. This behavior is enabled by default\&. +-- +2.9.3 + diff --git a/SPECS/cifs-utils.spec b/SPECS/cifs-utils.spec index e75825d..afa5de0 100644 --- a/SPECS/cifs-utils.spec +++ b/SPECS/cifs-utils.spec @@ -3,7 +3,7 @@ Name: cifs-utils Version: 6.2 -Release: 9%{pre_release}%{?dist} +Release: 10%{pre_release}%{?dist} Summary: Utilities for mounting and managing CIFS mounts Group: System Environment/Daemons @@ -31,6 +31,12 @@ Patch10: 0003-mtab.c-include-paths.h-for-_PATH_MOUNTED.patch Patch11: 0004-manpage-clarify-use-of-backupuid-and-backupgid-in-mo.patch Patch12: 0005-mount.cifs-ignore-x-mount-options.patch Patch13: 0001-autoconf-Use-DEFS-when-building-idmapwb.so.patch +Patch14: 0007-aclocal-fix-typo-in-idmap.m4.patch +Patch15: 0008-mount.cifs-Removed-extra-comma-in-front-of-domain.patch +Patch16: 0009-mount.cifs-Accept-empty-domains-on-the-command-line.patch +Patch17: 0010-mount.cifs-Fixed-command-line-parsing-and-aligned-wi.patch +Patch18: 0011-mount.cifs-Remove-unneeded-stdbool-header-include.patch +Patch19: 0012-manpage-document-mfsymlinks-in-the-mount.cifs-man-pa.patch %description The SMB/CIFS protocol is a standard file sharing protocol widely deployed @@ -64,6 +70,12 @@ necessary for building ID mapping plugins for cifs-utils. %patch11 -p1 %patch12 -p1 %patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 +%patch17 -p1 +%patch18 -p1 +%patch19 -p1 %build %configure --prefix=/usr ROOTSBINDIR=%{_sbindir} @@ -113,6 +125,14 @@ fi %{_includedir}/cifsidmap.h %changelog +* Mon Apr 03 2017 Sachin Prabhu - 6.2-10 +- aclocal: fix typo in idmap.m4 +- mount.cifs: Removed extra comma in front of domain +- mount.cifs: Accept empty domains on the command line +- mount.cifs: Fixed command line parsing and aligned with kernel +- mount.cifs: Remove unneeded stdbool header include +- manpage: document mfsymlinks in the mount.cifs man page + * Thu Jun 30 2016 Sachin Prabhu - 6.2-9 - Use $(DEFS) when building idmapwb.so