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

733 Commits

Author SHA1 Message Date
Stefan Metzmacher
935a40f4f2 s3:lib: s/struct event_context/struct tevent_context
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:54 +01:00
Volker Lendecke
da35cd7bd2 Avoid a very small memleak on talloc_tos()
"fname" did leak on talloc_tos(). Not really a bad memleak, but as I
just came across it I thought I might just fix it

Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jan 25 00:54:01 CET 2013 on sn-devel-104
2013-01-25 00:54:01 +01:00
Stefan Metzmacher
1f7eac907a s3:lib: remove unused processes_exist()
metze
2012-08-24 13:43:34 +02:00
Stefan Metzmacher
0b5e354080 s3:lib: implement process_exists() as wrapper of serverid_exists()
The changes the behavior of process_exists() it checks the pid.unique_id
now, if it's not SERVERID_UNIQUE_ID_NOT_TO_VERIFY.

metze
2012-08-24 13:43:31 +02:00
Stefan Metzmacher
6457fb5c39 s3:lib: implement interpret_pid() as wrapper of server_id_from_string()
metze
2012-08-17 20:07:07 +02:00
Jeremy Allison
b70f23c2b5 Correctly check for errors in strlower_m() returns. 2012-08-09 12:08:18 -07: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
Jeremy Allison
9d5e026bde Make check_same_stat() and check_same_dev_ino() common functions. 2012-07-09 12:26:56 -07:00
Jeremy Allison
90881da685 Move copy_unix_token() from locking/locking.c to lib/util.c.
Make public.
2012-07-03 15:34:22 -07:00
Michael Adam
b240406651 s3:move serverid_equal() to serverid.c
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-21 08:27:32 +02:00
Michael Adam
73b200064f s3:util: rename procid_equal() to serverid_equal()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-21 08:27:32 +02:00
Michael Adam
0159344d4c s3:util: remove (now) unused cluster_id_equal()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-21 08:27:31 +02:00
Michael Adam
6289fcffd7 s3:util: reformat procid_equal() to adhere to coding guidelines
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-21 08:27:29 +02:00
Michael Adam
3bdad95e3b s3:util: also compare the unique_id in procid_equal().
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-21 08:27:29 +02:00
Stefan Metzmacher
b2c9fe4ad1 lib/util: move tevent_req_poll_ntstatus() to tevent_ntstatus.c
metze
2012-05-14 15:12:34 +02:00
Stefan Metzmacher
05e4f24729 s3:lib/util: use map_nt_error_from_unix_common() in tevent_req_poll_ntstatus()
metze
2012-05-14 15:12:34 +02:00
Andrew Bartlett
442a81e7b2 s3-lib Add a way to allocate the task_id value in server_id
This safely allocates the task_id so that when we have multiple event
contexts, they can each have their own messaging context, particularly
for the imessaging subsystem under source4.

Andrew Bartlett
2012-04-30 17:55:12 +10:00
Andrew Bartlett
6aa12fcb30 build: Remove SMB_OFF_T, replace with off_t
Now that we always require a 64 bit off_t, we no longer need SMB_OFF_T.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri Apr  6 01:47:43 CEST 2012 on sn-devel-104
2012-04-06 01:47:43 +02:00
Andrew Bartlett
1ac7f071ce build: Remove SMB_F* locking defines 2012-04-05 02:39:09 +02:00
Andrew Bartlett
6098f8d80c build: Remove SMB_STRUCT_FLOCK define 2012-04-05 02:39:09 +02:00
Andrew Bartlett
f6e0532024 build: Remove SMB_STRUCT_DIR define 2012-04-05 02:39:09 +02:00
Andrew Bartlett
2320b2144f build: Remove SMB_STRUCT_DIRENT define 2012-04-05 02:39:09 +02:00
Andrew Bartlett
afdb78075c build: Remove sys_readdir wrapper 2012-04-05 02:39:09 +02:00
Andrew Bartlett
43e9be8894 build: Remove sys_lseek wrapper 2012-04-05 02:39:08 +02:00
Andrew Bartlett
c363815809 s3-smbd: Inline init_modules() into only caller 2012-04-03 14:25:12 +10:00
Jelmer Vernooij
c0288e0612 lib/util: Remove obsolete sys_getpid() and sys_fork().
The performance of these is minimal (these days) and they can return
invalid results when used as part of applications that do not use
sys_fork().

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Mar 24 21:55:41 CET 2012 on sn-devel-104
2012-03-24 21:55:40 +01:00
Jelmer Vernooij
2a82c45f02 lib/util: Remove dummy wrapper for getgrnam(). 2012-03-24 15:25:48 +01:00
Jeremy Allison
6589e02807 Make reinit_after_fork_pipe_handler code with reads being interrupted by a signal.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Mar 15 23:29:47 CET 2012 on sn-devel-104
2012-03-15 23:29:47 +01:00
Michael Adam
c80f70390c s3:smbd: let smbd/nmbd/winbindd child processes terminate if the parent process died.
This applies to all child processes making use of reinit_after_fork().
It is implemented by establishing a pipe between parent and child.
The child watches for EOF on the read end of the pipe, indidcating
an exited parent.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
2012-03-15 18:41:37 +01:00
Andrew Bartlett
474fbfb7b7 s3-lib: Remove unused is_myworkgroup()
Found by callcatcher: http://www.skynet.ie/~caolan/Packages/callcatcher.html

