summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* lib/param: rename do_parameter to lpcfg_do_parameterGarming Sam2014-07-071-5/+3
| | | | | | | | | This should be used to allow it to be called from s3 code. Change-Id: I2f2d5526cf11a1ad78ca6ff7cb5c18fa25a98c76 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
* param: handle smb_ports as a special handlerGarming Sam2014-07-072-1/+41
| | | | | | | | | | Avoids some problems with using str_list_make and str_list_make_v3 and tries to verify if the ports assignment is reasonable Change-Id: I441c4cca605c7548a5023b65994004fbac57d2df Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
* param: Use set_variable instead of set_variable_helper in lp_do_parameterGarming Sam2014-07-071-5/+5
| | | | | | | | | | | | | This extends the usage of the temporary s3 context in lp_do_parameter to beyond the special functions. At least for now, this will be necessary for sorting out the differences between the do_parameter code. Change-Id: Iac380d11a927e466ab1a56d34cebe343c3608707 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
* param: replace lp_set_cmdline in s3 helpers to store_cmdlineGarming Sam2014-07-073-9/+23
| | | | | | | Change-Id: I9a6ac66eeb8e0dd9ba356f5201f7ac09784b476d Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* param: Ensure the correct mem context is always being used from s3Garming Sam2014-07-071-2/+9
| | | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org> Change-Id: I7b93822d0d06b00f08fecc2e55778767dd785b91
* param: set the flags on a s3 loadparm contextGarming Sam2014-07-073-0/+4
| | | | | | | | | | By setting up the flags when we initialize the context, the flags can be accessed by lib/param at any time. Change-Id: I60d4f3a9108560e204cf5f37da9c7d995939e146 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
* param: flag fixes in s3 loadparmGarming Sam2014-07-071-0/+10
| | | | | | | | | | In s3 loadparm, the flags are stored in the param table, while in lib/param, it is individual to a loadparm context. Change-Id: I23d72eeec6b935c1897b34b8fc49d5a9992f2993 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
* param: allow fallback to s3 do_section in lib/paramGarming Sam2014-07-071-1/+8
| | | | | | | | | | This means that pm_process will eventually only call one do_section method. Change-Id: I81ffd0d61783df3e6c267f06210d4180a291ab4c Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
* param: add do_section to s3 helpersGarming Sam2014-07-072-0/+2
| | | | | | | Change-Id: Ib9cee580f46fcb6d5046e606b4bfbf9e68dab76a Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
* lib/param: add deprecated warning to be consistent with s3Garming Sam2014-07-071-0/+10
| | | | | | | Change-Id: I79016279b8c5dce6263bff0477b808108e583d20 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
* param: make some more changes to lp_do_parameter to match set_variable_helperGarming Sam2014-07-071-1/+1
| | | | | | | | | Attempting to make the code match exactly before moving it over. Change-Id: Ie7a30d5477f3fbf95f8f43e1ac1f76b581d87709 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
* lib/param: change set_variable_helper formattingGarming Sam2014-07-071-4/+6
| | | | | | | | | Attempting to make the code match exactly before moving it over. Change-Id: Id5571b00a8afd7dffc6197f2c7e020dd4fd59f85 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
* param: use str_list_make_v3 instead of str_list_make in s3Garming Sam2014-07-071-2/+2
| | | | | | | Change-Id: Iea5aa39b9848bb19b0df3c70f249fd63bb61455e Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
* param: Add null checks for upcoming str_list_make changesGarming Sam2014-07-072-2/+6
| | | | | | | | | | | | | In changing str_list_make to str_list_make_v3, the list can be NULL. These are some additional checks to try to avoid any problems. Where lists are dealt with, they typically check both if the list is empty or the list is NULL. Change-Id: I9012c31dbd9832ce877728bcb3346616ba64c4c5 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
* param: pre-emptively correct use of str_list_make_v3 in lib/paramGarming Sam2014-07-071-0/+4
| | | | | | | | | | | | | | | lib/param uses str_list_make, while, s3 uses str_list_make_v3. These differ slightly and should be made the same. Notably it returns NULL when given a null or empty string Also, includes the null check in s3 code to be consistent for merging this section of code later on. Change-Id: Ib543a5a5307e06989621ea16bfe87e315d66a7ef Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
* lib/param: factor out a common portion of set_variableGarming Sam2014-07-071-14/+30
| | | | | | | Change-Id: Id8eeb480a377b4df8c3f51daf0d253f032fd0e83 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
* param: change a number of parameters from P_LIST to P_CMDLISTGarming Sam2014-07-071-25/+25
| | | | | | | | | | | | | | | | | | These parameters are being changed to use their original syntax to match source3. netbios aliases, interfaces, auth methods, invalid users, valid users, admin users, read list, write list, hosts allow, hosts deny, preload modules, smb ports, name resolve order, svcctl list, cluster addresses, init logon delayed hosts, wins server, eventlog list, usershare prefix allow list, usershare prefix deny list, vfs objects, winbind nss info The documentation has also been changed to be consistent with the change. Change-Id: I536481098a508e0366c910b180f2db6a6f0634a9 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
* s4-winbind: Use winbindd in the AD DC by defaultAndrew Bartlett2014-07-041-1/+1
| | | | | | | | | | | (Including changes to knownfail to match the new winbindd in use in each environment) Change-Id: I9e08086eba98e95e05a99afef28315e2857aae56 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Kamen Mazdrashki <kamenim@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Jul 4 05:19:54 CEST 2014 on sn-devel-104
* lib: Align nt_time_to_unix_timespec with unix_timespec_to_nt_timeVolker Lendecke2014-06-302-5/+5
| | | | | | | Both take and return values now Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Align unix_timespec_to_nt_time with nt_time_to_unix_timespecVolker Lendecke2014-06-302-9/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tdb: defragment the freelist in tdb_allocate_from_freelist()Michael Adam2014-06-261-0/+55
| | | | | | | | | | | | | | | | | | | | While we are traversing the freelist anyways, merge a record with the left if it is also a free list record. That partially makes up for the fragmentation introduced by the lack of merging with right records in tdb_free(). Note there is a potential slight downside: If the left record we merge the current record into was earlier in the chain and has hence already been met in traverse, then we can not use the enlarged record even if it might be a new best fit. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Thu Jun 26 12:16:03 CEST 2014 on sn-devel-104
* tdb: add "freelist_size" sub-command to tdbtoolMichael Adam2014-06-261-0/+15
| | | | | | | | | With the new code, this has the side effect of merging adjacent records in the freelist if the database is not read-only. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* tdb: use tdb_freelist_merge_adjacent in tdb_freelist_size()Michael Adam2014-06-261-4/+29
| | | | | | | | So that we automatically defragment the free list when freelist_size is called (unless the database is read only). Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* tdb: add tdb_freelist_merge_adjacent()Michael Adam2014-06-261-0/+59
| | | | | | | | | | | | | | | | This is intended to be called to reduce the fragmentation in the freelist. This is to make up the deficiency of the freelist to be not doubly linked. If the freelist were doubly linked, we could easily avoid the creation of adjacent freelist entries. But with the current singly linked list, it is only possible to cheaply merge a new free record into a freelist entry on the left, not on the right... This can be called periodically, e.g. in the vacuuming process of a ctdb cluster. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* tdb: add utility function check_merge_ptr_with_left_record()Michael Adam2014-06-261-0/+53
| | | | | | | | Variant of check_merge_with_left_record() that reads the record itself if necessary. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* tdb: simplify tdb_free() using check_merge_with_left_record()Michael Adam2014-06-261-17/+9
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* tdb: add utility function check_merge_with_left_record()Michael Adam2014-06-261-0/+50
| | | | | | | | Check whether the record left of a given freelist record is also a freelist record, and if so, merge the two records. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* tdb: improve comments for tdb_free().Michael Adam2014-06-261-7/+11
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* tdb: factor merge_with_left_record() out of tdb_free()Michael Adam2014-06-261-7/+37
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* tdb: fix debug message in tdb_free()Michael Adam2014-06-261-1/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* tdb: reduce indentation in tdb_free() for merging leftMichael Adam2014-06-261-18/+23
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* tdb: increase readability of read_record_on_left()Michael Adam2014-06-261-27/+41
| | | | | | | | by using early returns and better variable names, and reducing indentation. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* tdb: factor read_record_on_left() out of tdb_free()Michael Adam2014-06-261-30/+49
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* nss_wrapper: Fix some "discarding const" warningsVolker Lendecke2014-06-211-6/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* nss_wrapper: Align indentation with the rest of SambaVolker Lendecke2014-06-211-16/+16
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* ldb:build: improve detection of srcdirMichael Adam2014-06-201-1/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* replace:build: improve detection of srcdirMichael Adam2014-06-201-1/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ntdb:build: improve detection of srcdirMichael Adam2014-06-201-1/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* talloc:build: improve detection of srcdirMichael Adam2014-06-201-1/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* tevent:build: improve detection of srcdirMichael Adam2014-06-201-1/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* tdb:build: improve detection of srcdir.Michael Adam2014-06-201-1/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* lib: Apply const to nt_time_to_unix_timespecVolker Lendecke2014-06-182-2/+2
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Wed Jun 18 16:35:26 CEST 2014 on sn-devel-104
* lib: Use server_id_str_buf in server_id_strVolker Lendecke2014-06-171-22/+12
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Add server_id_str_bufVolker Lendecke2014-06-172-0/+26
| | | | | | | This is usable in a DEBUG statement without talloc_tos() Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: tevent: make TEVENT_SIG_INCREMENT atomic.Jeremy Allison2014-06-073-0/+36
| | | | | | | | | | | | | | | | | | | | | | | On arm platforms incrementing a variable is not an atomic operation, so may be interrupted by signal processing (if a signal interrupts another signal handler). Use compiler built-ins to make this atomic. __sync_fetch_and_add() works on gcc, llvm, IBM xlC on AIX, and Intel icc (10.1 and above). atomic_add_32() works on Oracle Solaris. Based on an inital patch from kamei@osstech.co.jp. Bug #10640 - smbd is not responding - tevent_common_signal_handler() increments non-atomic variables https://bugzilla.samba.org/show_bug.cgi?id=10640 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
* lib: Bump socket_wrapper version to 1.1.1.Michael Adam2014-06-051-1/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* swrap: Disable incomplete bind checks (and tests) for EADDRINUSE.Andreas Schneider2014-06-051-1/+6
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* lib: Bump socket_wrapper version to 1.1.0.Andreas Schneider2014-06-051-1/+1
|
* swrap: check whether an address:port is already in use in swrap_bind()Michael Adam2014-06-051-0/+7
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* swrap: implement check_addr_port_in_use()Michael Adam2014-06-051-0/+83
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>