1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
Commit Graph

4443 Commits

Author SHA1 Message Date
Andreas Schneider
088db7f7b5 swrap: Fix type punning warnings when loading functions.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-02 09:35:10 +02:00
Andreas Schneider
b3c72e151f swrap: Fix access to struct members in log messages.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-02 09:35:10 +02:00
Andreas Schneider
9ba259e68a swrap: Fix whitespace errors.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-02 09:35:10 +02:00
Andreas Schneider
a504686566 swrap: Update copyright notice.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-02 09:35:10 +02:00
Andreas Schneider
9731516e7f swrap: Wrap fopen to detect stale file descriptors.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-02 09:35:10 +02:00
Andreas Schneider
f8584abfef swrap: Use swrap_address in swrap_accept().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-02 09:35:10 +02:00
Andreas Schneider
891e837c3c swrap: Remove unused sockaddr_dup() function.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-02 09:35:10 +02:00
Andreas Schneider
8897474865 swrap: Use swrap_address in the socket_info struct.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-02 09:35:10 +02:00
Andreas Schneider
4402ba10b5 swrap: Use a sockaddr_un for the unix path in socket_info.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-02 09:35:10 +02:00
Andreas Schneider
9da1ff9ad1 swrap: Rename swrap_pcap_dump_packet().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-02 09:35:10 +02:00
Andreas Schneider
79e545b304 swrap: Rename swrap_pcap_get_fd().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-02 09:35:10 +02:00
Andreas Schneider
7d4c6cf25d swrap: Rename swrap_marshall_packet().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-02 09:35:10 +02:00
Andreas Schneider
e64ea9cb79 swrap: Rename swrap_packet_init().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-02 09:35:10 +02:00
Andreas Schneider
c626aad36a swrap: Rename socket_wrapper_pcap_file().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-02 09:35:10 +02:00
Andreas Schneider
2be25abcb1 swrap: Fix type punning warnings.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-02 09:35:10 +02:00
Jakub Hrozek
95c9917c86 Provide a compatible declaration of CMSG_ALIGN
Some platforms (like OSX) do support some of the CMGS macros, but don't
have a CMSG_ALIGN macro of their own.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-10-02 09:35:10 +02:00
Jakub Hrozek
5e70d80e7d SO_PROTOCOL is platform-dependent
SO_PROTOCOL is not defined on all platforms. In particular, OSX doesn't
include it and so far I haven't found any compatible declaration.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-10-02 09:35:10 +02:00
Michael Adam
616364378d swrap: fix another discard const warning in swrap_bind()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-10-02 09:35:10 +02:00
Michael Adam
f6fe9a997d swrap: fix discard const warning in swrap_bind()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-10-02 09:35:10 +02:00
Michael Adam
bebbd28985 swrap: fix discard const warning in swrap_remove_stale()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-10-02 09:35:10 +02:00
Michael Adam
a7a47796fd swrap: fix build when neither HAVE_STRUCT_IN_PKTINFO nor IP_RECVDSTADDR is defined
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-10-02 09:35:10 +02:00
Kamen Mazdrashki
0fbce1457d loadparm//init_copymap: Add braces around if/for blocks to match coding style
Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Oct  1 13:47:22 CEST 2014 on sn-devel-104
2014-10-01 13:47:22 +02:00
Kamen Mazdrashki
122fdf5ea4 loadparm: Allocate service->copymap in service memory context
This patch adds a restriction that target service structure
must be a valid TALLOC_CTX memory context.

I have traced all call paths and at the moment this is the case,
pservice parameter layways gets allocated on TALLOC_CTX.

Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-10-01 11:21:38 +02:00
Volker Lendecke
703ef59d00 tdb: Fix a comment
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Sep 30 23:08:07 CEST 2014 on sn-devel-104
2014-09-30 23:08:07 +02:00
Jeremy Allison
fc8e1056fe lib: util [ctdb]: Signal handling - change CatchChild() and CatchChildLeaveStatus() to return the previous handler.
Bug #10831 - SIGCLD Signal handler not correctly reinstalled on old library code use - smbrun etc.

https://bugzilla.samba.org/show_bug.cgi?id=10831

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-09-30 20:40:16 +02:00
Stefan Metzmacher
1dbd0bec04 tevent: version 0.9.22
* pkgconfig fixes
* Bug #10640 - smbd is not responding - tevent_common_signal_handler()
  increments non-atomic variables.
  https://bugzilla.samba.org/show_bug.cgi?id=10640
* Minor compile fixes

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-30 16:36:09 +02:00
Stefan Metzmacher
a65df7e8c0 tevent: remove unused exit_code in tevent_select.c
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-30 16:36:09 +02:00
Stefan Metzmacher
1ea3364721 tevent: remove unused exit_code in tevent_poll.c
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-30 16:36:09 +02:00
Andrew Bartlett
afe02d12f4 winbindd: Change value of "ldap sasl wrapping" to sign
This is to disrupt MITM attacks between us and our DC

Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2014-09-30 12:32:05 +02:00
Matthieu Patou
bf0ee5f6ba ldb: fix a typo in the comment, LDB_FLAGS_MOD_xxx -> LDB_FLAG_MOD_xxx
Change-Id: I99ac6e272aa0f54a2720c58f630ae472068f255b
Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>

