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

193 Commits

Author SHA1 Message Date
Kai Blin
61a2ad3c02 swat: Remove swat.
Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Kai Blin <kai@samba.org>
Autobuild-Date(master): Sat May 18 16:32:38 CEST 2013 on sn-devel-104
2013-05-18 16:32:38 +02:00
Rusty Russell
fe72740e82 loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.
They use talloc_tos() internally: hoist that up to the callers, some
of whom don't want to us talloc_tos().

A simple patch, but hits a lot of files.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 15:07:23 +09:30
Andrew Bartlett
b74fe73a6f build: Remove sys_fopen wrapper 2012-04-05 02:39:08 +02:00
Jeremy Allison
959516d61b More strlcat/strlcpy truncate checks. 2012-03-30 21:26:07 +02:00
Andrew Bartlett
39ee332f35 param: handle P_BYTES in more places 2012-01-21 11:32:06 +01:00
Stefan Metzmacher
ef45279f5e s3:web/swat: use short term event and message contexts
swat doesn't have a central event loop.

metze
2011-12-14 12:00:06 +01:00
Stefan Metzmacher
a6be0820d0 s3:web/swat: use strtoll() instead of atoi/atol/atoll
This is more portable, as we have a strtoll replacement
in lib/replace.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sat Aug  6 11:55:45 CEST 2011 on sn-devel-104
2011-08-06 11:55:45 +02:00
Björn Jacke
d3b4d75364 s3/swat: use strlcat instead of strncat to fix build on old Linux distros
SLES 9's glibc for example had weird macros where the use of strncat resulted
in the use of strcat which we don't allow.

Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Björn Jacke <bj@sernet.de>
Autobuild-Date: Thu Aug  4 17:50:24 CEST 2011 on sn-devel-104
2011-08-04 17:50:24 +02:00
Kai Blin
52d2ba7103 s3 swat: Add time component to XSRF token
Signed-off-by: Kai Blin <kai@samba.org>
2011-07-26 22:22:25 +02:00
Kai Blin
b5d63c3c11 s3 swat: Add XSRF protection to printer page
Signed-off-by: Kai Blin <kai@samba.org>
2011-07-26 22:22:25 +02:00
Kai Blin
072c199180 s3 swat: Add XSRF protection to password page
Signed-off-by: Kai Blin <kai@samba.org>
2011-07-26 22:22:25 +02:00
Kai Blin
c02df79f61 s3 swat: Add XSRF protection to shares page
Signed-off-by: Kai Blin <kai@samba.org>
2011-07-26 22:22:25 +02:00
Kai Blin
68f8924c7c s3 swat: Add XSRF protection to globals page
Signed-off-by: Kai Blin <kai@samba.org>
2011-07-26 22:22:25 +02:00
Kai Blin
99fa6b386a s3 swat: Add XSRF protection to wizard page
Signed-off-by: Kai Blin <kai@samba.org>
2011-07-26 22:22:25 +02:00
Kai Blin
ab98edd79d s3 swat: Add XSRF protection to wizard_params page
Signed-off-by: Kai Blin <kai@samba.org>
2011-07-26 22:22:25 +02:00
Kai Blin
00d255fc1d s3 swat: Add XSRF protection to viewconfig page
Signed-off-by: Kai Blin <kai@samba.org>
2011-07-26 22:22:25 +02:00
Kai Blin
c379b3623a s3 swat: Add support for anti-XSRF token 2011-07-26 22:22:25 +02:00
Karolin Seeger
cc86a11b9e s3-swat: Fix typo.
Thanks to Simo for reporting!

