1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

2964 Commits

Author SHA1 Message Date
Andrew Tridgell
943471f2c8 split fsp specific routines out of printing.c to fix linking problem
in TNG
(This used to be commit 82df25b28b94b0041676fb433e0e677acb544579)
2000-04-23 07:51:15 +00:00
Andrew Tridgell
7fcdb8fb7e fixed two uninitialised memory references
(This used to be commit e4ddd1a4a96b7f723d3d92e4334f4033e1dbc8a8)
2000-04-23 07:44:01 +00:00
Andrew Tridgell
c389bd2d6b trick to get full stack trace when using the free version of insure
(This used to be commit bb9b3e03deebe23cf3fe10c2cb9b67a730e086a2)
2000-04-23 07:43:32 +00:00
Andrew Tridgell
d44ae9e229 insure caught an uninitialised memory reference - ensure it starts as
zero
(This used to be commit 53077295b76487a6eafc6b14b69a91074a02aa35)
2000-04-23 07:42:13 +00:00
Andrew Tridgell
71499fbe98 avoided a memory leak in the ubi code by deleting a mangled cache
entry before adding to ensure that we don't ever add a duplicate entry

this code can be removed when ubi gets fixed
(This used to be commit 062d79bf8ba5308803393c7b9140d1f77db3690f)
2000-04-23 07:40:13 +00:00
Andrew Tridgell
9e3f457db0 fixed a prs memory leak (weren't freeing input buffer)
(This used to be commit be7186b0dd2779fc9f98b4c9f77874ef3ded37d6)
2000-04-23 07:38:18 +00:00
Andrew Tridgell
f930ec638b if using insure then don't close fd 2
(This used to be commit 1c6322473afcf9065fa25777d1b0627f133af3f6)
2000-04-23 07:37:43 +00:00
Andrew Tridgell
f1867dcad6 return NULL for a zero size memdup
(This used to be commit 9416b58b9c2ff898cdae2cb81ab1e150ef9f0e89)
2000-04-22 08:29:41 +00:00
Andrew Tridgell
67239541cd don't copy a null groups list
(This used to be commit d0fc1675df35e65488a19d7f5929792fba347b07)
2000-04-22 08:28:49 +00:00
Andrew Tridgell
f7608e8535 fixed overlapping strcpy() found by insure
(This used to be commit 1106fa7f24d229c3877263b7a7dde359556435e6)
2000-04-22 08:28:22 +00:00
Andrew Tridgell
d384e1801d fixed uninitialised snum
(This used to be commit 14251aab2ec00aa7f3e6a6e791e78732cb5a9eda)
2000-04-22 08:27:48 +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 ab0ecc39d688f16b9692fe90b991f0b89287070a)
2000-04-22 00:33:16 +00:00
Andrew Tridgell
b7a1d19d11 use sys_fsusage() not disk_free() in printing.c
(This used to be commit 763704f78fc44976b2d977e8a08ffdeb727903c4)
2000-04-19 08:44:56 +00:00
Andrew Tridgell
f074d6ef57 split fsusage() into a separate module (to fix linking problems with
spoolssd in tng)
(This used to be commit e2eacdd74c369fbbcd118148149321e36f3d0010)
2000-04-19 08:23:13 +00:00
Andrew Tridgell
59f992f12d patch from luke to split out lanman code from ipc.c into lanman.c
(This used to be commit 95246a8432e04bcdeed962d1a6112dfd90518941)
2000-04-19 07:00:22 +00:00
Andrew Tridgell
612682354f - got rid of the "passive" option
- cleaned up the standard_sub_*() calls a lot
(This used to be commit 2c2d95d77d3667eaa9252506a82b9054b0d0e01c)
2000-04-19 04:01:16 +00:00
Jeremy Allison
d2db520692 Sync up with 2.0.7 w.r.t. guest users.
Jeremy.
(This used to be commit 8a99d824c0e9a43c8a8c81140f8c9005c7e2621a)
2000-04-18 21:23:26 +00:00
Jeremy Allison
4217c939ec locking/locking.c: Fixed placeholder code for POSIX locking.
printing/printing.c: Cast tdb_delete to (tdb_traverse_func) to stop warning.
                     tmpfile gives mirror warning.
