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

927 Commits

Author SHA1 Message Date
Andrew Tridgell
7cff685c7e s3: convert registry and printing code to TYPESAFE_QSORT() 2010-02-14 18:44:21 +11:00
Jeremy Allison
9252df53d9 Use sec_initial_uid() in the places where being root doesn't matter,
and 0 in the places where it does.

Jeremy
2010-02-12 23:18:53 -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
Volker Lendecke
b1a0c68ff2 s3: "print_job_end" only looks at the size 2009-11-29 11:22:03 +01:00
Volker Lendecke
44ce5603dd s3: Pass the "fake dir create times" parameter to sys_*stat
Step 0 to restore it as a per-share paramter
2009-11-29 11:22:01 +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
Jeremy Allison
a770caed0f Remove "store create time" code, cause create time to be stored
in the "user.DOSATTRIB" EA. From the docs:
In Samba 3.5.0 and above the "user.DOSATTRIB" extended attribute has been extended to store
the create time for a file as well as the DOS attributes. This is done in a backwards compatible
way so files created by Samba 3.5.0 and above can still have the DOS attribute read from this
extended attribute by earlier versions of Samba, but they will not be able to read the create
time stored there. Storing the create time separately from the normal filesystem meta-data
allows Samba to faithfully reproduce NTFS semantics on top of a POSIX filesystem.
Passes make test but will need more testing.
Jeremy.
2009-11-17 14:55:02 -08: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
Tim Prouty
c9b8a01714 s3: Finish plumbing the fsp->fsp_name smb_fname conversion through the modules. 2009-07-20 17:26:57 -07:00
Günther Deschner
2579afc897 s3-vlp: drastically shrink size and dependencies of the virtual line printer.
This gets vlp from 13M down to 214K on my box.

Guenther
2009-06-26 09:34:02 +02: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
Aravind Srinivasan
5a4d618109 s3: forward MSG_DEBUG from smbd parent to all children
Before 3.3, an smbcontrol debug message sent to the target "smbd" would
actually be sent to all running processes including nmbd and winbindd.
This behavior was changed in 3.3 so that the "smbd" target would only
send a message to the process found in smbd.pid, while the "all" target
would send a message to all processes.

The ability to set the debug level of all processes within a single
daemon, without specifying each pid is quite useful.  This was implemented
in winbindd in 065760ed.  This patch does the same thing for smbd.

Upon receiving a MSG_DEBUG the parent smbd will rebroadcast it to all of
its children.

The printing process has been added to the list of smbd child processes,
and we now always track the number of smbd children regardless of the
"max smbd processes" setting.
2009-06-22 19:09:37 -07:00
Jeremy Allison
271d09f599 Fix coverity #740. Resource leak in error paths. We should
always return queue here as the caller will free.
Jeremy.
2009-06-19 17:20:00 -07: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
Marc VanHeyningen
a4887e250b s3: Allow child processes to exit gracefully if we are out of fds
When we run out of file descriptors for some reason, every new
connection forks a child that immediately panics causing smbd to
coredump.  This seems unnecessarily harsh; with this code change we
now catch that error and merely log a message about it and exit
without the core dump.

Signed-off-by: Tim Prouty <tprouty@samba.org>
2009-05-27 13:16:17 -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
94665adb48 s3-printing: Fix vlp testprinter application.
Jeremy, we cannot just access cache_path() here without calling lp_load and
friends as well as parsing configfile from the commandline in order to make
"make test/selftest" find the correct conffile with path, etc.

I just changed it to pass the target tdbfilename as an argument, ok ?

Guenther
2009-05-12 11:41:14 +02:00
Jeremy Allison
14c1e9fae2 Hopefully fix the buildfarm. Add some debug level 10 messages
I used to track down the vlp problem, change the vlp test printer
not to use a static path of /tmp/vlp.tdb for the virtual print
database (as this will eventually fill up). Cause it to use
a virtual print database inside the cachepath.
Jeremy.
2009-05-11 17:29:48 -07:00
Günther Deschner
9966541f89 s3-printing: simplify print_queue helper functions and return WERROR.
Guenther
2009-05-06 10:19:04 +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
Jelmer Vernooij
4c32978d97 Remove smb_mkstemp() - libreplace will now provide a secure mkstemp() if
the system one is broken.
2009-04-20 23:58:26 +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
Björn Jacke
4b184eaea1 s3/cups: add encryption support 2009-03-30 11:11:19 +02:00