Karolin
(cherry picked from commit 9f73c1990a)
(cherry picked from commit bcb052c292)
2011-07-26 22:22:25 +02:00
Kai Blin
dc50cf38c1 s3 swat: Fix possible XSS attack (bug #8289)
Nobuhiro Tsuji of NTT DATA SECURITY CORPORATION reported a possible XSS attack
against SWAT, the Samba Web Administration Tool. The attack uses reflection to
insert arbitrary content into the "change password" page.

This patch fixes the reflection issue by not printing user-specified content on
the website anymore.

Signed-off-by: Kai Blin <kai@samba.org>
2011-07-26 22:22:25 +02:00
Jeremy Allison
ee34c25c8a First part of fix for bug 8310 - toupper_ascii() is broken on big-endian systems
Remove
int toupper_ascii(int c);
int tolower_ascii(int c);
int isupper_ascii(int c);
int islower_ascii(int c);

and replace with their _m equivalents, as they are identical.
2011-07-19 13:19:29 -07:00
Andrew Bartlett
d4ef70a764 param: Finish conversion from lp_wins_support() -> lp_we_are_a_wins_server()
Jermey started this in 1997 with 0aa493cc03

(avoiding the duplicate function makes it easier to generate the
struct loadparm_globals).

Andrew Bartlett
2011-07-02 12:31:34 +10:00
Andrew Bartlett
489f528857 param: Merge param headers into lib/param/loadparm.h
This defines a common table format, so we can in future define a
common table.

Andrew Bartlett
2011-06-29 15:44:09 +10:00
Andrew Bartlett
e63d5d2cd5 s3-param use lp_parm_ptr() rather than parm.ptr directly
This will help with a change from .ptr to .offset

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Jun 29 03:26:21 CEST 2011 on sn-devel-104
2011-06-29 03:26:21 +02:00
Andrew Bartlett
3d15137653 s3-talloc Change TALLOC_ARRAY() to talloc_array()
Using the standard macro makes it easier to move code into common, as
TALLOC_ARRAY isn't standard talloc.
2011-06-09 12:40:08 +02:00
Jeremy Allison
f85e095dd2 More simple const fixups. 2011-05-05 23:56:08 +02:00
Günther Deschner
6b76909f5e s3-build: only include intl protos where needed.
Guenther
2011-03-30 01:13:08 +02:00
Günther Deschner
235f148590 s3-passdb: use passdb headers where needed.
Guenther
2011-03-30 01:13:08 +02:00
Günther Deschner
0e771263ee s3-includes: only include system/filesys.h when needed.
Guenther
2011-03-30 01:13:07 +02:00
Andrew Tridgell
c8297073db s3-fault: removed the cont_fn from fault_setup()
cont_fn() was supposed to be a way to continue after a seg fault. It
could never be called however, as smb_panic() from fault_report()
could never return, as dump_core() never returns at the end of
smb_panic()

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Tue Mar 22 05:07:58 CET 2011 on sn-devel-104
2011-03-22 05:07:58 +01:00
Günther Deschner
8225c0ad6c s3-printing: only include printing where really needed.
Guenther
2011-02-22 21:52:18 +01:00
David Disseldorp
0b188e7784 s3-printing: Initiate pcap reload from parent smbd
Since commit 7022554, smbds share a printcap cache (printer_list.tdb),
therefore ordering of events between smbd processes is important when
updating printcap cache information. Consider the following two process
example:
1) smbd1 receives HUP or printcap cache time expiry
2) smbd1 checks whether pcap needs refresh, it does
3) smbd1 marks pcap as refreshed
4) smbd1 forks child1 to obtain cups printer info
5) smbd2 receives HUP or printcap cache time expiry
6) smbd2 checks whether pcap needs refresh, it does not (due to step 3)
7) smbd2 reloads printer shares prior to child1 completion (stale pcap)
8) child1 completion, pcap cache (printer_list.tdb) is updated by smbd1
9) smbd1 reloads printer shares based on new pcap information

In this case both smbd1 and smbd2 are reliant on the pcap update
performed on child1 completion.
The prior commit "reload shares after pcap cache fill" ensures that
smbd1 only reloads printer shares following pcap update, however smbd2
continues to present shares based on stale pcap data.

This commit addresses the above problem by driving pcap cache and
printer share updates from the parent smbd process.
1) smbd0 (parent) receives a HUP or printcap cache time expiry
2) smbd0 forks child0 to obtain cups printer info
3) child0 completion, pcap cache (printer_list.tdb) is updated by smbd0
4) smbd0 reloads printer shares
5) smbd0 notifies child smbds of pcap update via message_send_all()
6) child smbds read fresh pcap data and reload printer shares

This architecture has the additional advantage that only a single
process (the parent smbd) requests printer information from the printcap
backend.

Use time_mono in housekeeping functions As suggested by Björn Jacke.
2011-01-07 15:37:39 -08:00
David Disseldorp
04248c2cfa s3-printing: reload shares after pcap cache fill
Since commit eada8f8a, updates to the cups pcap cache are performed
asynchronously - cups_cache_reload() forks a child process to request
cups printer information and notify the parent smbd on completion.

