summaryrefslogtreecommitdiffstats
path: root/source/smbd/filename.c
Commit message (Collapse)AuthorAgeFilesLines
* Add const.Andrew Bartlett2003-03-171-3/+3
|
* make sure we don't run over the end of 'name' in unix_convert()Andrew Tridgell2003-02-071-7/+15
| | | | Thanks to Andrew Bartlett for spotting this.
* BIG patch...Andrew Bartlett2003-01-021-3/+3
| | | | | | | | | | | | | | | | This patch makes Samba compile cleanly with -Wwrite-strings. - That is, all string literals are marked as 'const'. These strings are always read only, this just marks them as such for passing to other functions. What is most supprising is that I didn't need to change more than a few lines of code (all in 'net', which got a small cleanup of net.h and extern variables). The rest is just adding a lot of 'const'. As far as I can tell, I have not added any new warnings - apart from making all of tdbutil.c's function const (so they warn for adding that const string to struct). Andrew Bartlett
* Turns out with Win9x, we could occasionally return from unix_convert() givenJeremy Allison2002-10-111-0/+12
| | | | | | | | | a mangled name without a valid stat struct if the file existed. This would then cause open_file_shared1() to erroneously think the file open was new, thus not check for oplock break, thus causing a spurious EAGAIN reply to the open on a file we already had kernel oplocked.... (phew - that was fun to track down :-). Jeremy.
* disable stat cache when case sensitiveAndrew Tridgell2002-09-171-1/+1
|
* Make 'remote_machine' private to lib/substitute.c, and fix all the user to useAndrew Bartlett2002-08-111-1/+0
| | | | | | the new accessor functions. Andrew Bartlett
* Veto files fix.Jeremy Allison2002-06-131-275/+273
| | | | Jeremy.
* Merge in mangle fixes from 2.2.Jeremy Allison2002-06-131-88/+90
| | | | Jeremy.
* Removed lp_strip_dot code - ensured that mangling code treats names endingJeremy Allison2002-05-141-28/+6
| | | | | | in '.' as invalid long filenames (special treatment for '.' and '..' which are valid - yes Andrew I did this without strlen :-) :-). Jeremy.
* This split the mangling code up to allow for the possibility of multipleAndrew Tridgell2002-04-111-31/+15
| | | | | | mangling implementation, selectable using "mangling method = " in smb.conf It also tidies the interface a little, although it is still nasty.
* Reintroduce the 2.2 name mangling code, until we get are more flexible solution.Andrew Bartlett2002-04-081-1/+14
| | | | | | | Even for a hash/cache setup, this code needs some more work, in particular it needs to use mangle_get_prefix() etc and to move to unicode internals. Andrew Bartlett
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* Fixed the bug with descending into mangled directories.Jeremy Allison2001-12-181-5/+8
| | | | | | | | The problem is that name_map_mangle can *change* the length of a patchname. Ensure that all the character pointer messing about can cope with changing sizes of components. This code is too ugly to live..... This also needs *lots* of testing. Jeremy.
* change some more functions to the new mangle interface.Simo Sorce2001-10-291-9/+11
|
* Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter2001-10-021-1/+0
|
* - don't try to print pointersAndrew Tridgell2001-07-251-11/+0
| | | | - removed some unused mangling code
* strchr and strrchr are macros when compiling with optimisation in gcc, so we ↵Andrew Tridgell2001-07-041-3/+3
| | | | can't redefine them. damn.
* The big character set handling changeover!Andrew Tridgell2001-07-041-1/+1
| | | | | | | This commit gets rid of all our old codepage handling and replaces it with iconv. All internal strings in Samba are now in "unix" charset, which may be multi-byte. See internals.doc and my posting to samba-technical for a more complete explanation.
* Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMRJeremy Allison2001-03-111-5/+0
| | | | | | RPC code to merge with new passdb code. Currently rpcclient doesn't compile. I'm working on it... Jeremy.
* Sorry Gerald, I think the original code was better (plus safer as I'm sureJeremy Allison2000-12-121-7/+10
| | | | | it's working :-). Jeremy.
* subtle bug where files which missed the stat_cache but were addedGerald Carter2000-12-111-10/+7
| | | | | | | | | | | | to the cache during the look returned a blank stat struct. Made weird occurrences such as... $ smbclient //pogo/print$ smb:\ > cd w32x86 ERROR: Invalid path smb:\ > cd w32x86 smb:\w32x86\ >
* Fixed *very* subtle statcache bug where invalid stat state could beJeremy Allison2000-12-081-1/+2
| | | | | | being used if last component lookup failed, but was found in the directory scan. Jeremy.
* Ok - this is a big patch - and it may break smbd a bit (althoughJeremy Allison2000-10-191-40/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | I hope not). If you encounter strange file-serving behavior after this patch then back it out. I analysed our stat() usage and realised we were doing approx. 3 stat calls per open, and 2 per getattr/setattr. This patch should fix all that. It causes the stat struct returned from unix_convert() (which now *must* be passed a valid SMB_STRUCT_STAT pointer) to be passed through into the open code. This should prevent the multiple stats that were being done so as not to violate layer encapsulation in the API's. Herb - if you could run a NetBench test with this code and do a padc/par syscall test and also run with the current 2.2.0 code and test the padc/par syscalls I'd appreciate it - you should find the number of stat calls reduced - not sure by how much. The patch depends on unix_convert() actually finding the file and returning a stat struct, or returning a zero'd out stat struct if the file didn't exist. I believe we can guarentee this to be the case - I just wasn't confident enough to make this an assertion before. Ok ok - I did write this whilst at the Miami conference..... sometimes you get a little free time at these things :-). Jeremy.
* Restructuring of vfs layer to include a "this" pointer - can be an fsp orJeremy Allison2000-10-061-3/+3
| | | | | | | | | | | | | | | a conn struct depending on the call. We need this to have a clean NT ACL call interface. This will break any existing VFS libraries (that's why this is pre-release code). Andrew gets credit for this one :-) :-). In addition - added Herb's WITH_PROFILE changes - Herb - please examine the changes I've made to the smbd/reply.c code you added. The original code was very ugly and I have replaced it with a START_PROFILE(x)/END_PROFILE(x) pair using the preprocessor. Please check this compiles ok with the --with-profile switch. Jeremy.
* Restructuring of the code to remove dos_ChDir/dos_GetWd and re-vector themJeremy Allison2000-09-271-1/+1
| | | | | | | through the VFS. All file access/directory access code in smbd should now go via the vfs. Added vfs_chown/vfs_chmod calls. Still looking at vfs_get_nt_acl() vfs_set_nt_acl() call API design. Jeremy.
* more merging voodooAndrew Tridgell2000-05-101-0/+4
| | | | | | this adds "#define OLD_NTDOMAIN 1" in lots of places. Don't panic - this isn't permanent, it should go after another few merge steps have been done
* - removed all our old wildcard matching code and replaced it with aAndrew Tridgell2000-04-301-257/+2
| | | | | | | | | | | | | | | | call to ms_fnmatch(). This also removes all the Win9X semantics stuff and a bunch of other associated cruft. - moved the stat cache code into statcache.c - fixed the uint16 alignment requirements of ascii_to_unistr() and unistr_to_ascii() - trans2 SMB_FIND_FILE_BOTH_DIRECTORY_INFO returns the short name as unicode always (at least thats what NT4 does) - fixed some errors in the in-memory tdb code. Still ugly, but doesn't crash as much
* the bulk of the changes to get rid of fd_ptr and move print openAndrew Tridgell2000-04-101-0/+6
| | | | | | | | | handling to printing/printing.c most of this was just replacing things like fsp->fd_ptr->fd with fsp->fd the changes in open.c are quite dramatic. Most of it is removing all the functions that handled the fd multiplexing
* Fix some more compile warnings.Tim Potter2000-02-071-1/+2
|
* Fix some compile warnings.Tim Potter2000-02-041-1/+1
|
* Put back lots of missing calls to dos_to_unix(). Thanks toTim Potter2000-02-031-2/+2
| | | | aono@cc.osaka-kyoiku.ac.jp (Tomoki AONO)
* Mega-VFS merge. Yeah baby!Tim Potter2000-02-031-6/+8
| | | | | Synopsis: change every disk access function to work through a vfs_ops structure contained in the connection_struct.
* Added hash-based stat cache code from Ying Chen.Jeremy Allison2000-01-261-81/+92
| | | | Jeremy.
* first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1999-12-131-49/+19
|
* more dfs stuff. this looks like it's going to be more appropriate to useLuke Leighton1999-07-151-3/+33
| | | | | | | the vfs tables. at the moment, i replaced all calls to unix_convert() with unix_dfs_convert(). this does the job, but it's not very nice.
* Use VFS I/O for stat_cache_lookup()Tim Potter1999-04-051-3/+5
|
* Use VFS operations for file I/O.Tim Potter1999-04-041-3/+4
|
* formatting changeAndrew Tridgell1998-11-211-1/+1
|
* Added code to convert empty file names to "." so we avoidRichard Sharpe1998-10-091-0/+12
| | | | | | searching the cache, but only if we are not on a print share. This code is known to work on at least one site!
* Add a DEBUG to unix_convertRichard Sharpe1998-10-091-0/+2
|
* Changes to test in configure if capabilities are enabled on a system.Jeremy Allison1998-09-281-13/+11
| | | | | | | | | | Changes to get Samba to compile cleanly with the IRIX compiler with the options : -fullwarn -woff 1209,1174 (the -woff options are to turn off warnings about unused function parameters and controlling loop expressions being constants). Split prototype generation as we hit a limit in IRIX nawk. Removed "." code in smbd/filename.c (yet again :-). Jeremy.
* Fixed the problem with reply_getatr() being passed a "" name in reply_getatr,Jeremy Allison1998-09-261-3/+0
| | | | | | replaced the paranoid code in smbd/filename.c that replaces a "" with a ".". I am starting to think this code may well be needed. Jeremy.
* I've disabled the conversion of null filenames to "." until we solveAndrew Tridgell1998-09-251-0/+3
| | | | | | | the win95 printing problem. I suspect it is a smbgetatr() problem with a null name (which requires special behaviour). This is an interim solution.
* Small bit of paranioa. Ensure that if the incoming name toJeremy Allison1998-09-191-2/+14
| | | | | | unix_convert() was a single '\' (the base directory of the service) that it gets translated to a '.', not a '\0'. Jeremy.
* Improved stat cache code by uppercasing any search name that gets added toJeremy Allison1998-09-101-17/+15
| | | | | | | it if we're in case insensitive mode, and then doing a memcmp rather than a StrnCaseCmp (which is *horribly* slow) on every lookup. Fixed bug with refusing NT SMB's (use *brackets* where needed :-). Jeremy.
* Added back groupname map stuff removed by Andrew's "slash 'n' burn"Jeremy Allison1998-09-081-0/+14
| | | | | | | | | | | | | | | | | tactics :-). Protected by #ifdef until used. Fixed bug in fd_attempt_close() where a pointer to potentially free'd memory was returned. I hate that. Added "blocking locks" as a per-share option for performance testing. Changed is_mangled() so it will return true if called with a pathname and any component of the pathname was mangled (it was already attempting to do this, but not checking for a '/' as end-of-mangle). This should be a better fix for the wierd stat cache bug Andrew identified. Jeremy.
* add a "stat cache" boolean smb.conf option. (defaults to on)Andrew Tridgell1998-09-061-2/+10
| | | | | | | | I think we need this so we can rule out stat cache bugs when dealing with bug reports. If we ask a user to disable the stat cache and the problem persists then we know it isn't a stat cache bug. The stat cache code is sufficiently complicated that it can be pretty hard to tell if it is causing problems or not.
* fixed a stat cache bug (the one found by Matthew Geier).Andrew Tridgell1998-09-051-1/+5
| | | | | | The fix I used is a very conservative fix. I'll leave it up to Jeremy to put in a better fix. The problem was the detection of mangled names.
* some cleanups to use ZERO_STRUCT() and friendsAndrew Tridgell1998-09-051-2/+3
|
* tridge the destroyer returns!Andrew Tridgell1998-09-051-5/+5
| | | | | | | | | | | | | | | | | | | | | | prompted by the interpret_security() dead code that Jean-Francois pointed out I added a make target "finddead" that finds potentially dead (ie. unused) code. It spat out 304 function names ... I went through these are deleted many of them, making others static (finddead also reports functions that are used only in the local file). in doing this I have almost certainly deleted some useful code. I may have even prevented compilation with some compile options. I apologise. I decided it was better to get rid of this code now and add back the one or two functions that are needed than to keep all this baggage. So, if I have done a bit too much "destroying" then let me know. Keep the swearing to a minimum :) One bit I didn't do is the ubibt code. Chris, can you look at that? Heaps of unused functions there. Can they be made static?