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

592 Commits

Author SHA1 Message Date
Simo Sorce
017a305fed s3-printing: Convert print_time_access_check.
use spoolss_PrintInfo2 and winreg calls

Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27 10:27:10 -04:00
Simo Sorce
52b8f1f471 s3-spoolss: Migrated driver functions to winreg.
Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27 10:27:09 -04:00
Andreas Schneider
e517588a20 s3-spoolss: Set c_setprinter always to 0.
This value is only used for the well known printers list which Samba
doesn't implement.

Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27 10:27:09 -04:00
Andreas Schneider
e2c9ad93cb s3-spoolss: Migrated spoolss_AddPrinter and spoolss_SetPrinter.
Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27 10:27:08 -04:00
Simo Sorce
5604a78f09 s3-spoolss: Migrated NT_DEVICEMODE to spoolss_DeviceMode.
Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27 10:27:06 -04:00
Günther Deschner
e4ba8fb3b9 s3-printing: Fix Bug #7541, %D in "printer admin" causing smbd crash.
Guenther
2010-07-01 14:13:16 +02:00
Günther Deschner
14f2525f9e s3-printing: add BUILTIN\Print Operators as FULL CONTROL to default sd.
Guenther
2010-06-16 12:15:24 +02:00
Andreas Schneider
47ae4a518c s3-spoolss: Provide a memory context for clean_up_driver_struct().
If we use a stack variable to setup spoolss_AddDriverInfoCtr this would
segfault with a talloc bad magic value.
2010-06-16 12:03:46 +02:00
Volker Lendecke
3f7e2222f4 s3: Remove the pointless PRINTERNAME macro 2010-06-13 12:40:27 +02:00
Günther Deschner
f9f8007361 s3-build: only use ndr_security.h where needed.
Guenther
2010-05-31 11:32:37 +02:00
Michael Adam
0fe1ff99a1 s3:registry: move reg_objects.h to registry/ and use it only where needed
Every place outside of registry/ where this is used, should probably
be changed to use pure reg_api.c code.
2010-05-25 10:35:31 +02:00
Michael Adam
b5d0fdd96c s3:nt_printing: use regval_ctr_init(). 2010-05-25 10:35:30 +02:00
Michael Adam
9ccf66379a s3:registry: adapt callers of regval_ctr_addvalue to uint8 * instead of char * 2010-05-25 10:35:25 +02:00
Andrew Bartlett
cba7f8b827 s3:dom_sid Global replace of DOM_SID with struct dom_sid
This matches the structure that new code is being written to,
and removes one more of the old-style named structures, and
the need to know that is is just an alias for struct dom_sid.

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-21 10:39:59 +02:00
Andreas Schneider
0953087f82 s3-spoolss: Added EN ISO 216, A0 and A1 to builtin forms.
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-18 16:37:16 +02:00
Simo Sorce
d6a73ad85b s3-spoolss: Removed the Phantom DeviceMode.
This was a hack that required a special client from HP.
The client code has never been released and was discontinued,
so this code was just dead weight.

Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-18 15:52:28 +02:00
Andreas Schneider
7d363b8922 s3-spoolss: Create a spoolss_map_to_os2_driver function.
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-18 15:17:23 +02:00
Andreas Schneider
a3b81a908c s3-spoolss: Use better names for set_last_from_to.
Use set_driver_mapping() and get_win_driver(), get_os2_driver().

Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-18 15:16:55 +02:00
Günther Deschner
d4474ba470 s3-secdesc: use SD_REVISION from security.idl.
Guenther
2010-05-18 12:52:18 +02:00
Günther Deschner
7f6bb48bdf s3-secdesc: remove "typedef struct security_descriptor SEC_DESC".
Guenther
2010-05-18 12:30:12 +02:00
Günther Deschner
8951c8301a s3-secdesc: remove "typedef struct security_acl SEC_ACL".
Guenther
2010-05-18 12:30:12 +02:00
Günther Deschner
a8b01d1f3b s3-secdesc: remove "typedef struct security_ace SEC_ACE".
Guenther
2010-05-18 12:30:11 +02:00
Günther Deschner
8bc9c343c4 s3-secdesc: remove "typedef struct sec_desc_buf SEC_DESC_BUF".
Guenther
2010-05-18 12:30:11 +02:00
Jelmer Vernooij
b8268cf7b0 s3: Remove use of iconv_convenience. 2010-05-18 11:45:31 +02:00
Günther Deschner
fe31b67d5e s3-registry: only include registry headers when really needed.
Guenther
2010-05-18 01:15:38 +02:00
Günther Deschner
3b529d50be s3-rpc_misc: clean out include/rpc_misc.h.
Well known rids don't really belong into an rpc header, just use the ones
defined in security.idl.