Andrew Bartlett
2012-02-10 16:45:14 +11:00
Andrew Bartlett
40bf23d862 s3-lib: Remove unused pid_path()
piddir.c calls lp_piddir() directly.

Found by callcatcher: http://www.skynet.ie/~caolan/Packages/callcatcher.html

Andrew Bartlett
2012-02-10 16:45:12 +11:00
Jeremy Allison
502186fe0c Remove unused get_file_size() function.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Feb  7 20:56:28 CET 2012 on sn-devel-104
2012-02-07 20:56:28 +01:00
Volker Lendecke
0f9d14820e s3: Remove a bunch of calls to procid_self()
All callers to messaging_[re]init only used procid_self()
2011-12-12 21:50:25 +01:00
Volker Lendecke
ba0171f724 s3: Add processes_exist 2011-10-27 20:28:31 +02:00
Stefan Metzmacher
7682f61e10 s3:include: implement trans_oob() as wrapper to smb_buffer_oob()
metze
2011-10-26 15:33:30 +02:00
Stefan Metzmacher
6d2aaef787 s3:include: make smb_setlen() a macro
metze
2011-10-21 08:43:00 +02:00
Stefan Metzmacher
d825a2add6 s3:libsmb/smb_seal: move smb_set_enclen() to smb_seal.c and make it static there
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Oct 19 19:06:35 CEST 2011 on sn-devel-104
2011-10-19 19:06:35 +02:00
Andrew Bartlett
7d33ec3dfe lib/util: consolidate module loading into common code
This creates a samba-modules private libary that handles the details.

Andrew Bartlett
2011-10-06 07:18:07 +02:00
Stefan Metzmacher
4c6bfac12a s3:lib/util: make sure panic action can attach a debugger on ubuntu (>=10.10)
By default user processes can't attach a debugger to a process.
So explicitly allow that for all child processes, before calling
the panic action script.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Oct  4 12:51:35 CEST 2011 on sn-devel-104
2011-10-04 12:51:35 +02:00
Volker Lendecke
190b5432f0 s3: Make map_open_params_to_ntcreate() available in lib/ 2011-07-29 16:43:17 +02:00
Volker Lendecke
0102c6e2bc s3: Make is_executable() available in lib/ 2011-07-29 16:43:17 +02:00
Rusty Russell
d925b327f4 tdb_compat: Higher level API fixes.
My previous patches fixed up all direct TDB callers, but there are a
few utility functions and the db_context functions which are still
using the old -1 / 0 return codes.

It's clearer to fix up all the callers of these too, so everywhere is
consistent: non-zero means an error.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
f72dd0cf0f source3/lib/util.c: str_checksum to use Jenkins hash from CCAN.
Rather than tdb's internal one.
2011-06-20 11:18:34 +02:00
Stefan Metzmacher
e3396cffec s3:lib/util: use %llu consitently (instead of %d) in interpret_pid() to parse the pid
metze
2011-06-09 14:46:22 +02:00
Andrew Bartlett
0e95311c23 s3-lib Add myhostname_upper()
This varient always upper cases the hostname, which is needed for the
netbios name.

Andrew Bartlett
2011-06-09 12:40:09 +02:00
Andrew Bartlett
daf79e33c7 server_id: Change format to vnn:pid.task_id, pid.task_id or pid
This helps ensure the string cannot be ambiguous, while also ensuring
that it remains simple in the non-cluster case.

The asymmetry of reading get_my_vnn() but writing based on
NONCLUSTER_VNN is acceptable because in the non-clustered case, they
are equal, and in the clustered case we will print the full string.

Andrew Bartlett
2011-06-09 12:40:09 +02:00
Andrew Bartlett
16b1c77644 lib/util Bring procid_str() into lib/util as server_id_string()
This is needed for OpenChange, which prints Samba struct server_id
values in debug messages.

Andrew Bartlett
2011-06-09 12:40:09 +02:00
Andrew Bartlett
d01dbd6c3f s3-lib Read and write the full struct server_id (except the unique_id)
This is in preperation for making this code the common, only reader
and writer of this structure.

Andrew Bartlett
2011-06-09 12:40:09 +02:00
Andrew Bartlett
cc3b75b807 s3-server_id Add task_id to server_id to match Samba4
This will allow this structure to be shared, and allow us to create a
common messaging system between all Samba processes.  Samba4 uses the
task_id to indicate the different tasks within a single unix process.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-06-09 12:40:08 +02:00
Andrew Bartlett
8d4a8389bb s3-talloc Change TALLOC_MEMDUP() to talloc_memdup()
Using the standard macro makes it easier to move code into common, as
TALLOC_MEMDUP isn't standard talloc.
2011-06-09 12:40:08 +02:00