aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/netmisc.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-09-08cifs: prevent possible memory corruption in cifs_demultiplex_threadJeff Layton1-9/+13
cifs_demultiplex_thread sets the addr.sockAddr.sin_port without any regard for the socket family. While it may be that the error in question here never occurs on an IPv6 socket, it's probably best to be safe and set the port properly if it ever does. Break the port setting code out of cifs_fill_sockaddr and into a new function, and call that from cifs_demultiplex_thread. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
2010-08-05CIFS: Make cifs_convert_address() take a const src pointer and a lengthDavid Howells1-21/+24
Make cifs_convert_address() take a const src pointer and a length so that all the strlen() calls in their can be cut out and to make it unnecessary to modify the src string. Also return the data length from dns_resolve_server_name_to_ip() so that a strlen() can be cut out of cifs_compose_mount_options() too. Acked-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
2010-08-02cifs: map NT_STATUS_ERROR_WRITE_PROTECTED to -EROFSJeff Layton1-0/+1
Seems like a more sensible mapping than -EIO. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
2010-08-02cifs: set the port in sockaddr in a more clearly defined fashionJeff Layton1-1/+22
This patch should replace the patch I sent a couple of weeks ago to set the port in cifs_convert_address. Currently we set this in cifs_find_tcp_session, but that's more of a side effect than anything. Add a new function called cifs_fill_sockaddr. Have it call cifs_convert_address and then set the port. This also allows us to skip passing in the port as a separate parm to cifs_find_tcp_session. Also, change cifs_convert_address take a struct sockaddr * rather than void * to make it clearer how this function should be called. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
2010-04-21[CIFS] Neaten cERROR and cFYI macros, reduce text spaceJoe Perches1-8/+8
Neaten cERROR and cFYI macros, reduce text space ~2.5K Convert '__FILE__ ": " fmt' to '"%s: " fmt', __FILE__' to save text space Surround macros with do {} while Add parentheses to macros Make statement expression macro from macro with assign Remove now unnecessary parentheses from cFYI and cERROR uses defconfig with CIFS support old $ size fs/cifs/built-in.o text data bss dec hex filename 156012 1760 148 157920 268e0 fs/cifs/built-in.o defconfig with CIFS support old $ size fs/cifs/built-in.o text data bss dec hex filename 153508 1760 148 155416 25f18 fs/cifs/built-in.o allyesconfig old: $ size fs/cifs/built-in.o text data bss dec hex filename 309138 3864 74824 387826 5eaf2 fs/cifs/built-in.o allyesconfig new $ size fs/cifs/built-in.o text data bss dec hex filename 305655 3864 74824 384343 5dd57 fs/cifs/built-in.o Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
2009-06-25cifs: have cifs parse scope_id out of IPv6 addresses and use itJeff Layton1-5/+27
This patch has CIFS look for a '%' in an IPv6 address. If one is present then it will try to treat that value as a numeric interface index suitable for stuffing into the sin6_scope_id field. This should allow people to mount servers on IPv6 link-local addresses. Signed-off-by: Jeff Layton <jlayton@redhat.com> Acked-by: David Holder <david@erion.co.uk> Signed-off-by: Steve French <sfrench@us.ibm.com>
2009-06-15[CIFS] Fix build breakSteve French1-1/+1
Signed-off-by: Steve French <sfrench@us.ibm.com>
2009-06-13cifs: add new routine for converting AF_INET and AF_INET6 addrsJeff Layton1-4/+30
...to consolidate some logic used in more than one place. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
2009-05-28cifs: make cnvrtDosUnixTm take a little-endian args and an offsetJeff Layton1-8/+4
The callers primarily end up converting the args from le anyway. Also, most of the callers end up needing to add an offset to the result. The exception to these rules is cnvrtDosCifsTm, but there are no callers of that function, so we might as well remove it. Signed-off-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Steve French <sfrench@us.ibm.com>
2009-05-28cifs: have cifs_NTtimeToUnix take a little-endian argJeff Layton1-6/+6
...and just have the function call le64_to_cpu. Signed-off-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Steve French <sfrench@us.ibm.com>
2009-04-30[CIFS] Remove unneeded QuerySymlink call and fix mapping for unmapped statusSteve French1-0/+2
Signed-off-by: Steve French <sfrench@us.ibm.com>
2008-05-13[CIFS] cleanup old checkpatch warningsSteve French1-3/+3
Signed-off-by: Steve French <sfrench@us.ibm.com>
2008-05-08[CIFS] Fixed build warning in is_ipIgor Mammedov1-31/+1
Signed-off-by: Igor Mammedov <niallain@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
2008-02-12[CIFS] clean up some hard to read ifdefsSteve French1-6/+2
Christoph had noticed too many ifdefs in the CIFS code making it hard to read. This patch removes about a quarter of them from the C files in cifs by improving a few key ifdefs in the .h files. Signed-off-by: Steve French <sfrench@us.ibm.com>
2008-02-07[CIFS] reduce checkpatch warningsSteve French1-6/+9
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-11-05[CIFS] Fix walking out end of cifs daclSteve French1-1/+1
Acked-by: Shirish Pargaonkar <shirishp@us.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-11-01[CIFS] when mount helper missing fix slash wrong direction in shareSteve French1-5/+35
Kernel bugzilla bug #9228 If mount helper (mount.cifs) missing, mounts with form like //10.11.12.13/c$ would not work (only mounts with slash e.g. //10.11.12.13\\c$ would work) due to problem with slash supposed to be converted to backslash by the mount helper (which is not there). If we fail on converting an IPv4 address in in4_pton then try to canonicalize the first slash (ie between sharename and host ip address) if necessary. If we have to retry to check for IPv6 address the slash is already converted if necessary. Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-25[CIFS] acl support part 6Steve French1-6/+6
Acked-by: Shirish Pargaonkar <shirishp@us.ibm.com> CC: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-18[CIFS] log better errors on failed mountsSteve French1-10/+18
Also returns more accurate errors to mount for the cases of account expired and password expired Acked-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-17[CIFS] Fix minor problems noticed by scanSteve French1-1/+4
Coverity scan pointed out some minor possible errors. Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-07-17[CIFS] More whitespace/formatting fixes (noticed by checkpatch)Steve French1-2/+4
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-07-15[CIFS] Fix build break - inet.h not included when experimental ifdef offSteve French1-2/+0
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-07-13[CIFS] whitespace/formatting fixesSteve French1-1/+1
This should be the last big batch of whitespace/formatting fixes. checkpatch warnings for the cifs directory are down about 90% and many of the remaining ones are harder to remove or make the code harder to read. Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-07-10[CIFS] whitespace cleanupSteve French1-1/+1
More than halfway there Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-07-08[CIFS] more whitespace fixesSteve French1-40/+42
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-07-07[CIFS] more whitespace cleanupSteve French1-9/+9
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-07-06[CIFS] ipv6 support no longer experimentalJeff1-61/+0
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-04-25[CIFS] Add IPv6 supportSteve French1-2/+22
IPv6 support was started a few years ago in the cifs client, but lacked a kernel helper function for parsing the ascii form of the ipv6 address. Now that that is added (and now IPv6 is the default that some OS use now) it was fairly easy to finish the cifs ipv6 support. This requires that CIFS_EXPERIMENTAL be enabled and (at least until the mount.cifs module is modified to use a new ipv6 friendly call instead of gethostbyname) and the ipv6 address be passed on the mount as "ip=" mount option. Thanks Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-10-12[CIFS] Fix old DOS time conversion to handle timezoneSteve French1-1/+1
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-10-11[CIFS] Do not need to adjust for Jan/Feb for leap daySteve French1-1/+2
calculation in 2100 (year divisible by 100) Signed-off-by: Yehuda Sadeh Weinraub <Yehuda.Sadeh@expand.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-10-11[CIFS] Fix leaps year calculation for years after 2100Steve French1-0/+9
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-10-06[CIFS] readdir (ffirst) enablement of accurate timestamps from legacy serversSteve French1-21/+18
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-09-28[CIFS] Legacy time handling for Win9x and OS/2 part 1Steve French1-0/+51
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-08-11[CIFS]Jeremy Allison1-0/+1
Allow Windows blocking locks to be cancelled via a CANCEL_LOCK call. TODO - restrict this to servers that support NT_STATUS codes (Win9x will probably not support this call). Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Steve French <sfrench@us.ibm.com> (cherry picked from 570d4d2d895569825d0d017d4e76b51138f68864 commit)
2006-06-02[CIFS] Fix mapping of old SMB return code Invalid Net Name so it isSteve French1-1/+1
recognized on mount the old mapping of this was to ENODEV (instead of ENXIO) - but ENODEV is what mount returns when the cifs driver will not load so change this to map to ENXIO (which was what the equivalent condition returned for mapping errors from more modern servers) Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-06-01[CIFS] Support for setting up SMB sessions to legacy lanman servers part 2Steve French1-1/+1
2005-11-29[CIFS] Fix umount --force to wake up the pending response queue, not justSteve French1-2/+2
the request queue. Also periodically wakeup response_q so threads can check if stuck requests have timed out. Workaround Windows server illegal smb length on transact2 findfirst response. Signed-off-by: Steve French <sfrench@us.ibm.com>
2005-10-11[CIFS] CIFS Stats improvementsSteve French1-1/+1
New cifs_writepages routine was not updated bytes written in cifs stats. Also added ability to clear /proc/fs/cifs/Stats by writing (0 or 1) to it. Signed-off-by: Steve French <sfrench@us.ibm.com>
2005-09-22[CIFS] Various minor bigendian fixes and sparse level 2 warning message fixesSteve French1-1/+8
Most important of these fixes mapchars on bigendian and a few statfs fields Signed-off-by: Shaggy (shaggy@austin.ibm.com) Signed-off-by: Steve French (sfrench@us.ibm.com)
2005-09-21[CIFS] Add support for legacy servers part nine. statfs (df and du) is nowSteve French1-1/+1
functional, and the length check is fixed so readdir does not throw a warning message when windows me messes up the response to FindFirst of an empty dir (with only . and ..). Signed-off-by: Steve French (sfrench@us.ibm.com)
2005-06-02[CIFS] fs/cifs/netmisc.c: fix sparse warningAlexey Dobriyan1-3/+1
Signed-off-by: Steve French <sfrench@us.ibm.com> Signed-off-by: Alexey Dobriyan <adobriyan@mail.ru> Signed-off-by: Domen Puncer <domen@coderock.org>
2005-04-28[PATCH] cifs: Fix mapping of EMLINK caseSteve French1-1/+2
Signed-off-by: Steve French (sfrench@us.ibm.com) Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-28[PATCH] cifs: Gracefully turn off serverino (when serverino is enabled on mount)Steve French1-1/+1
Old servers such as NT4 do not support this level of FindFirst (and retry with a lower infolevel) Signed-off-by: Steve French (sfrench@us.ibm.com) Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-16Linux-2.6.12-rc2Linus Torvalds1-0/+904
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!