Guenther
2010-05-18 00:44:26 +02:00
Simo Sorce
348b4b9bab Make pcap headers private
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-14 14:15:08 +02:00
Günther Deschner
c6ebab846d s3: only include gen_ndr headers where needed.
This shrinks include/includes.h.gch by the size of 7 MB and reduces build time
as follows:

ccache build w/o patch
real    4m21.529s
ccache build with patch
real    3m6.402s

pch build w/o patch
real    4m26.318s
pch build with patch
real    3m6.932s

Guenther
2010-05-06 00:22:59 +02:00
Andreas Schneider
66f7699511 s3-spoolss: Added a generic spoolss_create_default_secdesc function.
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-05 18:16:23 +02:00
Andreas Schneider
b2ea8fbcce s3-spoolss: Added a function to create a default spoolss_DeviceMode.
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-05 18:08:56 +02:00
Andreas Schneider
6683b0d4b6 s3-lib: Create a sec_desc_merge and sec_desc_merge_buf function.
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-04 19:37:39 +02:00
Simo Sorce
8f56cdfaee s3-spoolss: Move info_ctr conversion to a public helper.
Signed-off-by: Günther Deschner <gd@samba.org>
2010-04-23 16:23:49 +02:00
Günther Deschner
413ffe9adb s3-spoolss: fix some crash bugs and missing error codes in AddDriver paths.
Found by torture test.

Guenther
2010-04-23 02:34:43 +02:00
Günther Deschner
63b111bd32 s3: add iconv_convenience handle to pull/push sz helpers.
Guenther
2010-04-09 18:33:45 +02:00
Günther Deschner
d9138f4ccf s3-spoolss: Fix an issue in _spoolss_DeleteForm.
Found by torture test.

Guenther
2010-04-07 23:53:19 +02:00
Günther Deschner
3da91b786e s3-printing: avoid mixing cups backend code with nt_printing code in cups_pull_comment_location.
Guenther
2010-03-26 14:36:46 +01:00
Jeremy Allison
0d6d068bc4 s3-printing: Fix "printer admin" functionality.
Fix bug #7255 ("printer admin" parameter does not work as expected).
2010-03-18 11:24:06 +01:00
Volker Lendecke
89c785c47a s3: Fix a long-standing problem with recycled PIDs
When a samba server process dies hard, it has no chance to clean up its entries
in locking.tdb, brlock.tdb, connections.tdb and sessionid.tdb.

For locking.tdb and brlock.tdb Samba is robust by checking every time we read
an entry from the database if the corresponding process still exists. If it
does not exist anymore, the entry is deleted. This is not 100% failsafe though:
On systems with a limited PID space there is a non-zero chance that between the
smbd's death and the fresh access, the PID is recycled by another long-running
process. This renders all files that had been locked by the killed smbd
potentially unusable until the new process also dies.

This patch is supposed to fix the problem the following way: Every process ID
in every database is augmented by a random 64-bit number that is stored in a
serverid.tdb. Whenever we need to check if a process still exists we know its
PID and the 64-bit number. We look up the PID in serverid.tdb and compare the
64-bit number. If it's the same, the process still is a valid smbd holding the
lock. If it is different, a new smbd has taken over.

I believe this is safe against an smbd that has died hard and the PID has been
taken over by a non-samba process. This process would not have registered
itself with a fresh 64-bit number in serverid.tdb, so the old one still exists
in serverid.tdb. We protect against this case by the parent smbd taking care of
deregistering PIDs from serverid.tdb and the fact that serverid.tdb is
CLEAR_IF_FIRST.

CLEAR_IF_FIRST does not work in a cluster, so the automatic cleanup does not
work when all smbds are restarted. For this, "net serverid wipe" has to be run
before smbd starts up. As a convenience, "net serverid wipedbs" also cleans up
sessionid.tdb and connections.tdb.

While there, this also cleans up overloading connections.tdb with all the
process entries just for messaging_send_all().