Currently printer shares are reloaded immediately following the call to
cups_cache_reload(), this occurs prior to smbd receiving new cups pcap
information from the child process. Such behaviour can result in stale
print shares as outlined in bug 7836.

This fix ensures print shares are only reloaded after new pcap data has
been received.

Pair-Programmed-With: Lars Müller <lars@samba.org>
2011-01-07 15:37:39 -08:00
Andrew Bartlett
ed111d11eb s3-debug Move 'load_case_tables()' before lp_set_cmdline() and popt calls
The problem here is that we cannot run lp_set_cmdline() (directly or
indirectly via the popt helpers) until load_case_tables() has been run.

However, load_case_tables does not have auto-initialisation, so we
must init it once, and once only.

Andrew Bartlett
2010-11-02 04:36:04 +00:00
Andrew Bartlett
9da4ace1d9 s3-debug Impove setup_logging() to specify logging to stderr
This change improves the setup_logging() API so that callers which
wish to set up logging to stderr can simply ask for it, rather than
directly modify the dbf global variable.

Andrew Bartlett
2010-11-02 04:36:04 +00:00
Volker Lendecke
016418d6c2 s3: Remove the smbd_messaging_context from load_printers 2010-08-08 23:37:47 +02:00
Andreas Schneider
ce2a086119 s3-popt: Only include popt-common.h when needed. 2010-08-05 12:08:31 +02:00
Volker Lendecke
b4bce76776 s3: Fix bug 6288 2009-11-30 10:43:23 +01:00
Volker Lendecke
4e9d95c1e7 s3: Fix some nonempty blank lines 2009-11-29 23:42:41 +01:00
Andrew Bartlett
3b3e21bd9b Convert Samba3 to use the common lib/util/charset API
This removes calls to push_*_allocate() and pull_*_allocate(), as well
as convert_string_allocate, as they are not in the common API

To allow transition to a common charcnv in future, provide Samba4-like
strupper functions in source3/lib/charcnv.c

(the actual implementation remains distinct, but the API is now shared)

Andrew Bartlett
2009-04-14 12:53:56 +10:00
Volker Lendecke
db955fa7b9 s3/swat: Fix creation of the first share using SWAT.
This fixes bug #5965.
2009-01-06 15:15:59 +01:00
Jeremy Allison
9eab2bfaf1 Fix more "ignore return value" warnings from gcc 4.3.
Jeremy
2008-12-30 18:24:39 -08:00
Michael Adam
91c543f0b5 s3:loadparm: rename lp_local_ptr() to lp_local_ptr_by_snum()
Michael
2008-12-15 14:16:06 +01:00
Jelmer Vernooij
89c9545430 Use str_list_equal() rather than str_list_compare(). 2008-10-18 15:56:07 +02:00
Jelmer Vernooij
2d89b52be8 Use separate make variables for libutil and libcrypto. 2008-10-18 14:28:40 +02:00
Jeremy Allison
24eec914c0 Fix swat. Bug #5613.
Jeremy
(This used to be commit 15920f8388)
2008-07-15 14:37:48 -07:00
Andreas Schneider
8c7e21679b Fix empty input fields in SWAT; [#5515].
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(This used to be commit e1579c90fb)
2008-06-03 15:35:41 +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
Michael Adam
9644b6cb50 Add a talloc context parameter to current_timestring() to fix memleaks.
current_timestring used to return a string talloced to talloc_tos().
When called by DEBUG from a TALLOC_FREE, this produced messages
"no talloc stackframe around, leaking memory". For example when
used from net conf.

This also adds a temporary talloc context to alloc_sub_basic().
For this purpose, the exit strategy is slightly altered: a common
exit point is used for success and failure.

Michael
(This used to be commit 16b5800d4e)
2008-03-28 16:34:51 +01:00
Michael Adam
90fd5082a2 loadparm: add convenience wrapper lp_kill_all_services()
Michael
(This used to be commit 32bfd131e3)
2008-03-12 02:12:34 +01:00
Jeremy Allison
7faee02d0d Remove the char[1024] strings from dynconfig. Replace
them with malloc'ing accessor functions. Should save a
lot of static space :-).
Jeremy.
(This used to be commit 52dc5eaef2)
2007-12-10 11:30:37 -08:00