summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-10-29cifs.idmap: add an options struct to handle long optionsJeff Layton1-1/+6
...since the manpage advertises them. Reviewed-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-10-29cifs.idmap: get rid of useless strcmp prior to idmappingJeff Layton1-2/+1
The code copies off the key description and then ensures that it's prefixed with "cifs.idmap". What's the point of that? Presumably request-key would never have called this otherwise. There's little harm in going ahead and doing the idmapping if this is called with the wrong string. Also, the error handling here is wrong. If the prefix doesn't match the code will exit 0 without doing any mapping. Just remove it. Reviewed-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-10-29cifs.idmap: make sure cifsacl structs are packedJeff Layton1-4/+4
The kernel equivalent definitions are defined with __attribute__((packed)), and the code seems to assume the userspace and kernel ones will be properly aligned. Fix the userspace definitions in a similar fashion. Given the way these structs are, there is probably not any padding between fields on most arches, but it's best to be safe here. Reviewed-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-10-23mount.cifs: add warning that NFS syntax is deprecated and will beScott Lovenberg1-0/+4
removed in cifs-utils-6.0. [jlayton: Added newline to end of warning] Signed-off-by: Scott Lovenberg <scott.lovenberg@gmail.com>
2012-10-12autoconf: set release to 5.7.1 for interim buildsJeff Layton1-1/+1
Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-10-09autoconf: set version to 5.7cifs-utils-5.7Jeff Layton1-1/+1
Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-10-08mount.cifs: implement the "nofail" optionJeff Layton1-1/+8
The mount(8) manpage lists this as a fs-independent option: nofail: Do not report errors for this device if it does not exist. Implement that in mount.cifs by not returning an error if we were unable to find a suitable address for the mount attempt. Reported-by: Peter Trenholme <PTrenholme@gmail.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-09-25manpage: clarify usage of the username= optionJeff Layton1-22/+2
Specifying the username as "user=" can confuse some versions of /bin/mount, and cause it to append noexec to the mount string. Also, remove the blurb about how cifs.ko will accept abbreviations -- it's just bad practice since it leads to these sorts of conflicts. A wonderful example of this confusion was reported by Stefan here: https://bugzilla.redhat.com/show_bug.cgi?id=860154 Reported-by: Stefan Walter <walteste@inf.ethz.ch> Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-09-12mount.cifs: running out of addresses is not a system errorJeff Layton1-1/+1
This patch fixes a minor regression. It used to be that when the mount helper would run out of addresses that it would return EX_FAIL to userspace. It now returns EX_SYSERR which is incorrect. Reinstate the correct error code. Reported-by: Ales Zelinka <azelinka@redhat.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-08-23mount.cifs: silence compiler warnings about ignoring return codeJeff Layton1-2/+2
In this case we explicitly don't care what these functions return, so declare a couple of unused variables to catch the results. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-08-23cifs.upcall: use strncmp in scandir filter functionJeff Layton1-4/+3
We want to require that the filename begins with the correct string, not just that it contains it somewhere. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-08-23cifs.upcall: scan /run/user/${UID} for ccaches, tooNalin Dahyabhai1-11/+51
When scanning for credential caches, check the user's directory under /run/user first, then fall back to /tmp as we have previously. Because we now call find_krb5_cc() twice (once for each directory), we move its state to be outside of the function. We also add a substitution mechanism to make the process of resolving the location of the user's home directory before searching it a bit more explicable.
2012-08-23cifs.upcall: also consider DIR:-type ccachesNalin Dahyabhai1-0/+5
If we encounter a subdirectory while scanning a directory for a user's ccache, check if it's a "DIR" ccache. Otherwise, continue as before, checking if it's a "FILE" ccache if it looks like a regular file.
2012-08-21cifs-utils: fix up references to getcifsacl and setcifsacl filesJeff Layton4-12/+6
When I moved the manpages for this to section 1, I missed some references to them. Also, get rid of the unneeded clean-local-aclprogs makefile target. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-08-07mount.cifs: handle username= differently depending on sec= optionJeff Layton1-11/+34
This patch is intended as a temporary workaround for krb5 users that need to specify usernames with '/' in them. I intend to remove this hack from mount.cifs once the legacy username handling code is removed. The idea here is to save off the raw username string while we're parsing options. If the mount options specify "sec=krb5" or "sec=krb5i" then we'll not do the legacy username parsing and will instead just pass in the username string as-is. Obviously, this is a nasty hack and we don't really want to carry this in perpetuity, so this can go away once the "legacy" username parsing has gone away. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-08-07mount.cifs: deprecate the DOMAIN/username%password username syntaxJeff Layton2-1/+17
mount.cifs has in the past allowed users to specify a username using the above syntax, which would populate the domain and password fields with the different pieces. Unfortunately, there are cases where it is legit to have a '/' in a username. krb5 SPNs generally contain a '/' and we have no clear way to distinguish between the two. I don't see any real value in keeping that syntax allowed. It's no easier than specifying "pass=" and "domain=" on the command line. Ditto for credential files. Begin the transition away from that syntax by adding a warning message that support for it will be removed in 5.9. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-08-07autoconf: set version to 5.6.1 for interim buildsJeff Layton1-1/+1
Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-07-26autoconf: set version to 5.6cifs-utils-5.6Jeff Layton1-1/+1
Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-07-20cifscreds: add a check and warnings for session keyring problemsJeff Layton3-1/+50
Many distros do not call into pam_keyinit to set up the session keyring properly at login time. When cifscreds add is used in such a session, the kernel will spawn a new session keyring in which to install the credentials. That keyring will then go away once the cifscreds process exits. Check for this situation by looking to see if the session and user-session keyrings are the same. Throw a warning if so, and add some verbiage to the cifscreds manpage that explains the issue. Also, if the session keyring can't be queried for any reason, then cause the program to error out. Acked-by: David Howells <dhowells@redhat.com> Reported-by: Milan Knížek <knizek.confy@gmail.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-07-19mount.cifs: Use errno instead of having unknown errorLuk Claes1-0/+1
When access() fails, use errno for a sensible error message. Signed-off-by: Luk Claes <luk@debian.org>
2012-07-18mount.cifs: Use systemd's mechanism for getting password, if present.Ankit Jain2-5/+81
If systemd is running and /bin/systemd-ask-password if available, then use that else fallback on getpass(..). And add a --enable-systemd configure option, which defaults to yes. Signed-off-by: Ankit Jain <jankit@suse.com>
2012-07-10autoconf: Fix building with autoconf version older than 2.60.Andreas Schneider1-1/+6
AC_PROG_SED is only avaliable in recent autoconf versions. Use AC_CHECK_PROG instead if AC_PROG_SED is not present. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2012-07-10autoconf: add --enable-pie and --enable-relroJeff Layton2-1/+28
-pie and -fpie enable the building of position-independent executables, and -Wl,-z,relro turns on read-only relocation support in gcc. These options are important for security purposes to guard against possible buffer overflows that lead to exploits. Follow the example of samba here and enable these by default, but add configure options that allow people to turn them off at build-time if necessary. We may also want to eventually add checks to ensure that the compiler and linker understand these options, but I'll wait until we have some evidence that it's needed before I expend the effort. Reported-by: Andreas Schneider <asn@samba.org> Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-07-10replace: remove bzero() redefinition from replace.hJeff Layton1-4/+0
I borrowed replace.h from samba when I split off the package, and we have a ton of definitions in there that we don't really need. This is one of them and it causes a warning when we build on RHEL5. Reported-by: Andreas Schneider <asn@samba.org> Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-06-14cifs.upcall: more debug logging for krb5 upcallsJeff Layton1-3/+8
While helping to track down a configuration problem, I found this little bit of extra debug logging to be helpful. Might as well make it part of the stock binary. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-06-14mount.cifs: set rc to 0 in libcap toggle_dac_capabilityJeff Layton1-1/+1
Thus spake Jochen: The mount.cifs program from the cifs-utils package 5.5 did not work on my Linux system. It just exited without an error message and did not mount anything. [...] I think, when this variable rc is now used in this function, it has also to be properly initialized there. Reported-by: Jochen Roderburg <roderburg@uni-koeln.de> Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-06-14automake: revert -Werror by defaultJeff Layton1-1/+1
I think in hindsight, that adding -Werror by default was a mistake. cifs-utils is built in a wide range of environments and tools, and it's very difficult to eliminate all of the possible warnings. Let's go ahead and remove it and reduce the steady trickle of patches that are simply to silence obscure warnings. Cc: Suresh Jayaraman <sjayaraman@suse.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-06-01autoconf: set version to 5.5.1 for interim buildsJeff Layton1-1/+1
Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-05-30autoconf: set version to 5.5cifs-utils-5.5Jeff Layton1-1/+1
Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-05-21manpage: document the cache= option and mark strictcache and directio asJeff Layton1-0/+100
being deprecated ...also add a CACHE COHERENCY section so that we can explain cifs' behavior in detail. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-05-19mount.cifs: unused variablesLuk Claes1-2/+2
2012-05-17doc: remove old XML sources for mount.cifs.8 and cifs.upcall.8Jeff Layton2-874/+0
These files were added when I originally split these tools off from the samba sources, but we haven't ever used them to build the actual manpages and they haven't been maintained. Remove them. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-05-17mount.cifs: remove smb2 multicall binary codeJeff Layton1-57/+4
This was added when it was thought that smb2 would be a different fstype altogether. Now that we are not adding a separate fstype, this code is no longer needed since nothing will ever call /sbin/mount.smb2. Cc: Steve French <smfrench@gmail.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-05-17mount.cifs: don't send a mandatory ver= option to the kernelJeff Layton1-13/+7
Traditionally, this ver= option was used to specify the "options version" that we're passing in. It has always been set to '1' though and we have never changed that. Eventually we want to have a ver= (or vers=) option that allows users to specify the SMB version that they want to use to talk to the server. At that point, this option will just get in the way. Let's go ahead and remove it now in preparation for that day. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-05-14doc: update mailing listJeff Layton3-3/+3
Signed-off-by: Luk Claes <luk@debian.org>
2012-05-02mount.cifs: don't pass credentials= option to the kernelJeff Layton1-2/+4
We handle this option in userspace, so there's little value in also passing it to the kernel. Also fix minor double-comma nit in the options string. Reported-by: Ronald <ronald645@gmail.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-04-20mount.cifs: remove unnecessary getuid() check in libcap version of ↵Jeff Layton1-3/+0
toggle_dac_capability I'm not sure what I was thinking when I added that check in, but it's been there since the inception. We shouldn't care at all what the real uid is when we call toggle_dac_capability and indeed we don't care with the libcap-ng version. Remove that check. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-04-20mount.cifs: toggle_dac_capability() stores return codeLars Mueller1-1/+1
the build process of the cifs-utils for Mandriva 2011 made me notice of the unused variable rc in toggle_dac_capability() of mount.cifs.c. A bit up in the code we store the return value and do not make use of it while calling return. The attached patch intends to fix this. The failing build result is still visible at https://build.opensuse.org/package/live_build_log?arch=x86_64&package=cifs-utils&project=network%3Asamba%3ASTABLE&repository=Mandriva_2011 Acked-by: Suresh Jayaraman <sjayaraman@suse.com> Signed-off-by: Lars Mueller <lmuelle@suse.com>
2012-04-20cifs.upcall: missing prototype for krb5_auth_con_set_req_cksumtype in MITLars Mueller2-0/+11
krb5 < 1.7 products coming with MIT krb5 < 1.7 (like SUSE Linux Enterprise 11 SP 1 or SP 2) suffer from the same issue as described by https://bugzilla.samba.org/show_bug.cgi?id=6918 The declaration of krb5_auth_con_set_req_cksumtype is missing. Inspiration: https://bugzilla.samba.org/show_bug.cgi?id=6918 Acked-by: Suresh Jayaraman <sjayaraman@suse.com> Signed-off-by: Lars Mueller <lmuelle@suse.com>
2012-04-20mount.cifs: uninitialized variables in mount.cifsLars Mueller1-2/+2
older gcc versions (4.3 in the case of SUSE Linux Enterprise 11 SP 1 and SP 2) complain about uninitialized variables in the recent 5.4 release. The attached patch makes the build process a bit quieter. Acked-by: Suresh Jayaraman <sjayaraman@suse.com> Signed-off-by: Lars Mueller <lmuelle@suse.com>
2012-04-19mount.cifs: fix up some -D_FORTIFY_SOURCE=2 warningsJeff Layton3-8/+12
...and add -D_FORTIFY_SOURCE=2 to the default $CFLAGS. Acked-by: Acked-by: Suresh Jayaraman <sjayaraman@suse.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-04-19autoconf: set version to 5.4.1 for interim buildsJeff Layton1-1/+1
Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-04-18autoconf: set version to 5.4cifs-utils-5.4Jeff Layton1-1/+1
Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-04-18docs: update to project resources in READMEJeff Layton2-4/+6
...and add Igor Druzhinin and Pavel Shilovsky to AUTHORS. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-04-16automake: add -Werror to CFLAGSJeff Layton1-1/+1
With the recent patch to fix the warnings in asn1.c, cifs-utils now builds without any warnings. Ban them henceforth by adding -Werror for builds. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-04-15asn1: fix up some compiler warnings in asn1.cJeff Layton1-5/+10
These have been around for quite some time. gcc -DHAVE_CONFIG_H -I. -Wall -Wextra -g -O2 -MT asn1.o -MD -MP -MF .deps/asn1.Tpo -c -o asn1.o asn1.c asn1.c: In function ‘asn1_write’: asn1.c:45:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] asn1.c: In function ‘asn1_peek’: asn1.c:411:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] asn1.c: In function ‘asn1_tag_remaining’: asn1.c:541:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] asn1.c: In function ‘_ber_read_OID_String_impl’: asn1.c:570:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Almost all of these are due to the fact that asn1_data->ofs is a signed value, and ->length is unsigned. This should clear the way to add -Werror to the cflags in the near future. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-04-15autoconf: fix tests for wbclient to use pkgconfigJeff Layton3-52/+10
Use the pkgconfig file that's included with wbclient to perform the test for wbclient usability, and to set the correct CFLAGS and LDADD. This is particularly necessary on recent Fedora with samba4 since it puts the wbclient.h file in a different directory than before. Also, remove a redundant test for wbclient.h from configure.ac. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-04-02mount.cifs: don't allow unprivileged users to mount onto dirs to which theyJeff Layton3-20/+72
can't chdir If mount.cifs is installed as a setuid root program, then a user can use it to gather information about files and directories to which he does not have access. One of the first things that mount.cifs does is to chdir() into the mountpoint and then proceeds to perform the mount onto ".". A malicious user could exploit this fact to determine information about directories to which he does not have access. Specifically, whether the dentry in question is a file or directory and whether it exists at all. This patch fixes this by making the program switch the fsuid to the real uid for unprivileged users when mounting. Note that this is a behavior change. mount.cifs has in the past allowed users to mount onto any directory as long as it's listed in /etc/fstab as a user mount. With this change, the user must also be able to chdir into the mountpoint without needing special privileges. Hopefully not many people have such a pathological configuration. This patch should fix CVE-2012-1586. Reported-by: Jesus Olmos <jesus.olmos@blueliv.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-03-29cifs.upcall: use krb5_sname_to_principal to construct principal nameJeff Layton1-27/+20
Currently, we build the string by hand then then construct the principal name with krb5_parse_name. That bypasses the domain_realm section in krb5.conf however. Switch the code to use krb5_sname_to_principal instead which is more suited to this task. In order for that to work, we change a couple of calling functions to pass down a hostname instead of a principal name, and then pass in "cifs" as the service name. Reported-and-Tested-by: Nirupama Karandikar <nkarandi@redhat.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-03-06mount.cifs: add support for -s optionJeff Layton1-1/+9
autofs generally calls mount helpers with '-s'. Handle that the same way we do for NFS -- append ",sloppy" option to the mount options. The kernel can look for that option to decide whether to ignore unknown mount options, warn, or error out. Signed-off-by: Jeff Layton <jlayton@samba.org>