Volker
2010-03-10 16:07:10 +01:00
Jeremy Allison
c61c9c3a4c Fix for bug #7189 - Open txt files with notepad on samba shares creates problem.
Ensure we don't use any of the create_options for Samba private
use. Add a new parameter to the VFS_CREATE call (private_flags)
which is only used internally. Renumber NTCREATEX_OPTIONS_PRIVATE_DENY_DOS
and NTCREATEX_OPTIONS_PRIVATE_DENY_FCB to match the S4 code).
Rev. the VFS interface to version 28.

Jeremy.
2010-03-05 15:13:37 -08:00
Volker Lendecke
3ea64e0ad8 s3: Replace most calls to sid_append_rid() by sid_compose() 2010-01-10 20:56:16 +01:00
Günther Deschner
35c50dcce3 s3-spoolss: use driver level info8 everywhere in spoolss server internally.
Guenther
2009-12-08 11:05:21 +01:00
Günther Deschner
a367b2b5df s3-spoolss: a default printer should have at least a "PrintDriverData" key.
Guenther
2009-12-07 14:41:44 +01:00
Jeremy Allison
c5b234c9cd Fix warnings with talloc_asprintf.
Jeremy.
2009-11-25 14:47:36 -08:00
Günther Deschner
513d6da404 s3-printing: remove duplicate code while cleaning up driver structs.
Guenther
2009-11-23 12:57:46 +01:00
Günther Deschner
ec56895bde s3-printing: use spoolss types and structs while getting and deleting drivers.
Guenther
2009-11-23 12:19:11 +01:00
Günther Deschner
68cc1166d9 s3-printing: use spoolss types and structs while adding drivers.
Guenther
2009-11-23 12:19:04 +01:00
Günther Deschner
ad836c4d48 s3-registry: use pull_reg_sz() where appropriate.
(and move away from rpcstr_pull and rpcstr_pull_talloc).

Guenther
2009-10-01 11:40:30 +02:00
Günther Deschner
bbf394f36d s3-printing: use regval_ctr_addvalue_multi_sz.
Guenther
2009-09-30 16:23:40 +02:00
Günther Deschner
1b0f3b7e3a s3-registry: use regval_ctr_addvalue_sz().
Greatly simplifies and cleanes up the code.

Guenther
2009-09-30 00:30:12 +02:00
Günther Deschner
2c11b73391 s3-registry: use push_reg_sz().
Guenther
2009-09-30 00:29:49 +02:00
Günther Deschner
8e5beb738c s3-spoolss: remove device mode defines from nt_printing.h.
Guenther
2009-08-10 11:32:26 +02:00
Stefan Metzmacher
70afd419a6 s3:smbd: conn_free_internal() can be static now
metze
2009-08-07 14:18:15 +02:00
Tim Prouty
f49f3fcb01 s3: Convert a few callers of unix_convert() over to filename_convert()
This patch also changes the unix convert flags to make sure the
correct semantics are preservered for allowing/disallowing wildcards
in the last component of the path.
2009-07-24 18:51:41 -07:00
Günther Deschner
05459cf833 s3-printing: eliminate another non sec_initial_uid using security check.
Guenther
2009-06-24 00:36:48 +02:00
Volker Lendecke
0c3580c5de Do a correct TALLOC_FREE in an error case 2009-06-15 07:48:50 +02:00
Tim Prouty
04afa4b6b5 s3: Plumb smb_filename through SMB_VFS_CREATE_FILE 2009-06-12 16:14:50 -07:00
Tim Prouty
a9ec21cf21 s3: Prepare the first set of SMB_VFS_CREATE_FILE callers to take an smb_filename struct
Some of the callers required minimal changes, while others
(copy_internals) required significant changes.  The task is simplified
a little bit because we are able to do operations and checks on the
base_name when a stream isn't used.

This patch should cause no functional changes.

Volker, Jeremy: Please check
2009-06-10 13:13:27 -07:00
Tim Prouty
ab779f5c34 s3: Remove extraneous calls to unix_convert
Not only are these unnecessary in spirit because unlink_internals
calls unix_convert, but in practice the return value is simply being
ignored right now.
2009-06-10 13:13:26 -07:00
Volker Lendecke
49ca690b4b Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STAT
This patch introduces

struct stat_ex {
        dev_t           st_ex_dev;
        ino_t           st_ex_ino;
        mode_t          st_ex_mode;
        nlink_t         st_ex_nlink;
        uid_t           st_ex_uid;
        gid_t           st_ex_gid;
        dev_t           st_ex_rdev;
        off_t           st_ex_size;
        struct timespec st_ex_atime;
        struct timespec st_ex_mtime;
        struct timespec st_ex_ctime;
        struct timespec st_ex_btime; /* birthtime */
        blksize_t       st_ex_blksize;
        blkcnt_t        st_ex_blocks;
};
typedef struct stat_ex SMB_STRUCT_STAT;

