summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-01-07mount.cifs: ignore x-* mount optionsKarel Zak1-0/+2
x-* prefix is used for userspace mount options and it's pretty commonly used to extend fstab configuration in systemd world (e.g. x-systemd.automount). These options is necessary to ignored. The command mount(8) does not pass x-* mount options to mount.<type> helpers, but in some use-cases it's possible that the cifs helper reads mount options from fstab or users directly call mount.cifs and copy & past mount options, etc. This patch marks all options prefixed by "x-" as OPT_IGNORE to make things more robust for end-users. We already uses the same concept for _netdev. Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2016-01-07manpage: clarify use of backupuid and backupgid in mount.cifs.8Uri Simchoni1-3/+3
Assert that backup intent shall only be attempted if the user matches the backupuid or backupgid parameter. Signed-off-by: Uri Simchoni <uri@samba.org> Signed-off-by: Jeff Layton <jlayton@samba.org>
2014-12-08mtab.c: include <paths.h> for _PATH_MOUNTEDFelix Janda1-0/+1
Signed-off-by: Felix Janda <felix.janda@posteo.de>
2014-12-08autoconf: set version to 6.4.1 for interim buildsJeff Layton1-1/+1
Signed-off-by: Jeff Layton <jlayton@samba.org>
2014-07-11autoconf: set version to 6.4cifs-utils-6.4Jeff Layton1-1/+1
Signed-off-by: Jeff Layton <jlayton@samba.org>
2014-07-01mount.cifs: on 2nd try mount.cifs must also uppercase "orig_dev"Guenter Kukkukk1-1/+2
Recent kernels now ignore "unc=..." mount option. mount.cifs, when getting errno=ENXIO, retries the mount with uppercased hostname, sharename and prefixpath in the "unc=..." mount option, which is ignored now in the kernel. Used e.g. during OS/2 mounts, which fail now. Also uppercase the now used "orig_dev" parameter. Signed-off-by: Guenter Kukkukk <kukks@samba.org>
2014-04-20cifscreds: better error handling for key_addJeff Layton3-9/+14
If the string buffers would have been overrun, set errno to EINVAL before returning. Then, have the callers report the errors to stderr or syslog as appropriate. Cc: Sebastian Krahmer <krahmer@suse.de> Signed-off-by: Jeff Layton <jlayton@samba.org>
2014-04-20cifscreds: better error handling when key_search failsJeff Layton3-1/+22
If we ended up getting a bogus string that would have overflowed, then make key_search set errno to EINVAL before returning. The callers can then test to see if the returned error is what was expected or something else and handle it appropriately. Cc: Sebastian Krahmer <krahmer@suse.de> Signed-off-by: Jeff Layton <jlayton@samba.org>
2014-04-14cifskey: better use snprintf()Sebastian Krahmer1-3/+7
Prefer snprintf() over sprintf() in cifskey.c Projects that fork the code (pam_cifscreds) can't rely on the max-size parameters. [jlayton: removed unneeded initialization of "len" in key_add] Signed-off-by: Sebastian Krahmer <krahmer@suse.de>
2014-04-07cifs: use krb5_kt_default() to determine default keytab locationJeff Layton1-4/+9
...don't assume that it's in /etc/krb5.keytab. Reported-by: Konstantin Lepikhov <klepikho@redhat.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2014-04-07autoconf: allow PAM security install directory to be configurableLars Müller2-2/+6
Allow the pam module install directory to be set at build time. Signed-off-by: Jeff Layton <jlayton@samba.org>
2014-04-07autoconf: set version to 6.3.1 for interim buildsJeff Layton1-1/+1
Signed-off-by: Jeff Layton <jlayton@samba.org>
2014-01-09autoconf: set version to 6.3cifs-utils-6.3Jeff Layton1-1/+1
Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-12-13manpage: add pam_cifscreds.8 man pageOrion Poplawski3-0/+292
Signed-off-by: Orion Poplawski <orion@nwra.com>
2013-12-07cifscreds: fix up some whitespace, typos and build warnings in pam_cifscreds.cJeff Layton1-19/+15
gcc -g -O2 -Wall -Wextra -D_FORTIFY_SOURCE=2 -fpie -pie -Wl,-z,relro,-z,now -shared -fpic -o pam_cifscreds.so pam_cifscreds.c cifskey.c resolve_host.c util.c -lpam -lkeyutils pam_cifscreds.c: In function ‘cleanup_free_password’: pam_cifscreds.c:143:38: warning: unused parameter ‘ph’ [-Wunused-parameter] cleanup_free_password (pam_handle_t *ph, void *data, int pam_end_status) ^ pam_cifscreds.c:143:58: warning: unused parameter ‘pam_end_status’ [-Wunused-parameter] cleanup_free_password (pam_handle_t *ph, void *data, int pam_end_status) ^ pam_cifscreds.c: In function ‘cifscreds_pam_update’: pam_cifscreds.c:271:8: warning: variable ‘addrs’ set but not used [-Wunused-but-set-variable] char *addrs[16]; ^ pam_cifscreds.c: In function ‘pam_sm_authenticate’: pam_cifscreds.c:359:58: warning: unused parameter ‘unused’ [-Wunused-parameter] PAM_EXTERN int pam_sm_authenticate(pam_handle_t *ph, int unused, int argc, const char **argv) ^ pam_cifscreds.c: In function ‘pam_sm_open_session’: pam_cifscreds.c:414:58: warning: unused parameter ‘flags’ [-Wunused-parameter] PAM_EXTERN int pam_sm_open_session(pam_handle_t *ph, int flags, int argc, const char **argv) ^ pam_cifscreds.c: In function ‘pam_sm_close_session’: pam_cifscreds.c:487:51: warning: unused parameter ‘ph’ [-Wunused-parameter] PAM_EXTERN int pam_sm_close_session(pam_handle_t *ph, int flags, int argc, const char **argv) ^ pam_cifscreds.c:487:59: warning: unused parameter ‘flags’ [-Wunused-parameter] PAM_EXTERN int pam_sm_close_session(pam_handle_t *ph, int flags, int argc, const char **argv) ^ pam_cifscreds.c:487:70: warning: unused parameter ‘argc’ [-Wunused-parameter] PAM_EXTERN int pam_sm_close_session(pam_handle_t *ph, int flags, int argc, const char **argv) ^ pam_cifscreds.c:487:89: warning: unused parameter ‘argv’ [-Wunused-parameter] PAM_EXTERN int pam_sm_close_session(pam_handle_t *ph, int flags, int argc, const char **argv) ^ pam_cifscreds.c: In function ‘pam_sm_setcred’: pam_cifscreds.c:501:45: warning: unused parameter ‘ph’ [-Wunused-parameter] PAM_EXTERN int pam_sm_setcred(pam_handle_t *ph, int flags, int argc, const char **argv) ^ pam_cifscreds.c:501:53: warning: unused parameter ‘flags’ [-Wunused-parameter] PAM_EXTERN int pam_sm_setcred(pam_handle_t *ph, int flags, int argc, const char **argv) ^ pam_cifscreds.c:501:64: warning: unused parameter ‘argc’ [-Wunused-parameter] PAM_EXTERN int pam_sm_setcred(pam_handle_t *ph, int flags, int argc, const char **argv) ^ pam_cifscreds.c:501:83: warning: unused parameter ‘argv’ [-Wunused-parameter] PAM_EXTERN int pam_sm_setcred(pam_handle_t *ph, int flags, int argc, const char **argv) ^ Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-12-07cifscreds: create PAM module to insert credentials at loginOrion Poplawski6-52/+681
Split out some of the cifscreds key handling routines into a separate file, and then link that in to both cifscreds and the new PAM module. Fix up autoconf to handle building this automatically. Signed-off-by: Orion Poplawski <orion@nwra.com>
2013-12-07autoconf: fix link of libwbclientJeff Layton1-0/+2
It's currently getting added to $LIBS and being linked into places that we don't need it. Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-10-14asn1: fix use-after-free in asn1_writeJeff Layton1-1/+0
If the talloc_realloc() fails, asn1_write calls talloc_free on the context and then immediately dereferences the pointer. Fix this by skipping the talloc_free here. Let the caller handle it. Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-10-11mount.cifs: fix bad free() of string returned by dirname()Jeff Layton1-11/+18
Coverity says: Error: CPPCHECK_WARNING: [#def10] cifs-utils-6.2/mount.cifs.c:1518: error[memleakOnRealloc]: Common realloc mistake: 'mtabdir' nulled but not freed upon failure del_mtab has a number of bugs in handling of allocated memory: a) the return value of strdup() is not checked b) It calls realloc() on a pointer that wasn't returned by an allocation function (e.g. malloc, calloc, etc.) c) If realloc() fails, it doesn't call free() on the original memory returned by strdup() Fix all of these bugs and add newlines to the end of the error messages in del_mtab. Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-10-10data_blob: clean out unused functionsJeff Layton2-230/+0
Cut another 6k or so out of the cifs.upcall binary. Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-10-10asn1: remove some usused functionsJeff Layton2-675/+0
This cuts 30k out of the cifs.upcall binary on my x86_64 box. Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-10-10getcifsacl: remove some dead codeJeff Layton1-4/+1
Coverity says: Error: DEADCODE (CWE-561): [#def5] cifs-utils-6.2/getcifsacl.c:101: assignment: Assigning: "mflags" = "false". cifs-utils-6.2/getcifsacl.c:109: const: At condition "mflags", the value of "mflags" must be equal to 0. cifs-utils-6.2/getcifsacl.c:109: dead_error_condition: The condition "mflags" cannot be true. cifs-utils-6.2/getcifsacl.c:110: dead_error_line: Execution cannot reach this statement "printf("|");". Acked-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-10-08get/setcifsacl: fix bad bit-shiftsJeff Layton2-2/+2
A Coverity scan turned up this warning: 1. cifs-utils-6.2/setcifsacl.c:578:result_independent_of_operands – "(x & 0xff0000000000ULL) >> 48" is 0 regardless of the values of its operands. This occurs as the operand of assignment. ...which is entirely true. That shift should be 40 bits, not 48. Also fix a similar bug in getcifsacl.c. Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-10-08autoconf: set release to 6.2.1 for interim buildsJeff Layton1-1/+1
Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-10-04autoconf: set version to 6.2cifs-utils-6.2Jeff Layton1-1/+1
Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-10-04autoconf: update configure.ac a'la autoupdateJeff Layton1-22/+11
Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-09-17cifs.upcall: try to use default credcache if we didn't find oneJeff Layton1-5/+14
Fedora is in the process of moving to KEYRING: credcaches which are not currently handled by cifs.upcall. We could try to detect when they're in use, but it's simpler and more robust to just try to use the default credcache whenever we don't find a FILE: or DIR: cache. Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-09-09autoconf: add another suggested package name for krb5 headersSteve French1-2/+2
Added an alternate package name for krb5 headers. Noticed the following suggestion asks for the wrong package (at least wrong for FC17) checking krb5.h presence... no checking for krb5.h... no checking krb5/krb5.h usability... no checking krb5/krb5.h presence... no checking for krb5/krb5.h... no configure: WARNING: krb5.h not found, consider installing krb5-libs-devel. Disabling cifs.upcall. [sfrench@w500smf cifs-utils]$ sudo yum install krb5-libs-devel Loaded plugins: langpacks, presto, refresh-packagekit No package krb5-libs-devel available. Error: Nothing to do [sfrench@w500smf cifs-utils]$ sudo yum install krb5-devel (installing krb5-devel worked, but not krb5-libs-devel for this version) Signed-off-by: Steve French <smfrench@gmail.com>
2013-07-30Do not rely on hardcoded path to systemd-ask-password.Michał Górny1-2/+2
Relying on hardcoded /bin/systemd-ask-password path breaks systemd that install systemd-ask-password in /usr/bin. Since both paths are supposed to be in ${PATH} and popen() passes the command to shell, just pass 'systemd-ask-password' and let the shell find it. Fixes: https://bugzilla.samba.org/show_bug.cgi?id=10054 Signed-off-by: Michał Górny <mgorny@gentoo.org>
2013-07-22cifs-utils: Correct max string lengths v2Scott Lovenberg2-7/+17
The max size of the username, domain, and password strings are now consistent with the kernel and Microsoft's documentation. Signed-off-by: Scott Lovenberg <scott.lovenberg@gmail.com>
2013-07-18cifs-utils: fix some sparse warningsJeff Layton10-34/+26
Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-07-18setcifsacl: add fallback for when plugin can't be loadedJeff Layton1-5/+87
Allow setcifsacl to function even in the case where the plugin can't be initialized. ID mapping of course won't work, but we can still allow it to accept "raw" SID strings. Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-07-08manpage: fix nouser_xattr descriptionJeff Layton1-1/+1
The manpage erroneously states that nouser_xattr is the default, when it's actually the reverse. Reported-by: Dome <domfe@tiscali.it> Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-07-08autoconf: set version to 6.1.1 for interim buildsJeff Layton1-1/+1
Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-07-02cifs-utils: set version to 6.1cifs-utils-6.1Jeff Layton1-1/+1
Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-05-29cifs.upcall: allow users to specify dedicated keytab on command-lineJeff Layton2-3/+12
Currently cifs.upcall only looks at the default system keytab (/etc/krb5.keytab). It's often the case however that a dedicated keytab is desirable. Allow administrators to set one on the command-line. Reported-by: steve <steve@steve-ss.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-05-23cifs.upcall: the exit code should be 0 when print versionPeng Haitao1-0/+1
When print version number, the exit code should be 0 and syslog() should not send "Negating key" to the system logger. Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
2013-04-12setcifsacl.c: fix a bug of goto setcifsacl_facenum_retPeng Haitao1-2/+3
setcifsacl_facenum_ret: is called only if attrlen is equal to -1. Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
2013-04-10mount.cifs: Trivial comment fixesScott Lovenberg1-2/+2
Two trivial comment fixes. Signed-off-by: Scott Lovenberg <scott.lovenberg@gmail.com>
2013-04-10cifs-utils: set version to 6.0.1 for interim buildsJeff Layton1-1/+1
Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-03-25autoconf: set version to 6.0cifs-utils-6.0Jeff Layton1-1/+1
Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-03-22mount.cifs: remove support for "NFS syntax"Jeff Layton1-28/+10
...as promised for version 6.0. Cc: Scott Lovenberg <scott.lovenberg@gmail.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-03-20manpage: better document the default sec= mount optionJeff Layton1-9/+11
The default changed in mainline kernel v3.8. Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-03-16manpage: document the mount.cifs vers= optionJeff Layton1-0/+51
Thanks to Tom Talpey for clarifying some of the info here. Cc: Tom Talpey <ttalpey@microsoft.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-02-01cifs-utils: add autoconf test to make sure that libwbclient is usableJeff Layton1-0/+20
The idmapwb plugin requires a usable wbcSidsToUnixIds() function. Check to ensure that the wbclient library provides that symbol, and handle it appropriately if it doesn't. If someone were so inclined they probably could fix idmapwb to fall back to the older mapping functions if that symbol doesn't exist, but for now this patch just makes it refuse to build the plugin. Reported-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-01-29setcifsacl: fix offset calculation in "set" codeJeff Layton1-3/+4
Previously the code assumed that the ACE that was copied was of a fixed size. Save off the return value from copy_ace and ensure that we apply it correctly to the size and offset. Reported-by: Jian Li <jiali@redhat.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-01-28setcifsacl: fix infinite loop in getnumcacesJeff Layton2-2/+4
Jian pointed out that this loop can cycle infinitely when the string contains a ','. Also, fix typo in manpage that shows a trailing ',' in one example. Reported-by: Jian Li <jiali@redhat.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-01-13mount.cifs: set parsed_info->got_user when a cred file supplies a usernameJeff Layton1-1/+2
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." <grawity@gmail.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-01-07cifsidmap: clean up comments on API descriptionJeff Layton1-7/+7
...typo and grammatical fixes, mostly. Signed-off-by: Jeff Layton <jlayton@samba.org>
2013-01-07autoconf: set release to 5.9.1 for interim buildsJeff Layton1-1/+1
Signed-off-by: Jeff Layton <jlayton@samba.org>