summaryrefslogtreecommitdiff
path: root/source3/client/mount.cifs.c
AgeCommit message (Collapse)AuthorFilesLines
2009-05-14Maximum password length check too short in mount.cifsSteve French1-2/+2
Windows allows up to 127 byte passwords, and we using a 64 byte limit in most places and a 16 byte limit when using the "pass=" mount option Acked-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
2009-03-14Fix #3954Volker Lendecke1-1/+2
2009-02-24Fix guest mountsSteve French1-1/+3
guest session setup, login (user id) as anonymous. This patch is for samba bugzilla bug 4640. Signed-off-by: Shirish Pargaonkar <shirishp@us.ibm.com> Acked-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@samba.org>
2009-02-24s3:mount.cifs: make "mount.cifs -V" print the version, not usage.Michael Adam1-5/+28
Also make "mount.cifs -h" not exit with error exit code but with return code 0. Michael
2009-02-24s3:mount.cifs: don't error exit on explicitly requested help...Michael Adam1-2/+1
Michael
2009-02-06mount.cifs: initialize rc to 0 in mainJeff Layton1-1/+1
The value of rc in main() isn't initialized in the declaration. This wasn't a problem before, but Shirish's fakemount patch can make it so that we return the uninitialized variable if the -n flag is used. Fix this by initializing rc to 0. Signed-off-by: Jeff Layton <jlayton@redhat.com>
2009-02-06mount.cifs: add fakemount (-f) and nomtab (-n) flags to mount.cifsShirish Pargaonkar1-3/+9
...so that these options work correctly when passed in by mount(8).
2008-12-12mount.cifs: allow mounts to ipv6 capable serversJeff Layton1-101/+120
The current name resolution scheme in mount.cifs is IPv4 only. Expand it to be protocol-independent. Also take advantage of the fact that getaddrinfo() returns a list of addresses and have mount.cifs try each in turn until it hits one that's reachable and allows the socket to connect. Signed-off-by: Jeff Layton <jlayton@redhat.com>
2008-12-05mount.cifs: if mount user not specified use USER environment variableSteve French1-1/+7
smbfs also would use the USER environment variable if the user was not specified on the mount command and no credential file specified, and mount.cifs man page says that we will use this environment variable (in most cases this will not cause a behavior change, because we were doing getuid of the current process which will usually be the same name). Fixes Samba bug #5934 Acked-by: Jeff Layton
2008-11-06mount.cifs: use lock/unlock_mtab scheme from util-linux-ng mount progJeff Layton1-48/+49
The util-linux-ng sources have a good, but rather complex scheme for locking the mtab before updating it. Mount helpers need to follow the same scheme. Advisory locking only works if everyone is using the same locking scheme. Copy the routines we need from util-linux-ng into a separate source file and then have mount.cifs and umount.cifs link in this object. The long term goal is to have these routines in a separate helper library (libmount). Mount helpers can then dynamically link in that lib. Until that happens, this should serve as a suitable stopgap solution. Signed-off-by: Jeff Layton <jlayton@redhat.com>
2008-10-29Fix CID: 456 - resource leak on function exit.Jeremy Allison1-0/+13
Jeremy.
2008-10-09mount.cifs: make return codes match the return codes for /bin/mount (try #3)Jeff Layton1-36/+46
The manpage for /bin/mount specifies that the return code should be a positive integer (actually, it's a bitfield). Clean up the return codes from mount.cifs to make them match the expected return values from /bin/mount. This necessary for proper integration with autofs. This is the third attempt at this patch. The changes here are minor, just changing some return's from main() into exit() calls for consistency's sake. Signed-off-by: Jeff Layton <jlayton@redhat.com>
2008-10-09mount.cifs: have uppercase_string return success on NULL pointerJeff Layton1-2/+2
We currently don't attempt to uppercase the device portion of the mount string if there isn't a prefixpath. Fix that by making uppercase_string return success without doing anything on a NULL pointer. Signed-off-by: Jeff Layton <jlayton@redhat.com>
2008-09-21Attempt to fix bug 5778Volker Lendecke1-0/+10
Jeff, Steve, please check!
2008-09-12mount.cifs: make local versions of strlcat and strlcpy staticJeff Layton1-2/+2
...to silence -Wmissing-prototypes Signed-off-by: Jeff Layton <jlayton@redhat.com> (This used to be commit fc7c71f15b39158ac58beaa90cc9038db680b8cb)
2008-08-27mount.cifs: unclear error message with "credentials"Steve French1-2/+3
Thanks to Christophe Curis for the suggestion (This used to be commit 3b5ad9190d2ad6d2ca0a569194bdff9003bda13b)
2008-08-21mount.cifs: don't prompt for password on krb5 mountsJeff Layton1-1/+2
krb5 mounts require that the user already have a valid krb5 ticket. Since we can't currently use the password entered, don't prompt for it. Also, switch to using strncmp instead of strcmp here. Signed-off-by: Jeff Layton <jlayton@redhat.com> (This used to be commit c75791c34abebe23c6f6a5534b0358514ec4eabc)
2008-08-05Backing out most of changeset 5222b8db3fb692e5071bfd1b41849a8eb0a17995Steve French1-2/+5
(so parsing for domain parameter in mount.cifs matches online help) and rephrasing original code to make it more clear. The check for "domain" was meant to allow for "dom" or "DOM" and the option ("dom") described in the help (e.g. "/sbin/mount.cifs -?") is the shorter ("dom") form. The reason that the string we compare against is larger was to improve readability (we could compare against "dom" but note /* "domain" or "DOMAIN" or "dom" or "DOM" */ but it seemed terser to just show the larger string in the strcmp target. The change to "workgoup" from workg* (anything which begins with "workg" doesn't matter - it is a minor behavior change - but probably few scripts depend on the "alias" for this option). Rework code so that it is clearer what we are comparing against. (This used to be commit 92fad0fc537e75c726d5d6794dd0c4fd61edca2d)
2008-07-02Fix bug #5578, reported by sendel2000@hotbox.ru. Bad (non-Samba) use of ↵Jeremy Allison1-0/+3
strlcat gives error. Jeremy. (This used to be commit d7c82997bdcf1acd7ac104efa0ad05e0b94935ea)
2008-06-27Fix two IBM checker warningsVolker Lendecke1-2/+2
Steve, please check! Thanks, Volker (This used to be commit 5222b8db3fb692e5071bfd1b41849a8eb0a17995)
2008-05-01Tidyup to ensure '\n' is treated identically in allJeremy Allison1-0/+2
cases. Jeremy. (This used to be commit 818fbc9889af8c9fb6e7978e8ed2269a78f14404)
2008-05-01Fix bug #5434 found by Ted Percival <ted@midg3t.net>.Jeremy Allison1-0/+2
Introduced by me in the strlcpy cleanup. Ensure the loaded password doesn't contain the '\n' at the end. Jeremy. (This used to be commit 41984743d9e89b6568119832c35ee4c0024e43a2)
2008-04-25Sync up client/mount.cifs.c with v3-2-test.Jeremy Allison1-25/+4
Jeremy. (This used to be commit 7a724d78e11f016f154c0029dc394ce133f41110)
2008-04-25mount.cifs: Zero mountpassword content before freeing.Karolin Seeger1-3/+24
Karolin (This used to be commit d99a31848bd2172c15500dd61ce30fef963c1ac6)
2008-04-24Make mount.cifs.c consistent with other Samba code usage w.r.tJeremy Allison1-69/+54
SAFE_FREE. Use #define constants not arbitrary numbers. Stevef please check. Karolyn, once Steve has checked please pull for 3.2-stable. Jeremy. (This used to be commit cc23f91d639db61903bf8b6c9fa46ec9c1f44178)
2008-03-31mount.cifs: fix several problems when mounting subdirectories of shares (try 2)Jeff Layton1-24/+66
This patch is the second patch to attempt to fix up some of the problems with mounting subdirectories of shares. The earlier patch didn't handle this correctly when POSIX extensions were enabled. This one does. This is a bit of a confusing area since the different components of a service string have different rules: 1) hostname: no '/' (slash) or '\' (backslash) is allowed to be embedded within the string 2) sharename: same rules as hostname 3) prefixpath: '\' *is* allowed to be embedded in a path component, iff POSIX extensions are enabled. Otherwise, neither character is allowed. The idea here is to allow either character to act as a delimiter when we know that the character can't be anything but a delimiter (namely everywhere up to the start of the prefixpath). The patch will convert any '\' unconditionally to '/' in the UNC portion of the string. However, inside the prefixpath, we can't make assumptions about what constitutes a delimiter because POSIX allows for embedded '\' characters. So there we don't attempt to do any conversion, and pass the prefixpath to the kernel as is. Once the kernel determines whether POSIX extensions are enabled, it can then convert the path if needed and it's able to do so. A patch to handle this has already been committed to the cifs-2.6 git tree. This patch also fixes an annoyance. When you mount a subdir of a share, mount.cifs munges the device string so that you can't tell what the prefixpath is. So if I mount: //server/share/p1/p2/p3 ..then /proc/mounts and mtab will show only: //server/share Finally, it also tries to apply some consistent rules to the uppercasing of strings. Signed-off-by: Jeff Layton <jlayton@redhat.com> (This used to be commit e03d1dfdb80333c071b600245eb749ef5664aa22)
2008-02-25Do the formatting change in all 3 places :-)Volker Lendecke1-3/+7
(This used to be commit d32066eaef1d09ec41fd5365e18eacd93e485d53)
2008-02-25Fix confusing error message -- bug 5252Volker Lendecke1-3/+5
Thanks to Walter Franzini (This used to be commit 19de47fef1b35c47885acc40760a232e4643079c)
2008-02-22Make sure mount.cifs.c compiles on Fedora 9 with gcc 4.3Simo Sorce1-0/+1
(This used to be commit ce57d388251063c22f89680e9d1c2129d9879975)
2008-02-14Revert "Merge in J.Layton patch and resolve conflict."Simo Sorce1-64/+26
This reverts commit 6b1a118eaaab405eeef0cf3c0488a2747af562ba. We found that this patch does not play well with currently released cifs.ko code, so after discussions with Jeff Layton and Steve french we decided it is best to back it off and re-think a better approach. Jeff will send new patches later, but for now it is better to just revert to the previous code (This used to be commit c5b7d538ecfa93377ff20704633ac57dbf8dd530)
2008-01-03Update mount.cifs helpSteve French1-3/+5
Steve (This used to be commit b9d2da4d10e6e7ac2dc604565c7f2ce39d0916b5)
2007-12-17Merge in J.Layton patch and resolve conflict.Simo Sorce1-26/+64
(This used to be commit 6b1a118eaaab405eeef0cf3c0488a2747af562ba)
2007-12-13We don't need to call endpwent if we never call getpwent.Jeremy Allison1-2/+0
Jeremy. (This used to be commit 27078d1292e8588956ae78e4cddb1bcebbe84478)
2007-12-13Add a varient of Steve Langasek <vorlon@debian.org> patchJeremy Allison1-10/+59
for bug #4780. Cause user mounts to inherit uid= and gid= from the calling user when called as non-root, except when overridden on the commandline. Jeremy. (This used to be commit 7fad5f38ea86ef76dc8e0853926b3248230616be)
2007-12-12Missed one strcpy call.Jeremy Allison1-1/+1
Jeremy. (This used to be commit b215fb1ad0d5bb3fa7084c2773845ce1dffb2173)
2007-12-12Add a portable version of strlcpy and strlcat and convertJeremy Allison1-36/+70
all strncpy/strcat calls to them. Convert all sprintf calls to snprintf. Safety first ! Jeremy. (This used to be commit eff2b368e891d523de38b43ced95798b74ae101e)
2007-10-18RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison1-0/+0
bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
2007-10-10[GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.Gerald (Jerry) Carter1-1/+1
(This used to be commit 5c6c8e1fe93f340005110a7833946191659d88ab)
2007-10-10r25355: IP address parsing did not allow for fully expanded ipv6 addressesSteve French1-1/+1
(which can be 12 bytes longer than we were allowing for). Thanks to Dr. David Holder (This used to be commit 0202a84e3f61665953bd5207218063b0d5ff6088)
2007-10-10r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell1-2/+1
(This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)
2007-10-10r23779: Change from v2 or later to v3 or later.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
2007-10-10r22982: Do not prompt for password on sec=none for mount.cifs (and allow guestSteve French1-2/+5
option to pass to kernel code so it can know when to retry) (This used to be commit 500d9236c419be6ec32cc209279aeea2234f1a21)
2007-10-10r22979: Revert previous checkin (which had some debug junk) and fix misc ↵Steve French1-68/+25
frees that valgrind noticed (This used to be commit c8aa60692ba23c43820b820db3371a86dfbf40b5)
2007-10-10r22779: Patch for not prompting for password on cifs mounts when "sec=none"Steve French1-10/+61
specified (This used to be commit 9af97d8ead85c05d08ee24727525894df5866630)
2007-10-10r22560: Clean up frees of realloc memory in mount.cifs (thanks to Alex forSteve French1-6/+6
reminding me how to use Valgrind). (This used to be commit 4616c29b9f09b9863f1446e83c98e3adc327d0f9)
2007-10-10r22526: Support deep tree mounts after share (instead of having to specifySteve French1-0/+10
prepath) (This used to be commit 0548dea6c7222dc22144a86fffd32675cd14b677)
2007-10-10r21840: mount.cifs compile on old libc missing bind mount #defineSteve French1-0/+4
Thanks to Thomas Jarosch for pointing this out. (This used to be commit bd9439cc7d80e172feab72229b553028e134de05)
2007-10-10r17605: Some C++ warningsVolker Lendecke1-15/+15
(This used to be commit 05268d7a731861b10ce8556fd32a004808383923)
2007-10-10r16945: Sync trunk -> 3.0 for 3.0.24 code. Still needJeremy Allison1-0/+10
to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8)
2007-10-10r16360: Fix Klocwork ID 136 520 521 522 523 542 574 575 576 607Volker Lendecke1-0/+5
in net_rpc.c: 715 716 732 734 735 736 737 738 739 749 in net_rpc_audit.c: 754 755 756 in net_rpc_join.c: 757 in net_rpc_registry: 766 767 in net_rpc_samsync.c: 771 773 in net_sam.c: 797 798 Volker (This used to be commit 3df0bf7d6050fd7c9ace72487d4f74d92e30a584)