It is really large because due to the friendly libc headers playing macro
tricks with fields like st_ino, so I renamed them to st_ex_xxx.

Why this change? To support birthtime, we already have quite a few #ifdef's at
places where it does not really belong. With a stat struct that we control, we
can consolidate the nanosecond timestamps and the birthtime deep in the VFS
stat calls.

At this moment it is triggered by a request to support the birthtime field for
GPFS. GPFS does not extend the system level struct stat, but instead has a
separate call that gets us the additional information beyond posix. Without
being able to do that within the VFS stat calls, that support would have to be
scattered around the main smbd code.

It will very likely break all the onefs modules, but I think the changes will
be reasonably easy to do.
2009-05-26 17:48:23 +02:00
Tim Prouty
c1a21d085d s3: Change unix_convert (and its callers) to use struct smb_filename
This is the first of a series of patches that change path based
operations to operate on a struct smb_filename instead of a char *.
This same concept already exists in source4.

My goals for this series of patches are to eventually:

1) Solve the stream vs. posix filename that contains a colon ambiguity
   that currently exists.
2) Make unix_convert the only function that parses the stream name.
3) Clean up the unix_convert API.
4) Change all path based vfs operation to take a struct smb_filename.
5) Make is_ntfs_stream_name() a constant operation that can simply
   check the state of struct smb_filename rather than re-parse the
   filename.
6) Eliminate the need for split_ntfs_stream_name() to exist.

My strategy is to start from the inside at unix_convert() and work my
way out through the vfs layer, call by call.  This first patch does
just that, by changing unix_convert and all of its callers to operate
on struct smb_filename.  Since this is such a large change, I plan on
pushing the patches in phases, where each phase keeps full
compatibility and passes make test.

The API of unix_convert has been simplified from:

NTSTATUS unix_convert(TALLOC_CTX *ctx,
		      connection_struct *conn,
		      const char *orig_path,
		      bool allow_wcard_last_component,
		      char **pp_conv_path,
		      char **pp_saved_last_component,
		      SMB_STRUCT_STAT *pst)
to:

NTSTATUS unix_convert(TALLOC_CTX *ctx,
		      connection_struct *conn,
		      const char *orig_path,
		      struct smb_filename *smb_fname,
		      uint32_t ucf_flags)

Currently the smb_filename struct looks like:

struct smb_filename {
       char *base_name;
       char *stream_name;
       char *original_lcomp;
       SMB_STRUCT_STAT st;
};

One key point here is the decision to break up the base_name and
stream_name.  I have introduced a helper function called
get_full_smb_filename() that takes an smb_filename struct and
allocates the full_name.  I changed the callers of unix_convert() to
subsequently call get_full_smb_filename() for the time being, but I
plan to eventually eliminate get_full_smb_filename().
2009-05-20 17:40:15 -07:00
Günther Deschner
652251701d s3-printing: no need to define struct table_node 4 times.
Guenther
2009-05-13 15:27:06 +02:00
Günther Deschner
7403dd39d6 s3-spoolss: move SPL_ARCH_X defines to IDL.
Guenther
2009-05-13 01:56:40 +02:00
Günther Deschner
baf7850689 s3-printing: rework move_driver_file_to_download_area() a bit for clarity.
Guenther
2009-04-30 17:33:07 +02:00
Günther Deschner
233bfb25c9 s3-printing: use move_driver_file_to_download_area() to avoid code duplication.
Guenther
2009-04-30 11:22:23 +02:00
Günther Deschner
a2a155bee5 s3-printing: add move_driver_file_to_download_area().
Guenther
2009-04-30 11:22:23 +02:00
Michael Adam
a94bd62d28 s3:nt_printing: fix a comment typo
Michael
2009-04-27 18:17:27 +02:00
Michael Adam
8185d31fb0 s3:registry: replace typedef REGISTRY_VALUE by struct regval_blob
Michael
2009-04-27 11:21:03 +02:00
Michael Adam
221151a2a2 s3:registry: replace typedef REGVAL_CTR by struct regval_ctr.
This paves the way for hiding the typedef and the implementation
from the surface.

