1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

61 Commits

Author SHA1 Message Date
Jeremy Allison
f735551b9e First cut of new ACL mapping code from Andreas Gruenbacher <agruen@suse.de>.
This is not 100% the same as what SuSE shipped in their Samba, there is
a crash bug fix, a race condition fix, and a few logic changes I'd like to
discuss with Andreas. Added Andreas to (C) notices for posix_acls.c
Jeremy.
(This used to be commit 40eafb9dde)
2002-10-23 01:22:32 +00:00
Gerald Carter
a834a73e34 sync'ing up for 3.0alpha20 release
(This used to be commit 65e7b5273b)
2002-09-25 15:19:00 +00:00
Jelmer Vernooij
127e77e6e3 Sync 3.0 branch with head
(This used to be commit 42615b945e)
2002-08-17 15:27:10 +00:00
Andrew Tridgell
e90b652848 updated the 3.0 branch from the head branch - ready for alpha18
(This used to be commit 03ac082dcb)
2002-07-15 10:35:28 +00:00
Jeremy Allison
7d7c594644 Removed HAVE_LIBDL from most places (except system.c). Added checks for
dlopen & friends into configure.in. This should help building on *BSD
where dl*** calls are in libc.
Jeremy
(This used to be commit ac1baba35d)
2002-03-27 03:00:39 +00:00
Jeremy Allison
ffadd471b9 Sync up vfs changes from 2.2.x.
Jeremy.
(This used to be commit ad1e858d8e)
2002-03-19 02:32:39 +00:00
Jim McDonough
b9377e811e Missing comma from systems that have ACLs.
(This used to be commit 96e4282dca)
2002-03-12 16:32:25 +00:00
Jeremy Allison
3bb219161a Added POSIX ACL layer into the vfs.
Jeremy.
(This used to be commit 7d59445b69)
2002-03-12 00:08:08 +00:00
Tim Potter
cd68afe312 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
(This used to be commit 6a58c9bd06)
2002-01-30 06:08:46 +00:00
Jeremy Allison
427896866a Attempt to fix bugs in write cache code (yes I know it's going away :-).
Jeremy.
(This used to be commit ccda82b457)
2002-01-20 00:04:15 +00:00
Jeremy Allison
3454945146 Getting ready to add UNIX extensions in HEAD also.
Jeremy
(This used to be commit 6210d4aa19)
2002-01-10 00:28:09 +00:00
Jeremy Allison
eb61d92ca7 Re-wrote the guts of the rename_internals code to cope with a reported
bug (renaming name -> name was failing, on W2K it succeeds). Simplified
the common case, did a lot of work to ensure NT error codes are correctly
reported back to client.
Jeremy.
(This used to be commit e6b27f3d80)
2002-01-04 21:11:35 +00:00
Jeremy Allison
a32754589a Don't check space on every extend if strict allocate not set.
Jeremy
(This used to be commit 9391efb38e)
2001-11-12 02:03:44 +00:00
Jeremy Allison
22afba62c9 Fixed allocation bug in database prog. Some format fixes.
Jeremy.
(This used to be commit 9ff6b0c20c)
2001-11-12 01:00:54 +00:00
Jeremy Allison
3343d0281d Added debug in truncate, fixed warning with gcc3.
Jeremy.
(This used to be commit 970ec14b4b)
2001-11-07 23:47:20 +00:00
Tim Potter
fb328c9cc4 Made default vfs ops static so we can use this symbol in actual modules.
(This used to be commit 398ced6eef)
2001-10-24 00:35:55 +00:00
Tim Potter
f0e0dd6507 Renamed vfs_init() to smbd_vfs_init() to allow vfs modules to compile.
(This used to be commit 7c3542ba87)
2001-10-18 00:27:20 +00:00
Tim Potter
dc1fc3ee8e Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.
(This used to be commit 2d0922b0ea)
2001-10-02 04:29:50 +00:00
Simo Sorce
61b2794968 move to SAFE_FREE()
(This used to be commit a95943fde0)
2001-09-17 11:25:41 +00:00
Jeremy Allison
7e75921e24 Merge of transfer file code from 2.2, fix for readbraw.
Jeremy.
(This used to be commit c05e794536)
2001-09-04 19:10:30 +00:00
Herb Lewis
717533483b get rid of compiler warnings
(This used to be commit 0768991d04)
2001-08-24 20:32:01 +00:00
Jeremy Allison
d851036d82 Correctly report amount written in debug when allocation space.
Jeremy.
(This used to be commit d1e7cf6073)
2001-08-07 00:36:10 +00:00
Jeremy Allison
f8d9da9983 Fix for getting allocate_file_space to return the correct errno.
Jeremy.
(This used to be commit 298595e8cb)
2001-08-06 19:21:23 +00:00
Jeremy Allison
27bdf594fb Extra debug to see what errno is on write fail.
Jeremy.
(This used to be commit 352a02bf5c)
2001-08-04 00:24:54 +00:00
Jeremy Allison
819a911735 Added "strict allocate" per share parameter. This causes actual on-disk allocation
to be done. Without it just does the ftruncate.
Jeremy.
(This used to be commit 0b052f103e)
2001-08-01 22:13:50 +00:00
Jeremy Allison
9df203f876 Wrapped dlerror() in the same way as the other dlxxx() calls.
Jeremy.
(This used to be commit ed5a1f70c6)
2001-07-06 18:45:59 +00:00
Andrew Tridgell
527e824293 strchr and strrchr are macros when compiling with optimisation in gcc, so we can't redefine them. damn.
(This used to be commit c41fc06376)
2001-07-04 07:36:09 +00:00
Andrew Tridgell
87fbb7092b The big character set handling changeover!
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.
(This used to be commit debb471267)
2001-07-04 07:15:53 +00:00
Jeremy Allison
e2ced932db Ensured all the system calls in msdfs.c go through the vfs layer.
Added vfs calls to symlink() and readlink() with appropriate configure
checks.
Jeremy.
(This used to be commit c24e6b41ea)
2001-06-29 22:32:24 +00:00
Jeremy Allison
53850c51ca configure:
configure.in:
include/config.h.in:
include/profile.h:
smbd/vfs-wrap.c:
smbd/vfs.c:
Added fchmod and fchown to VFS (sorry Gerald - but we needed them anyway).
smbd/dosmode.c:
smbd/files.c:
printing/printfsp.c:
smbd/close.c:
smbd/open.c:
Fixed "dos filemode" correctly so there are no race conditions. Forces test
of open of file O_WRONLY before allowing fchmod as root. Afterwards, calls
standard close function that preserves POSIX locks due to POSIX-me-harder
braindamage. :-). Andrew please review this code.
Also - in removing the tmpdir param in smbrun an extra NULL parameter
was missed in each print_run_command() call (which is a varargs fn.).
Now fixed.
Jeremy.
(This used to be commit 32397e5bc6)
2001-04-14 00:19:12 +00:00
Jeremy Allison
162218259f smbd/posix_acls.c: Sync up with 2.2 changes - don't return deny ACE's.
smbd/vfs.c: Don't call [f]chmod_acl if no acl support.
Jeremy.
(This used to be commit 83f52394e6)
2001-03-26 05:43:04 +00:00
Jeremy Allison
c7a953a318 Added sys_dlopen/sys_dlsym/sys_dlclose.
Jeremy.
(This used to be commit 49f0e7e714)
2001-03-19 07:08:02 +00:00
Jeremy Allison
da3053048c Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMR
RPC code to merge with new passdb code.
Currently rpcclient doesn't compile. I'm working on it...
Jeremy.
(This used to be commit 0be41d5158)
2001-03-11 00:32:10 +00:00
Jeremy Allison
2f7c1db093 include/vfs.h:
smbd/vfs-wrap.c:
smbd/vfs.c: Added fchmod_acl and chmod_acl.
lib/substitute.c:
smbd/lanman.c:
smbd/open.c:
smbd/process.c:
smbd/reply.c:
smbd/service.c: Removed sessetup_user variable. Added current_user_info struct
which conatins domain info etc. Added '%D' for client domain parameter.
Jeremy.
(This used to be commit 2844ec3d51)
2001-01-23 01:52:30 +00:00
Jeremy Allison
316cfee01c Added OLD_NTDOMAIN to remove warnings about undefined functions.
Jeremy.
(This used to be commit f4c32a75e6)
2000-12-08 19:35:58 +00:00
Jeremy Allison
6f58dd5871 Ok - fixed a bug in our levelII oplock code. We need to break a level II on
a byte range lock (write lock only, but Win2k breaks on read lock also so I
do the same) - if you think about why, this is obvious. Also fixed our client
code to do level II oplocks, if requested, and fixed the code where we would
assume the client wanted level II if it advertised itself as being level II
capable - it may not want that.
Jeremy.
(This used to be commit 213cd0b519)
2000-11-16 00:59:18 +00:00
Jeremy Allison
4bce271e4f Merge from appliance head of JR's changes for driver versioning.
Jeremy.
(This used to be commit cdbd2e9977)
2000-11-14 21:56:32 +00:00
Jeremy Allison
6d36edaf43 Added a VFS version return to init call. Allows smbd to fail an init if
versions don't match.
Jeremy.
(This used to be commit d0fbb4f5d9)
2000-11-06 21:44:33 +00:00
Jeremy Allison
abf055046f Ok - this is a big patch - and it may break smbd a bit (although
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.
(This used to be commit 66a5c05ec4)
2000-10-19 02:58:24 +00:00
Jeremy Allison
ba00796e6d Herb's warning fixes. Also the POSIX locking fix.
We now use our own vfs layer to do get/set acl calls (hurrah!).
Jeremy.
(This used to be commit dfe77c7046)
2000-10-06 18:13:52 +00:00
Jeremy Allison
14a8906e8c Inlined many of the vfs_XXX calls as macros for speed.
Jeremy.
(This used to be commit 0811d080ab)
2000-10-06 03:41:48 +00:00
Jeremy Allison
636f146abf Restructuring of vfs layer to include a "this" pointer - can be an fsp or
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.
(This used to be commit b07611f815)
2000-10-06 03:21:49 +00:00
Jeremy Allison
94c63f6ca4 Vector get_nt_acl/set_nt_acl via vfs. POSIX ACL support should be added
above this layer.
Jeremy.
(This used to be commit b90af886a9)
2000-10-05 19:04:41 +00:00
Jeremy Allison
3ad2ee22bb utf-8 and EUC3 patch from Hiroshi Miura Samba User Group Japan staff.
mkdir high bits patch from Robert Dahlem" <Robert.Dahlem@gmx.net>.
jeremy.
(This used to be commit b40191d271)
2000-10-03 02:12:14 +00:00
Jeremy Allison
b43b2e4f8a Restructuring of the code to remove dos_ChDir/dos_GetWd and re-vector them
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.
(This used to be commit f96625ec12)
2000-09-27 19:09:59 +00:00
Jeremy Allison
177b962dfe Added vfs_unlink call to ensure vfs is used on unlink from client.
Jeremy.
(This used to be commit 38fc56c843)
2000-08-30 18:33:56 +00:00
Tim Potter
b561c18597 Fixes for various compile warnings on Solaris 8.
(This used to be commit 898a483cda)
2000-07-10 06:41:04 +00:00
Jeremy Allison
652d98c0bc Fix for dual unix_to_dos conversion in readdir from A.V.Shutko <AVShutko@mail.khstu.ru>
Jeremy.
(This used to be commit 1152f2ed00)
2000-05-05 19:57:02 +00:00
Jeremy Allison
ba020b0612 Moved uglyness needed in fcntl locking (64->32 bit mapping, NFS
errors etc.) into locking/posix.c, where it is needed. fcntl_lock in lib/util.c
is now very small and clean.
Added (*lock) op to vfs layer.
Jeremy.
(This used to be commit 46092ee141)
2000-05-02 03:20:47 +00:00
Jeremy Allison
6259f51dd9 This is a *big* checkin that may break some things, but implements the
new open mechanism Andrew & I discussed.

config.sub:
configure: Included the QNX patch.

include/vfs.h:
smbd/vfs-wrap.c:
smbd/vfs.c: Added ftruncate vfs call (needed).

Note that we will also need locking calls in the vfs (to be added).

lib/util_unistr.c:
nmbd/nmbd_processlogon.c: Fix for NT domain logons causing nmbd to core dump.
                          Also fix for sidsize DOS bug.

locking/locking.c: Check value of ret before using it for memdup.

printing/printing.c: Convert print_fsp_open to return an allocated fsp.

rpc_server/srv_lsa.c: Fix for NT domain logons.

I have removed all use of lp_share_modes() from the code (although I
left the parameter in the table for backwards compatibility). It no longer makes
sense for this to exist.

smbd/close.c: Removed lp_share_modes().
smbd/fileio.c: Fixed parameters to unlock_share_entry call in panic code.
smbd/files.c: Correctly set the unix_ERR_code to ERRnofids on fsp allocation fail.

smbd/nttrans.c:
smbd/reply.c:
smbd/trans2.c: Changed all occurrences of open_file_shared/open_directory/
               open_file_stat to return an fsp from the call.

smbd/open.c: Changed all occurrences of open_file_shared/open_directory/
             open_file_stat to return an fsp from the call.

In addition I have fixed a long standing race condition in the deny mode
processing w.r.t. two smbd's creating a file. Andrew, please note that
your original idea of using open with O_EXCL in this case would not work
(I went over the races very carefully) and so we must re-check deny modes
*after* the open() call returns. This is because there is a race between
the open with O_EXCL and the lock of the share mode entry. Imagine the
case where the first smbd does the open with O_EXCL and a deny mode of DENY_ALL,
but is pre-empted before it locks the share modes and creates the deny
mode entry for DENY_ALL. A second smbd could then come in with O_RDONLY
and a deny mode of DENY_NONE and the two opens would be allowed.

The *only* way to fix this race is to lock the share modes after the
open and then do the deny mode checks *after* this lock in the case
where the file did not originally exist.

This code will need extensive testing but seems to initially work.

Jeremy.
(This used to be commit ab0ecc39d6)
2000-04-22 00:33:16 +00:00