1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00
Commit Graph

2967 Commits

Author SHA1 Message Date
Andrew Tridgell
b1686a6109 we can't pass a fstring to a routine expecting a pstring
(This used to be commit 8af70f2887)
2000-04-23 08:13:48 +00:00
Andrew Tridgell
31446a98a3 check for a valid snum when running a printing command
(This used to be commit 381ddb464f)
2000-04-23 08:13:12 +00:00
Andrew Tridgell
a32420e5b7 Makefile.in change for split of printfsp.c
(This used to be commit 980a81651a)
2000-04-23 07:56:11 +00:00
Andrew Tridgell
943471f2c8 split fsp specific routines out of printing.c to fix linking problem
in TNG
(This used to be commit 82df25b28b)
2000-04-23 07:51:15 +00:00
Andrew Tridgell
7fcdb8fb7e fixed two uninitialised memory references
(This used to be commit e4ddd1a4a9)
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 bb9b3e03de)
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 53077295b7)
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 062d79bf8b)
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 be7186b0dd)
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 1c6322473a)
2000-04-23 07:37:43 +00:00
Andrew Tridgell
f1867dcad6 return NULL for a zero size memdup
(This used to be commit 9416b58b9c)
2000-04-22 08:29:41 +00:00
Andrew Tridgell
67239541cd don't copy a null groups list
(This used to be commit d0fc1675df)
2000-04-22 08:28:49 +00:00
Andrew Tridgell
f7608e8535 fixed overlapping strcpy() found by insure
(This used to be commit 1106fa7f24)
2000-04-22 08:28:22 +00:00
Andrew Tridgell
d384e1801d fixed uninitialised snum
(This used to be commit 14251aab2e)
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 ab0ecc39d6)
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 763704f78f)
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 e2eacdd74c)
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 95246a8432)
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 2c2d95d77d)
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 8a99d824c0)
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 204ca1195c)
2000-04-18 20:41:04 +00:00
Andrew Tridgell
7b1c5392f7 updates from the TNG branch
(This used to be commit 36fb5bc72f)
2000-04-18 03:34:27 +00:00
Andrew Tridgell
db0631f2d0 don't parse blank lines
(This used to be commit 8b1afe7e1a)
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 e505a6ddf3)
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 a0afe0d5f8)
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 462ea8b7fd)
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 3b79df2468)
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 f137648504)
2000-04-17 06:11:08 +00:00
Andrew Tridgell
98825661dd removed some obsolete configure tests (sysv ipc etc)
(This used to be commit e8905a557a)
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 030ec8e71f)
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 384ecd9d66)
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 a09470817c)
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 92f85cef8b)
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 ad56e3d791)
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 bd5cd502bf)
2000-04-16 09:40:02 +00:00
Andrew Tridgell
d79a8c68d6 removed old comments
(This used to be commit 9f49d17d4c)
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 5f5b79c926)
2000-04-16 08:03:37 +00:00
Andrew Tridgell
2c80622a94 use some symbolic names for print queue status
(This used to be commit e8418ab736)
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 8af879b3f5)
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 917c4814fe)
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 cc65914cdc)
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 d870542c28)
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 2df82862c0)
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 a902caf8d7)
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 be1e98b3f7)
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 4973b7e276)
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 0b68660159)
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 f35fe3b4a1)
2000-04-15 08:07:57 +00:00
Andrew Tridgell
b8c51212db use macros for table boundaries
(This used to be commit a82a5acff2)
2000-04-15 08:07:11 +00:00
Andrew Tridgell
88460f2f69 don't need this monster any more
(This used to be commit 180312c4a6)
2000-04-15 07:15:16 +00:00