Michael
2009-04-27 11:21:02 +02:00
Günther Deschner
62480385c1 s3-printing: use ARRAY_SIZE() macro in forms functions.
Guenther
2009-04-20 01:06:01 +02:00
Günther Deschner
d9aaf3759a s3-printing: use sec_initial_uid() instead "0" in print_access_check().
Another babystep in order to make us pass RPC-SPOOLSS.

Guenther
2009-04-20 00:59:36 +02:00
Günther Deschner
e3ceb0c653 s3-spoolss: remove unused dup_nt_devicemode().
Guenther
2009-04-14 12:13:17 +02:00
Günther Deschner
d71dec9259 s3-libads: avoid NULL talloc context with ads_get_dn().
Guenther
2009-04-07 01:17:30 +02:00
Andrew Bartlett
2050187673 s3:libads Make ads_get_dn() take a talloc context
Also remove ads_memfree(), which was only ever a wrapper around
SAFE_FREE, used only to free the DN from ads_get_ds().

This actually makes libgpo more consistant, as it mixed a talloc and a
malloc based string on the same element.

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2009-04-06 15:54:41 +02:00
Andrew Bartlett
89278b1819 s3:printing Convert nt_printer_publish_ads() to use talloc better
In particular, this removes one more user of pull_utf8_allocate()

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2009-04-06 14:56:29 +02:00
Günther Deschner
5a388115a9 s3-spoolss: apply some const in spoolss server.
Guenther
2009-03-20 17:20:32 +01:00
Günther Deschner
b0747651b9 s3-printing: use marshall/unmarshall_sec_desc_buf in sec_desc_upg_fn().
Guenther
2009-03-18 13:06:24 +01:00
Günther Deschner
47c024fd75 s3-spoolss: rename temporary convert_devicemode_new function.
Guenther
2009-03-17 18:39:17 +01:00
Günther Deschner
04fd767c0b s3-spoolss: remove obsolete get_a_builtin_ntform.
Guenther
2009-03-17 10:37:53 +01:00
Günther Deschner
670a22852c s3-spoolss: use DSPRINT flags instead of SPOOLS_DS flags.
Guenther
2009-02-27 13:33:15 +01:00
Jeremy Allison
15f108f091 Fix some NetBSD warnings.
Jeremy.
2009-02-25 09:59:53 -08:00
Günther Deschner
e1749a1f78 s3-spoolss: use marshall/unmarshall_sec_desc_buf in nt_printing_setsec/getsec.
Guenther
2009-02-24 12:41:21 +01:00
Günther Deschner
dfa559145c s3-spoolss: remove whitespace in printing code.
Guenther
2009-02-09 12:42:42 +01:00
Günther Deschner
894d05bc41 s3-spoolss: restore delete_a_form().
Guenther
2009-02-09 10:42:46 +01:00
Günther Deschner
9ef58a9196 s3-spoolss: use pidl for _spoolss_SetForm.
Guenther
2009-02-09 10:42:33 +01:00
Günther Deschner
3a1f9411e5 s3-spoolss: use pidl for spoolss_AddForm.
Guenther
2009-02-09 10:42:12 +01:00
Günther Deschner
b56c5bf510 s3-spoolss: rework some form functions and add form_by_string functions.
Guenther
2009-02-07 01:52:28 +01:00
Michael Adam
166ffc0d0d s3: put printing/ under cache_dir, not lock_dir
Michael
2009-01-16 01:02:24 +01:00
Jelmer Vernooij
08259c1c52 Add iconv_convenience argument to size functions. 2009-01-01 04:45:33 +01:00
Jeremy Allison
d0eeb9aa8d Fix more asprintf warnings and some error path errors.
Jeremy.
2008-12-23 12:11:12 -08:00
Jeremy Allison
b143938b8a Fix more asprintf errors and error code paths.
Jeremy.
2008-12-23 11:27:19 -08:00
Tim Prouty
5844012285 s3: Change SMB_VFS_CREATE_FILE to take a create_file_flags argument
This replaces the is_dos_path bool with a more future-proof argument.
The next step is to plumb INTERNAL_OPEN_ONLY through this flag instead
of overridding the oplock_request.
2008-12-03 17:51:44 -08:00
Tim Prouty
08ce060475 s3: Modify direct callers of open_file_ntcreate and open_directory to call SMB_VFS_CREATE_FILE 2008-12-03 17:51:16 -08:00
Volker Lendecke
c25f5c778a Convert delete_driver_files to use create_conn_struct
Jerry, please check!
2008-11-24 11:39:03 +01:00
Volker Lendecke
cb4f8573ba Convert get_correct_cversion to use create_conn_struct
Jerry, please check!
2008-11-24 11:39:03 +01:00
Volker Lendecke
783ab0480b Convert move_driver_to_download_area to use create_conn_struct
This removes a use of struct current_user and the vuid