Autobuild-User(master): Matthieu Patou <mat@samba.org>
Autobuild-Date(master): Tue Sep 30 08:19:55 CEST 2014 on sn-devel-104
2014-09-30 08:19:55 +02:00
Stefan Metzmacher
8280bc5092 lib/param: set the kccsrv:samba_kcc option to false by default
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10697

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-09-29 08:28:06 +02:00
Jeremy Allison
612b74296c lib: util: asn1 tests. Check every asn1 return.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-26 00:51:16 +02:00
Jeremy Allison
f102752b0c lib: util: asn1 fixes - check all returns.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-26 00:51:16 +02:00
Volker Lendecke
17998fc4cf tdb: Improve wording in a comment
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep 25 00:59:16 CEST 2014 on sn-devel-104
2014-09-25 00:59:16 +02:00
Volker Lendecke
0f9669eb9f lib/util: Drop unnecessary use of talloc_tos()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-09-20 06:03:13 +02:00
Martin Schwenke
6d450b3b48 lib/util: Return some functions to util_str.c
These were moved in commit 8e704e4107
when util_str.c was not shared.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Sep 19 20:34:05 CEST 2014 on sn-devel-104
2014-09-19 20:34:05 +02:00
Martin Schwenke
f3d50e5ff5 lib/util: Move next_token* functions to util_str.c
This is part of an attempt to untangle charset from util.c.

Most of this was moved from util_str.c in commit
55903e6f91.  next_token() was moved from
charset to util.c in commit 4be643d4ce
so that it would be alongside next_token_talloc().

Now that util_str.c is in shared lib/util it is no longer necessary to
have these in util.c.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-09-19 18:11:11 +02:00
Martin Schwenke
1bf36f177b lib/util: Move idr_get_new_random() to new source file idtree_random.c
This function depends on genrand.c, which depends on lib/crypto.  This
way the other IDR tree code can be used without lib/crypto.

While doing this, create idtree.h and idtree_random.h and clean up the
includes.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-09-19 18:11:11 +02:00
Martin Schwenke
e0a5c43bd0 debug: Standalone compile without includes.h
Compiling utilities with includes.h is confusing because includes.h
could come from source3, source4 or ctdb.  Utilities should be
independent of such things.

Add a minimal set of fined-grained includes that attempts to avoid the
catch-all samba_util.h.  A comment indicates what is used from
samba_util.h so that future clean-ups are easier.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-09-19 18:11:11 +02:00
Martin Schwenke
f8bd8924ca tdb_wrap: Standalone compile without includes.h
Compiling this generic code is confusing because it uses includes.h,
which could come from source3, source4 or ctdb.  Generic code should
be independent of such things.

Drop include of param.h since nothing from that file is used.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-09-19 18:11:11 +02:00
Martin Schwenke
9f0f6bff22 tdb_wrap: tdb_wrap.h doesn't need struct loadparm_context
Not since commit d6db35d7a5.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-09-19 18:11:11 +02:00
Martin Schwenke
8b2c280410 tdb: tdb.h needs bool type
Due to introduction of tdb_runtime_check_for_robust_mutexes().

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-09-19 18:11:11 +02:00
Martin Schwenke
5c5f631710 lib/crypto: Protect crypto.h against multiple inclusion
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-09-19 18:11:11 +02:00
Martin Schwenke
d55cdc367d charset: Avoid compiler warnings with --enable-developer
These:

  [ 44/309] Compiling ../lib/util/charset/util_unistr_w.c
  ../../lib/util/charset/util_unistr_w.c: In function ‘strlower_w’:
  ../../lib/util/charset/util_unistr_w.c:182:127: warning: right-hand operand of comma expression has no effect [-Wunused-value]
      COPY_UCS2_CHAR(s,&v);

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-09-19 18:11:11 +02:00
Martin Schwenke
2f7ba8175e replace: Fix includes of unistd.h
This should always be conditional.  system/passwd.h wants it too so
that uid_t is defined.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-09-19 18:11:11 +02:00
Martin Schwenke
427afe2655 util: Fix indentation
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-09-19 18:11:11 +02:00
Jeremy Allison
b9d3fd4cc5 lib: util: Check *every* asn1 return call and early return.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Sep 19 01:29:00 CEST 2014 on sn-devel-104
2014-09-19 01:29:00 +02:00
Volker Lendecke
221d9f7b8e lib: Polish echo_server
Samba has a lot of struct assignments now, in a lot of cases it simplifies the
code. Use it in the sample code.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Sep 18 23:02:38 CEST 2014 on sn-devel-104
2014-09-18 23:02:38 +02:00
Volker Lendecke
041eb5c5bc lib: util_tdb does not need samba-util
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-09-18 20:36:11 +02:00
Volker Lendecke
02d4b74701 tdb_wrap: Only pull in samba-debug
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-09-18 20:36:11 +02:00