smbd/groupname.c: Remember to file_lines_free() on exit.
tdb/tdb.h: Add tdb_traverse_func typedef.
Jeremy
(This used to be commit 204ca1195c86499bd9beb273ce573db7a56ccead)
2000-04-18 20:41:04 +00:00
Andrew Tridgell
7b1c5392f7 updates from the TNG branch
(This used to be commit 36fb5bc72fc6c0de719205ea34f497bfa0c4082f)
2000-04-18 03:34:27 +00:00
Andrew Tridgell
db0631f2d0 don't parse blank lines
(This used to be commit 8b1afe7e1af0a62244632e0a58b9e513ab4366f0)
2000-04-18 02:35:14 +00:00
Andrew Tridgell
75731f8c23 fixed some crash bugs in the nt forms parsing
(This used to be commit e505a6ddf3df37ca485cae117c53fa96d736f897)
2000-04-18 02:17:46 +00:00
Luke Leighton
9ff032320d ReadDirName calls vfs->readdirname calls dos_readdirname.
replaced with readdirname.  ditto for OpenDir and CloseDir.
(This used to be commit a0afe0d5f8378463b1e47cd779aee3af98c1940a)
2000-04-18 02:09:50 +00:00
Shirish Kalele
bcaf1211f2 Corrected minor parsing errors.
Not adding a Dfs junction to msdfs.tdb if it doesn't have any referred paths
as parsed from the dfsmap file.
(This used to be commit 462ea8b7fdaa528c3e9bfaca4fdd031888157124)
2000-04-17 22:40:02 +00:00
Shirish Kalele
483e61b97f When parsing a dfs map for a service, see if the mount points exist that stand
for token junction points in the Dfs. If not, create these mount points as
subdirectories of the service directory.
(This used to be commit 3b79df24687afce4780884b7a784661f69752fe1)
2000-04-17 21:25:32 +00:00
Andrew Tridgell
d99bec7170 got rid of some more old configure tests and includes
(This used to be commit f137648504362479143d50477fa38ebf7147968b)
2000-04-17 06:11:08 +00:00
Andrew Tridgell
98825661dd removed some obsolete configure tests (sysv ipc etc)
(This used to be commit e8905a557a342ba3604a61663c6ff24887a9fd46)
2000-04-17 05:56:49 +00:00
Andrew Tridgell
bb28f06eae moved standard_sub() and friends into a separate module
(This used to be commit 030ec8e71f9ef533b5d6aece01e67d357e23b7d2)
2000-04-17 04:46:10 +00:00
Andrew Tridgell
8d7e498db1 converted a couple more functions to use a fd instead of a FILE*
added a new utility fn file_lines_slashcont() which is used to handle
files that treat a \ followed by a newline as a blank
(This used to be commit 384ecd9d66ccd31ee85000c0ca55d413d8f2cc53)
2000-04-16 11:17:19 +00:00
Andrew Tridgell
19f946ba6f converted a bunch more functions to use a fd instead of a FILE*
to support some of this I added the following functions in util_file.c

file_lines_pload : load lines from a pipe
file_pload : load a pipe into memory
(This used to be commit a09470817c5b21dba42f9ef4ce5e8b768a254c0b)
2000-04-16 11:00:21 +00:00
Andrew Tridgell
83170b36c5 got rid of FILE* in the unix name mapping code
(This used to be commit 92f85cef8b4c283374edb726ff0b4999a2000b2a)
2000-04-16 09:42:09 +00:00
Andrew Tridgell
6684245bce got rid of all the FILE* calls in the NT print system.
this also fixes a few security holes in that code. JF - you need to be
careful about open files for writing! symlinks can trap you.

note that I always unlink() the file first, then open with
O_EXCL. That is a cheap trick to avoid the symlink problems.
(This used to be commit ad56e3d7915100a83b33ad36e627e13325197942)
2000-04-16 09:41:39 +00:00
Andrew Tridgell
37c0312def added fdprintf()
this is like fprintf() but operates on a file descriptor