The become_user() here is unnecessary, within the spoolss handling code we have
switched to the authenticated pipe user anyway.

Jerry, please check!
2008-11-24 11:39:03 +01:00
Volker Lendecke
c6973e69b7 Remove an unused variable 2008-11-02 09:40:30 +01:00
Jelmer Vernooij
ddcab787c4 Rename dos_errstr() to win_errstr() for consistency with Samba 4. 2008-11-01 17:19:26 +01:00
Jeremy Allison
8344e94574 Unify se_access_check with the S4 code. Will make
calculation of SEC_FLAG_MAXIMUM_ALLOWED much easier
for files.
Jeremy.
2008-10-31 10:51:45 -07:00
Jeremy Allison
7c53ffea28 Allow a new file to inherit the Windows ACL from its parent.
Now to do the same for directories.
Jeremy.
2008-10-29 13:27:14 -07:00
Jelmer Vernooij
f0c4829e82 Remove silly safe_free() function which is a wrapper around SAFE_FREE().
Since it's a function it just sets the local pointer to NULL and basically
is an equivalent to free().

It also claims it's being used for callbacks but isn't used that way
anywhere.
2008-10-19 13:06:14 +02:00
Jelmer Vernooij
a62c510d8b Use GUID_from_string. 2008-10-14 02:33:41 +02:00
Jelmer Vernooij
1f3e4f39c5 Use GUID_string rather than smb_uuid_string(). 2008-10-14 02:26:18 +02:00
Volker Lendecke
c530009401 Pass struct smb_request to file_free
on the way to get rid of chain_fsp
2008-10-13 19:32:38 +02:00
Jelmer Vernooij
1b99d8fbb5 Use common util_file code. 2008-10-12 17:34:43 +02:00
Jeremy Allison
e5692d4cbe Remove SEC_ACCESS. It's a uint32_t.
Jeremy.
2008-10-09 09:49:03 -07:00
Jeremy Allison
c383e8d760 Ensure we null out fsp after a close in all paths.
Jeremy.
2008-09-29 10:57:22 -07:00
Jelmer Vernooij
55e201b0a1 Avoid freeing fsp twice when opening new_file fails. (Debian #431696)
If opening new_file fails, fsp would still be set to the files_struct of
old_file.
2008-09-29 19:09:53 +02:00
Volker Lendecke
44e9a2bb9a remove unused extern current_user from nt_printing.c
(This used to be commit b34283adef)
2008-06-26 13:13:23 +02:00
Volker Lendecke
a3c0be6325 Change print_access_check to take auth_serversupplied_info instead of current_user
Reason: This is the main user of p->current_user which I would like to remove
(This used to be commit fd43059b3d)
2008-06-26 13:13:23 +02:00
Volker Lendecke
320fadd8fc Remove the reference to current_user_info from share_access.c
This required to pass around the domain a bit
(This used to be commit 17b0db20d2)
2008-05-25 11:43:57 +02:00
Tim Prouty
fb37f15600 Cleanup size_t return values in callers of convert_string_allocate
This patch is the second iteration of an inside-out conversion to cleanup
functions in charcnv.c returning size_t == -1 to indicate failure.
(This used to be commit 6b189dabc5)
2008-05-20 22:40:13 +02:00
Jeremy Allison
fbc780b604 Try and fix bug #5095, "Manage Documents privilege is not functional".
Should map the created sd to printer jobs, not printer.
Jerry please test and I'll add to 3.2 if it passes. Thanks,
Jeremy.
(This used to be commit 0a1fe8d601)
2008-05-05 16:24:52 -07:00
Jeremy Allison
501562f15c Fix from Martin Zielinski <mz@seh.de>. Don't delete files when
they're in use by other drivers.
Jeremy.
(This used to be commit 205c352cae)
2008-04-24 15:02:23 -07:00
Jeremy Allison
40d16fa275 Fix bug #5372. With a large CUPS installation with a remote server, contacting
the server when searching for a name for the location and comment fields can
take so much time the client times out. When searching for a name we don't
use these fields anyway, so add a function get_a_printer_search() which
doesn't contact the CUPS server.
Jeremy.
(This used to be commit 92d9f20852)
2008-04-04 11:14:09 -07:00
Volker Lendecke
c5356479c1 Some simplifications
(This used to be commit b59b436997)
2008-03-17 21:10:16 +01:00
Marc VanHeyningen
e06aa46b9f Coverity fixes
(This used to be commit 3fc85d2259)
2008-03-17 20:52:25 +01:00
Volker Lendecke
594a164548 Fix a crash bug in nt_printer_publish_ads
Reported by Martin Zielinski <mz@seh.de>
(This used to be commit 4db26c803d)
2008-01-16 11:39:20 +01:00
Jeremy Allison
23aab9dab7 Fix CID 498. Ensure we don't prs_mem_free an uninitialized
prs_struct.
Jeremy.
(This used to be commit 7b9d9fba23)
2008-01-11 23:24:13 -08:00
Michael Adam
87a684f7fc Remove redundant parameter fd from SMB_VFS_FSTAT().
Michael
(This used to be commit 0b86c420be)
2008-01-07 15:59:01 +01:00
Michael Adam
6f657c873e Remove redundant parameter fd from SMB_VFS_LSEEK().
Michael
(This used to be commit df929796f2)
2008-01-07 15:59:01 +01:00
Jeremy Allison
9254bb4ef1 Refactor the crypto code after a very helpful conversation
with Volker. Mostly making sure we have data on the incoming
packet type, not stored in the smb header.
Jeremy.
(This used to be commit c4e5a50504)
2008-01-04 12:56:23 -08:00
Volker Lendecke
7cbdb48475 Remove tiny code duplication
ndr_size_security_descriptor does the same as sec_desc_size
(This used to be commit bc3bd7a8e7)
2007-12-29 23:13:26 +01:00
Jeremy Allison
7326612cfd Two more static fstrings gone.
Jeremy.
(This used to be commit 4056bb8645)
2007-12-18 18:16:40 -08:00
Volker Lendecke
900288a2b8 Replace sid_string_static by sid_string_dbg in DEBUGs
(This used to be commit bb35e794ec)
2007-12-15 22:09:36 +01:00
Jeremy Allison
b9342eaaa6 Remove unused wpstring and macros. Stop using pstrcpy in smbd/*.c
Jeremy.
(This used to be commit e72bce5b62)
2007-12-03 15:19:22 -08:00
Jeremy Allison
bcf033b38e Change tdb_unpack "P" to return a malloc'ed string rather
than expect a pstring space to put data into.
Fix the (few) callers.
Jeremy.
(This used to be commit 7722a7d2c6)
2007-12-03 14:54:06 -08:00
Volker Lendecke
1011b32678 Remove some statics
(This used to be commit 1fab16ffb8)
2007-11-27 14:18:47 +01:00
Jeremy Allison
01acd4bb38 Remove pstring from printing/*.c except for the
tdb_unpack requirement (I'll be making that an
allocating interface later).
Jeremy.
(This used to be commit d2ee75326a)
2007-11-21 13:56:36 -08:00
Jeremy Allison
68be9a8200 More pstring removal. This one was tricky. I had to add
one horror (pstring_clean_name()) which will have to
remain until I've removed all pstrings from the client code.
Jeremy.
(This used to be commit 1ea3ac8014)
2007-11-15 14:19:52 -08:00
Jeremy Allison
214bb0f119 Fix case where we have no dns domain name. Return a talloc of "".
Jeremy.
(This used to be commit ab8934844a)
2007-11-08 17:58:55 -08:00
Jeremy Allison
d40e47db4b Remove more fstring/pstring bad useage. Go talloc !
Jeremy.
(This used to be commit 2a0173743d)
2007-11-08 17:25:45 -08:00
Gerald (Jerry) Carter
88ee61625a Patch 2 of 3 from Debian Samba packagers:
The point is doing the following associations:

- non discardable state data (all TDB files that may need to be backed
  up) go to statedir
- shared data (codepage stuff) go to codepagedir

The patch *does not change* the default location for these
directories. So, there is no behaviour change when applying it.

The main change is for samba developers who have to think when dealing
with files that previously pertained to libdir whether they:
- go in statedir
- go in codepagedir
- stay in libdir
(This used to be commit d6cdbfd875)
2007-11-01 15:53:44 -04:00
Jeremy Allison
30191d1a57 RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed
BOOL == int). I also need to fix the Samba4 pidl generation
(next checkin).
Jeremy.
(This used to be commit f35a266b3c)
2007-10-18 17:40:25 -07:00
Volker Lendecke
0ebab65706 r25534: Apply some const
Why? It moves these structs from the data into the text segment, so they
will never been copy-on-write copied. Not much, but as in German you say
"Kleinvieh macht auch Mist...."
(This used to be commit 0141e64ad4)
2007-10-10 12:31:12 -05:00
Michael Adam
c97fe37ea3 r25294: Tidy up callers of unistr2_to_ascii() to pass sizeof(target_area) to
the maxeln parameter instead of sizeof(target_area) - 1 (or even
sizeof(fstring) - 1 in some places.

I hope these were really all there were.

Michael
(This used to be commit 9a28be220d)
2007-10-10 12:30:58 -05:00
Jeremy Allison
eacd314057 r25138: More pstring elimination. Add a TALLOC_CTX parameter
to unix_convert().
Jeremy.
(This used to be commit 39c211a702)
2007-10-10 12:30:44 -05:00
Jeremy Allison
12f61e09d9 r25117: The mega-patch Jerry was waiting for. Remove all pstrings from
the main server code paths. We should now be able to cope with
paths up to PATH_MAX length now.
Final job will be to add the TALLOC_CTX * parameter to
unix_convert to make it explicit (for Volker).
Jeremy.
(This used to be commit 7f0db75fb0)
2007-10-10 12:30:41 -05:00
Jeremy Allison
132ee3990a r25009: Large patch discussed with Volker. Move unix_convert to a talloc-based
interface. More development will come on top of this. Remove the
"mangled map" parameter.
Jeremy.
(This used to be commit dee8beba7a)
2007-10-10 12:30:32 -05:00
Stefan Metzmacher
809c9d4d31 r23888: move elements belonging to the current ldap connection to a
substructure.

metze
(This used to be commit 00909194a6)
2007-10-10 12:28:38 -05:00
Andrew Tridgell
153cfb9c83 r23801: The FSF has moved around a lot. This fixes their Mass Ave address.
(This used to be commit 87c91e4362)
2007-10-10 12:28:27 -05:00
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
Volker Lendecke
0bc56a2e5f r23724: Reduce access to the global inbuf a tiny bit. Add a struct smb_request
that contains some of the fields from the SMB header, removing the need
to access inbuf directly. This right now is used only in the open file
code & friends, and creating that header is only done when needed. This
needs more work, but it is a start.

Jeremy, I'm only checking this into 3_0, please review before I merge it
to _26.

Volker
(This used to be commit ca988f4e79)
2007-10-10 12:23:48 -05:00
Volker Lendecke
e95942ed84 r22954: More messaging_register
(This used to be commit 9b8df24107)
2007-10-10 12:22:11 -05:00
Volker Lendecke
b4a7b7a888 r22844: Introduce const DATA_BLOB data_blob_null = { NULL, 0, NULL }; and
replace all data_blob(NULL, 0) calls.
(This used to be commit 3d3d61687e)
2007-10-10 12:22:01 -05:00
Günther Deschner
3e8283cf7c r22524: Fix memleak.
Guenther
(This used to be commit e55c52f654)
2007-10-10 12:19:42 -05:00
Stefan Metzmacher
bc2b6436d0 r22009: change TDB_DATA from char * to unsigned char *
and fix all compiler warnings in the users

metze
(This used to be commit 3a28443079)
2007-10-10 12:19:00 -05:00
Stefan Metzmacher
110980d771 r21989: make use of tdb_*_bystring() and string_term_tdb_data()
to avoid creating the TDB_DATA struct from strings "by hand"

metze
(This used to be commit 1897da9efc)
2007-10-10 12:18:57 -05:00
Stefan Metzmacher
a806037b87 r21987: split tdb_prs_*() functions in version which take a keystr and a TDB_DATA key
metze
(This used to be commit 724c6fa337)
2007-10-10 12:18:56 -05:00
Gerald Carter
1899c834f0 r21875: BUG 3275: Patch from Andy Polyakov <appro@fy.chalmers.se>
Relax check for i386 header checks in the PE header of printer
driver files.  Thus allowing uploading of x64 print drivers
from 64bit Windows clients.
(This used to be commit 328807ec7b)
2007-10-10 12:18:42 -05:00
Gerald Carter
2d30923864 r21862: add the cups comment and location lookup to get_a_printer_2_default() as well
(This used to be commit 5b47c4e5c2)
2007-10-10 12:18:39 -05:00