summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
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>
2012-02-23mount.cifs: fix tests for strtoul successJeff Layton1-5/+7
The current test just looks to see if errno was 0 after the conversion but we need to do a bit more. According to the strtoul manpage: If there were no digits at all, strtoul() stores the original value of nptr in *endptr (and returns 0). So, if you pass in a string of letters, strtoul will return 0, but won't actually have converted anything. Luckily, in most cases, /bin/mount papers over this bug by doing uid/gid conversions itself before calling mount.cifs. Fix this by also checking to ensure that strtoul() converted the entire string in addition to checking that it didn't set errno. While we're at it, fix the test in backupuid/backupgid options as well which don't currently check whether errno got set. Reported-by: Kyle Squizzato <ksquizza@redhat.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-02-20manpage: update wsize= entry to account for change in default wsizeJeff Layton1-1/+3
Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-02-12cifs-utils: allow specifying rootsbindir at configure timeJeff Layton2-2/+10
...via the $ROOTSBINDIR environment variable, and AC_ARG_VAR macro. The default is to use /sbin for this value, which only currently affects the installation location of mount.cifs. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-02-12autoconf: set release to 5.3.1 for interim buildsJeff Layton0-0/+0
Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-02-12autoconf: set release to 5.3.1 for interim buildsJeff Layton1-1/+1
Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-28autoconf: set version to 5.3cifs-utils-5.3Jeff Layton1-1/+1
...and fix the URL for cifs-utils. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-24cifscreds: build it by defaultJeff Layton1-5/+13
...but either error out or disable it if keyutils.h isn't present. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-24cifscreds: add a manpageJeff Layton3-0/+281
...I'm also including the POD sources here for easier editing, but we may remove them in the future if it becomes burdensome to keep up 2 copies. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17cifscreds: change prefix on keys to "cifs:" instead of "cifscreds:"Jeff Layton1-6/+7
The "creds" portion seems redundant. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17cifscreds: make key_search use keyctl_searchJeff Layton1-45/+1
...which is much more efficient than walking the keyring by hand. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17cifscreds: make cifscreds use the "logon" key_typeJeff Layton1-5/+5
...and have it loosen the permissions to allow searching. There seems to be no clear way to make user keys unreadable, but still allow for them to be searched, so we'll need a new key_type that doesn't allow you to read the payload from userspace. That will be proposed in a separate kernel patch. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17cifscreds: use the session keyringJeff Layton1-1/+1
This seems like a reasonable change, but I'm willing to listen to arguments to the contrary... cifscreds currently hangs the keys off of the uid keyring. It seems more appropriate though that we require that each session have its own set. This might be particularly important in a containerized situation. If a user authenticates in one container, then we probably don't want to allow a user in another to "borrow" those creds. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17cifscreds: loosen allowed characters in domain namesJeff Layton1-5/+8
As Donald points out, NetBIOS domains are allowed more characters than the code currently allows. Change the test to one that checks for disallowed characters instead. Also, I can't find anything that says that '@' is not allowed in a username. Might as well allow that too. Worst case, the server will reject the username. Reported-by: Donald R. Gray Jr <donald.r.gray@gmail.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17cifscreds: add --domain flagJeff Layton1-20/+44
...to indicate that the first argument is not a hostname but an NT domain name. If it's set, then treat the argument as a string literal. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17cifscreds: make username parameter optionalJeff Layton1-11/+28
...and use getopt_long to get it. If someone doesn't specify the username, use getusername() to get it. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17cifscreds: move option parsing into main()Jeff Layton1-32/+44
Having to parse options in every command routine is cumbersome and restrictive. Declare a struct to hold arguments, and then have the functions take that struct as an argument. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17cifscreds: make usage use "return" and have callers returnJeff Layton1-10/+11
...banish the use of exit(), which may be helpful in the future in the event that we eventually move some of this code into a library. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17cifscreds: make username part of value instead of descriptionJeff Layton1-19/+11
Change the payload to be "username:password". Since usernames can't contain ':', this is suitable delimiter. Also, create_description is just a sprintf now, so eliminate it. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17cifscreds: remove user parameter from create_descriptionJeff Layton1-8/+8
The username should be part of the key payload and not part of the description. Also, prefix the address with an "a:" in the description. Eventually we'll also need a "domain" key variant. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17cifscreds: eliminate domain parm from most functionsJeff Layton1-67/+18
Eventually we'll add this back in a different way. The domain and address should be exclusive of one another. IOW, we want the kernel to be able to find credentials for a specific address or for the domain of which the server is a member. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17cifscreds: add unused attribute to argv parm in cifscreds_clearallJeff Layton1-1/+1
...to eliminate this warning: cifscreds.c: In function ‘cifscreds_clearall’: cifscreds.c:422:47: warning: unused parameter ‘argv’ Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17util: move getusername to util.cJeff Layton3-11/+14
Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-16mount.cifs: handle errors from rename() in del_mtabJeff Layton1-1/+5
The new del_mtab code ignored errors from rename(). Make it handle that error as well like it does other errors. Cc: Carlos Maiolino <cmaiolino@redhat.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-16mount.cifs: Properly update mtab during remountCarlos Maiolino1-1/+98
During a remount of a cifs filesystem, the mtab file is not properly updated, which leads to a doubled entry of the same filesystem in the /etc/mtab file. This patch adds a new function del_mtab() which is called before the add_mtab() in case the fs is being remounted. The del_mtab() function will delete from the mtab, the old entry from the filesystem which is being remounted, and then, calls add_mtab() to add an updated entry to the mtab file. Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
2012-01-16cifs.upcall: allow admins to specify an alternate krb5.conf fileJeff Layton2-4/+17
This was actually requested by the Red Hat QA group, who sometimes work with multiple krb5.conf files when testing. Requested-by: Marko Myllynen <myllynen@redhat.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-10get/setcifsacl: don't link in -lkeyutilsJeff Layton1-2/+2
These binaries don't use keys API at all. There's no need to link in the keys library. Reported-by: Frédéric L. W. Meunier <fredlwm@fredlwm.net> Signed-off-by: Jeff Layton <jlayton@samba.org> Acked-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
2011-12-10contrib: add a set of sample /etc/request-key.d filesJeff Layton8-1/+22
Add a contrib directory, a set of sample /etc/request-key.d files and a README that explains what they're for. This version sets the path to the upcall programs based on the configure options. Signed-off-by: Jeff Layton <jlayton@samba.org>
2011-12-09autoconf: bump release to 5.2.1 for interim buildsJeff Layton1-1/+1
Signed-off-by: Jeff Layton <jlayton@samba.org>
2011-12-09autoconf: set version to 5.2cifs-utils-5.2Jeff Layton1-1/+1
Signed-off-by: Jeff Layton <jlayton@samba.org>