combined with file_load_lines() this makes it really easy to get rid
of the use of fopen() in Samba.
(This used to be commit bd5cd502bf52164b95d7bfc026189e04988171db)
2000-04-16 09:40:02 +00:00
Andrew Tridgell
d79a8c68d6 removed old comments
(This used to be commit 9f49d17d4cf904034ce3718626450dc25541b420)
2000-04-16 08:04:06 +00:00
Andrew Tridgell
7ee1c906f4 improved the error handling and added queue pause and resume
(This used to be commit 5f5b79c9264510f5851ad1d6f3ce9e2b15e4a0da)
2000-04-16 08:03:37 +00:00
Andrew Tridgell
2c80622a94 use some symbolic names for print queue status
(This used to be commit e8418ab73667e011b15e00a844240723ff4a8cd6)
2000-04-16 07:38:45 +00:00
Andrew Tridgell
99acf45fa4 added helper fns to change from internal status codes to nt spoolss codes
(This used to be commit 8af879b3f513e7e8ca5f63848d22824b05e68398)
2000-04-16 07:28:36 +00:00
Andrew Tridgell
b062fe0d8f - put the job status in english not french!
- add helper fns to change from internal status codes to nt spoolss codes
(This used to be commit 917c4814fe076cc38b1becf7d219f2437cba6e60)
2000-04-16 07:28:06 +00:00
Andrew Tridgell
4367a3edfb added tdb_get_int() and tdb_store_int()
they are very useful for database versioning
(This used to be commit cc65914cdcceb1fdeeb5d6ec1cf2ea2f865c5092)
2000-04-16 06:23:11 +00:00
Andrew Tridgell
54de56a1be the changes to the main smb code
------------
The following series of commits are for the new tdb based printing
backend. This completely replaces our old printing backend.

Major changes include:

