summaryrefslogtreecommitdiff
path: root/source3/lib
AgeCommit message (Collapse)AuthorFilesLines
2011-06-20tdb_compat: Higher level API fixes.Rusty Russell8-11/+11
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-20tdb_compat: use tdb_open_compat.Rusty Russell1-6/+11
This is a helper for the common case of opening a tdb with a logging function, but it doesn't do all the work, since TDB1 and TDB2's log functions are different types. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20tdb2: tdb_parse_record() returns negative errors, not -1.Rusty Russell2-3/+3
Fixup callers to tdb_parse_record() to be compatible with tdb2. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20tdb_validate: TDB2 support for tdb_validate_child and tdb_backup.Rusty Russell1-2/+10
We don't expose freelist or hash size for TDB2. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20tdb2: #ifdef out TDB_ERR_NOLOCK and TDB_ERR_LOCK_TIMEOUT.Rusty Russell2-1/+10
These don't exist in tdb2. The former is used in one weird place in tdb1, and the latter not at all. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20tdb_compat: use tdb_errorstr_compat()Rusty Russell1-6/+6
Since TDB2 functions return the error directly, tdb_errorstr() taken an error code, not the tdb as it does in TDB1. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20tdb_traverse/tdb_traverse_read: check returns for negative, not -1.Rusty Russell3-4/+4
TDB2 returns a negative error number on failure. This is compatible if we always check for < 0 instead of == -1. Also, there's no tdb_traverse_read in TDB2: we don't try to make traverse reliable any more, so there are no write locks anyway. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20tdb_chainunlock: ignore return value.Rusty Russell2-8/+2
TDB2 returns void here. tdb_chainunlock will *always* return with the chain unlocked, but it will complain via the log function if it wasn't locked. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20tdb_chainlock: check returns for 0, not -1.Rusty Russell2-3/+3
TDB2 returns a negative error number on failure. This is compatible if we always check for != 0 instead of == -1. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20tdb_transaction_cancel: ignore return value.Rusty Russell3-18/+9
TDB2 returns void here. tdb_transaction_cancel will *always* return with the transaction cancelled, but it will complain via the log function if a transaction wasn't in progress. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20tdb_transaction_commit: check returns for 0, not -1.Rusty Russell2-5/+5
TDB2 returns a negative error number on failure. This is compatible if we always check for != 0 instead of == -1. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20tdb_store: check returns for 0, not -1.Rusty Russell1-2/+2
TDB2 returns a negative error number on failure. This is compatible if we always check for != 0 instead of == -1. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20tdb_delete: check returns for 0, not -1.Rusty Russell1-3/+3
TDB2 returns a negative error number on failure. This is compatible if we always check for != 0 instead of == -1. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20tdb_fetch_compat: use instead of tdb_fetch.Rusty Russell4-9/+9
This is a noop for tdb1. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20tdb_compat.h: divert every tdb build and includes to tdb_compatRusty Russell2-2/+2
We change all the headers and wscript files to use tdb_compat; this means we have one place to decide whether to use TDB1 or TDB2. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20source3/lib/util.c: str_checksum to use Jenkins hash from CCAN.Rusty Russell1-2/+4
Rather than tdb's internal one.
2011-06-17errors: reorder error codes for easier s3/s4 comparisonAndrew Bartlett1-11/+11
2011-06-12s3: Add wins_server_tag_ips()Volker Lendecke1-0/+42
For a given tag, return the list of all wins servers
2011-06-10source3/lib/privileges.h: fix licence/copyrightGünther Deschner1-0/+27
Guenther
2011-06-10source3/lib/netapi/libnetapi.h: fix licence/copyrightGünther Deschner1-0/+19
Guenther
2011-06-10Export init_stat_ex_from_stat for use in VFS modules.Richard Sharpe1-6/+6
Signed-off-by: Günther Deschner <gd@samba.org> Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Fri Jun 10 13:23:37 CEST 2011 on sn-devel-104
2011-06-09s3:lib/util: use %llu consitently (instead of %d) in interpret_pid() to ↵Stefan Metzmacher1-1/+1
parse the pid metze
2011-06-09s3-param Remove special case for global_myname(), rename to lp_netbios_name()Andrew Bartlett6-46/+12
There is no reason this can't be a normal constant string in the loadparm system, now that we have lp_set_cmdline() to handle overrides correctly. Andrew Bartlett
2011-06-09s3-lib Add myhostname_upper()Andrew Bartlett1-0/+16
This varient always upper cases the hostname, which is needed for the netbios name. Andrew Bartlett
2011-06-09server_id: Change format to vnn:pid.task_id, pid.task_id or pidAndrew Bartlett1-4/+14
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-09s3-param Remove special case for global_scope()Andrew Bartlett2-28/+1
There is no reason this can't be a normal constant string in the loadparm system. (Past reasons were that we didn't have lp_set_cmdline()) Andrew Bartlett
2011-06-09s3-param Remove special case for lp_workgroup()Andrew Bartlett2-21/+2
There is no reason this can't be a normal constant string in the loadparm system, now that we have lp_set_cmdline() to handle overrides correctly. Andrew Bartlett
2011-06-09s3-lib Use domain in credentials file for domain in credentialsAndrew Bartlett1-1/+1
This previously set the workgroup, which is a different thing, but would have been the default if no domain was specified). This more clearly sets the information from the credentials file into the matching field in the credentials structure. Andrew Bartlett
2011-06-09lib/util Bring procid_str() into lib/util as server_id_string()Andrew Bartlett2-22/+6
This is needed for OpenChange, which prints Samba struct server_id values in debug messages. Andrew Bartlett
2011-06-09s3-lib Read and write the full struct server_id (except the unique_id)Andrew Bartlett1-19/+18
This is in preperation for making this code the common, only reader and writer of this structure. Andrew Bartlett
2011-06-09s3-server_id Add task_id to server_id to match Samba4Andrew Bartlett2-0/+8
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-09s3-talloc Change TALLOC_MEMDUP() to talloc_memdup()Andrew Bartlett3-3/+3
Using the standard macro makes it easier to move code into common, as TALLOC_MEMDUP isn't standard talloc.
2011-06-09s3-talloc Change TALLOC_ZERO_ARRAY() to talloc_zero_array()Andrew Bartlett6-11/+11
Using the standard macro makes it easier to move code into common, as TALLOC_ZERO_ARRAY isn't standard talloc.
2011-06-09s3-talloc Change TALLOC_ZERO_P() to talloc_zero()Andrew Bartlett18-23/+23
Using the standard macro makes it easier to move code into common, as TALLOC_ZERO_P isn't standard talloc.
2011-06-09s3-talloc Change TALLOC_P() to talloc()Andrew Bartlett9-15/+15
Using the standard macro makes it easier to move code into common, as TALLOC_P isn't standard talloc.
2011-06-09s3-talloc Change TALLOC_ARRAY() to talloc_array()Andrew Bartlett8-14/+14
Using the standard macro makes it easier to move code into common, as TALLOC_ARRAY isn't standard talloc.
2011-06-09s3-talloc Change TALLOC_REALLOC_ARRAY() to talloc_realloc()Andrew Bartlett7-11/+11
Using the standard macro makes it easier to move code into common, as TALLOC_REALLOC_ARRAY isn't standard talloc. Andrew Bartlett
2011-06-09s3-talloc Remove unused TALLOC zeronull functions and macro definitionsAndrew Bartlett1-105/+0
These have been under #if 0 for a long time now. Andrew Bartlett
2011-06-06s3-waf: Fix pthreadpool build which needs librt now.Andreas Schneider1-1/+1
Autobuild-User: Andreas Schneider <asn@cryptomilk.org> Autobuild-Date: Mon Jun 6 23:31:09 CEST 2011 on sn-devel-104
2011-06-06s3: Fix two debug messagesVolker Lendecke1-2/+2
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Mon Jun 6 14:11:06 CEST 2011 on sn-devel-104
2011-06-06s3/pthreadpool: replace bad portable gettimeofday by clock_gettimeBjörn Jacke1-4/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-06-06lib/util use modules_path(), data_path() and shlib_ext() from source3Andrew Bartlett2-41/+4
This brings these helpful utility functions in common, as they are not based on either loadparm system. (The 'modules dir' parameter from Samba4 will shortly be removed, so there is no loss in functionality) Andrew Bartlett
2011-06-06s3-lib Remove unused lib_path()Andrew Bartlett1-13/+0
2011-06-04Add the same fix to the S3 event backend as the previous commit added to the ↵Jeremy Allison1-1/+14
tevent poll backend. Metze please check ! Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat Jun 4 00:27:37 CEST 2011 on sn-devel-104
2011-06-01Revert "s3: Mark sockets in error state writable"Volker Lendecke1-23/+0
This reverts commit 5f6f71956460d6840c1433b59e20555268b622ac. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Wed Jun 1 14:56:25 CEST 2011 on sn-devel-104
2011-06-01lib/util/time.c: timeval_current_ofs_usecRusty Russell1-7/+7
Several places want "microseconds from current time", and several were simply handing "usecs" values which could be over a million. Using a helper to do this is safer and more readable. I didn't replace any obviously correct callers (ie. constants). I also renamed wait_nsec in source3/lib/util_sock.c; it's actually microseconds not nanoseconds (introduced with this code in Volker's 19b783cc Async wrapper for open_socket_out_send/recv). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-01Change sys_getcd() to take no arguments and always return malloc'ed memory ↵Jeremy Allison1-7/+34
(or NULL). Part of the efforts to remove PATH_MAX on modern systems.
2011-06-01s3: fix more -Wunused-but-set-variable build warnings.Günther Deschner1-3/+0
Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Wed Jun 1 00:29:30 CEST 2011 on sn-devel-104
2011-05-31s3: Mark sockets in error state writableVolker Lendecke1-0/+23
Without this patch, when a socket only has a write event pending, we will never detect an error condition. I've seen winbind doing 12:19:13.659964 gettimeofday({1306837153, 659984}, NULL) = 0 <0.000016> 12:19:13.660109 poll([{fd=35, events=POLLOUT}, {fd=32, events=POLLIN|POLLHUP}], 2, 9996) = 1 ([{fd=35, revents=POLLERR|POLLHUP}]) <0.000015> 12:19:13.660253 gettimeofday({1306837153, 660269}, NULL) = 0 <0.000013> 12:19:13.660298 poll([{fd=35, events=POLLOUT}, {fd=32, events=POLLIN|POLLHUP}], 2, 9996) = 1 ([{fd=35, revents=POLLERR|POLLHUP}]) <0.000015> for a while when trying to connect to a DC when the socket had died already. Volker Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Tue May 31 20:59:10 CEST 2011 on sn-devel-104
2011-05-31s3: add _LIB_IDMAP_CACHE_H_ guard to lib/idmap_cache.hMichael Adam1-0/+5