summaryrefslogtreecommitdiffstats
path: root/sys/fs/smbfs/smbfs_smb.c
Commit message (Collapse)AuthorAgeFilesLines
* Change the type of newsize argument in the smbfs_smb_setfsize() functionae2016-01-111-4/+4
| | | | | | | | | | | | | | from int to int64. MSDN says that SMB_SET_FILE_END_OF_FILE_INFO uses signed 64-bit integer to specify offset, but since smbfs_smb_setfsize() has used plain int, a value was truncated in case when offset was larger than 2G. https://msdn.microsoft.com/en-us/library/ff469975.aspx In particular, now `truncate -s 10G` will work correctly on the mounted SMB share. Reported and tested by: Eugene Grosbein <eugen at grosbein dot net> MFC after: 1 week
* Use SMB_QUERY_FS_SIZE_INFO request to populate statfs structure.ae2014-04-151-4/+59
| | | | | | | When server doesn't support this request, try to use SMB_INFO_ALLOCATION. And use SMB_COM_QUERY_INFORMATION_DISK request as fallback. MFC after: 2 weeks
* - Fix double frees/user after free.davide2013-07-031-113/+56
| | | | | | | - Allocate using smb_rq_alloc() instead of inlining it. Reported by: uqs Found with: Coverity Scan
* smbfs_lookup() in the DOTDOT case operates on dvp->n_parent withoutdavide2013-03-091-9/+3
| | | | | | | | | | proper locking. This doesn't prevent in any case reclaim of the vnode. Avoid this not going over-the-wire in this case and relying on subsequent smbfs_getattr() call to restore consistency. While I'm here, change a couple of SMBVDEBUG() in MPASS(). sbmfs_smb_lookup() doesn't and shouldn't know about '.' and '..' Reported by: pho's stress2 suite
* Fix panic due to page faults while in kernel mode, under conditions ofdavide2012-10-311-32/+97
| | | | | | | | | VM pressure. The reason is that in some codepaths pointers to stack variables were passed from one thread to another. In collaboration with: pho Reported by: pho's stress2 suite Sponsored by: iXsystems inc.
* - Remove the references to the deprecated zalloc kernel interfacedavide2012-10-251-6/+1
| | | | | | | | - Use M_ZERO flag in malloc() rather than bzero() - malloc() with M_NOWAIT can't return NULL so there's no need to check Reviewed by: alc Approved by: alc
* Add unicode support to msdosfs and smbfs; original pathes from imura,kevlo2011-11-181-9/+35
| | | | | | bug fixes by Kuan-Chung Chiu <buganini at gmail dot com>. Tested by me in production for several days at work.
* Make a comment more accurate.jonathan2011-07-071-1/+1
| | | | | | | | | This comment refers to CAP_NT_SMBS, which does not exist; it should refer to SMB_CAP_NT_SMBS. Fixing this comment makes it easier for people interested in Capsicum to grep around for capability rights, whose identifiers are of the form 'CAP_[A-Z_]'. Approved by: mentor (rwatson), re (Capsicum blanket) Sponsored by: Google Inc
* Switch to our preferred 2-clause BSD license.joel2010-04-071-6/+0
| | | | Approved by: bp
* Remove unused smbfs_smb_qpathinfo().trasz2010-01-081-110/+0
|
* Use pause() rather than tsleep() on stack variables and function pointers.jhb2007-02-271-1/+1
|
* Create a bidirectional mapping of the DOS 'read only' attributebp2006-11-051-2/+3
| | | | | | | | to the 'w' flag. PR: kern/77958 Submitted by: ghozzy gmail com MFC after: 1 month
* Fix interaction with Windows 2000/XP based servers:bp2005-11-221-1/+3
| | | | | | | | | | If the complete reply on the TRANS2_FIND_FIRST2 request fits exactly into one responce packet, then next call to TRANS2_FIND_NEXT2 will return zero entries and server will close current transaction. To avoid subsequent errors we should not perform FIND_CLOSE2 request. PR: kern/78953 Submitted by: Jim Carroll
* Make smbfs capable to use 16bit char set in filenames.takawata2005-05-041-2/+2
| | | | PR:78110
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-061-1/+1
|
* Convert to nmount. Add omount compat.phk2004-12-061-1/+1
| | | | Unpropagate the sm_args function into the runtime part.
* Fix an inverted test for NOPEN in the unused function smb_smb_flush().tjr2004-01-121-1/+1
|
* Send the close request to the SMB server in smbfs_inactive(), instead oftjr2003-06-171-1/+2
| | | | | | | | smbfs_close(). This fixes paging to and from mmap()'d regions of smbfs files after the descriptor has been closed, and makes thttpd, GNU ld, and perhaps more things work that depend on being able to do this. PR: 48291
* Back out M_* changes, per decision of the TRB.imp2003-02-191-3/+3
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-3/+3
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/schweikh2002-12-301-1/+1
| | | | Add FreeBSD Id tag where missing.
* Store a reference to the parent directory's vnode in struct smbnode,tjr2002-12-131-1/+2
| | | | | | not to the parent's smbnode, which may be freed during the lifetime of the child if the mount is forcibly unmounted. umount -f should now work properly (ie. not panic) on smbfs mounts.
* Cast a pointer to a uintptr_t to quiet a warning.jhb2002-11-071-1/+1
|
* Implement additional SMB calls to allow proper update of file size as somebp2002-09-181-2/+234
| | | | | | | | | | file servers fail to do it in the right way. New NFLUSHWIRE flag marks pending flush request(s). NB: not all cases covered by this commit. Obtained from: Darwin
* More s/file system/filesystem/gtrhodes2002-05-161-6/+6
|
* Update to C99, s/__FUNCTION__/__func__/,obrien2001-12-101-1/+1
| | | | also don't use ANSI string concatenation.
* Use proper endian conversion.bp2001-08-211-1/+1
| | | | | Obtained from: Mac OS X MFC after: 1 week
* Import kernel part of SMB/CIFS requester.bp2001-04-101-0/+1273
Add smbfs(CIFS) filesystem. Userland part will be in the ports tree for a while. Obtained from: smbfs-1.3.7-dev package.
OpenPOWER on IntegriCloud