- all print ops are now done in printing/*.c rather than scattered all
  over the place
- system job ids are decoupled from SMB job ids
- the lpq parsers don't need to be nearly so smart, they only need to
  parse the filename, the status and system job id
- we can store lots more info about a job, including the full job name
- the queue cache control is much better

I also added a new utility routine file_lines_load() that loads a text
file and parses it into lines. This is used in out lpq parsing and I
also want to use it to replace all of our fgets() based code in other
places.
(This used to be commit d870542c2884510bd45fd5b54ff2157434d53f4c)
2000-04-16 06:22:31 +00:00
Andrew Tridgell
8a91379a00 JF and Jeremy - please have a look at what I did to the spoolss
code. It now uses the new printing backend.

------------
The following series of commits are for the new tdb based printing
backend. This completely replaces our old printing backend.

Major changes include:

- all print ops are now done in printing/*.c rather than scattered all
  over the place
- system job ids are decoupled from SMB job ids
- the lpq parsers don't need to be nearly so smart, they only need to
  parse the filename, the status and system job id
- we can store lots more info about a job, including the full job name
- the queue cache control is much better

I also added a new utility routine file_lines_load() that loads a text
file and parses it into lines. This is used in out lpq parsing and I
also want to use it to replace all of our fgets() based code in other
places.
(This used to be commit 2df82862c061cca5644f5f69146c97302ccb42d5)
2000-04-16 06:20:43 +00:00
Andrew Tridgell
5711f1f196 the bulk of the changes. Also split the loadparm related code into printing/load.c
so swat can get it without linking to the backend code

------------
The following series of commits are for the new tdb based printing
backend. This completely replaces our old printing backend.

Major changes include:

- all print ops are now done in printing/*.c rather than scattered all
  over the place
- system job ids are decoupled from SMB job ids
- the lpq parsers don't need to be nearly so smart, they only need to
  parse the filename, the status and system job id
- we can store lots more info about a job, including the full job name
- the queue cache control is much better

I also added a new utility routine file_lines_load() that loads a text
file and parses it into lines. This is used in out lpq parsing and I
also want to use it to replace all of our fgets() based code in other
places.
(This used to be commit a902caf8d78ae4cb11ea3776d10273cb37d5fcd0)
2000-04-16 06:20:02 +00:00
Andrew Tridgell
95ddbb8aaf the new file_lines_load() and file_lines_free() routines. Very useful!
------------
The following series of commits are for the new tdb based printing
backend. This completely replaces our old printing backend.

Major changes include:

- all print ops are now done in printing/*.c rather than scattered all
  over the place
- system job ids are decoupled from SMB job ids
- the lpq parsers don't need to be nearly so smart, they only need to
  parse the filename, the status and system job id
- we can store lots more info about a job, including the full job name
- the queue cache control is much better

I also added a new utility routine file_lines_load() that loads a text
file and parses it into lines. This is used in out lpq parsing and I
also want to use it to replace all of our fgets() based code in other
places.
(This used to be commit be1e98b3f7a6007d2c9ac8e079724cb264e0dd3a)
2000-04-16 06:19:11 +00:00
Andrew Tridgell
837887ffd6 the fsp needs a jobid in it now
------------
The following series of commits are for the new tdb based printing
backend. This completely replaces our old printing backend.

Major changes include:

- all print ops are now done in printing/*.c rather than scattered all
  over the place
- system job ids are decoupled from SMB job ids
- the lpq parsers don't need to be nearly so smart, they only need to
  parse the filename, the status and system job id
- we can store lots more info about a job, including the full job name
- the queue cache control is much better

I also added a new utility routine file_lines_load() that loads a text
file and parses it into lines. This is used in out lpq parsing and I
also want to use it to replace all of our fgets() based code in other
places.
(This used to be commit 4973b7e276ca75dcb63ccb54687d17f87aede7c1)
2000-04-16 06:18:39 +00:00
Andrew Tridgell
4a12fb79c0 The following series of commits are for the new tdb based printing
backend. This completely replaces our old printing backend.

Major changes include:

- all print ops are now done in printing/*.c rather than scattered all
  over the place
- system job ids are decoupled from SMB job ids
- the lpq parsers don't need to be nearly so smart, they only need to
  parse the filename, the status and system job id
- we can store lots more info about a job, including the full job name
- the queue cache control is much better

I also added a new utility routine file_lines_load() that loads a text
file and parses it into lines. This is used in out lpq parsing and I
also want to use it to replace all of our fgets() based code in other
places.
(This used to be commit 0b686601593bdc05778dcf70c391efd4fe017df7)
2000-04-16 06:17:59 +00:00
Andrew Tridgell
f77d9a2cca added standard_sub_snum() function for modules that don't have
a connection structure
(This used to be commit f35fe3b4a175161128341fe30a61437c560180d1)
2000-04-15 08:07:57 +00:00
Andrew Tridgell
b8c51212db use macros for table boundaries
(This used to be commit a82a5acff2ad2120f5480f0cb08550e95d80c59e)
2000-04-15 08:07:11 +00:00
Andrew Tridgell
88460f2f69 don't need this monster any more
(This used to be commit 180312c4a6a92ed4b80691d7febade3ef02c8595)
2000-04-15 07:15:16 +00:00
Andrew Tridgell
4b7850663e a quick hack to reduce the size of the unicode map table headers from
3MB to 250k.

I split the table into 3 sections, after noticing that 5/6 of the
table was empty.
(This used to be commit c1496736bbdb7f6bf1eb43a54f883e5f41a4d39e)
2000-04-15 07:14:40 +00:00
Andrew Tridgell
a4e537322f use open() not fopen() on codepage files.
in general we need to get rid of all uses of fopen(). The hard one
will be the debug code and dbf.
(This used to be commit 3992a5169c0b3805c38729c3856c41b1b2527765)
2000-04-15 02:52:51 +00:00
Jeremy Allison
ce5e230952 Log file check patch from Mattias Gronlund <Mattias.Gronlund@sa.erisoft.se>.
Modified to do checks in timeout processing not in main loop. This (IMHO)
is the correct place as (a) we are already root, and (b) it is guarenteed
to be called every 200 smb requests.
Jeremy.
(This used to be commit c3794fd29fdc4e5a0dbd725cdc24fe210934caf2)
2000-04-15 00:31:56 +00:00