The branch, master has been updated
via 12c502041cd lib: Delay get_iconv_handle() in strchr_m()
via 4450a4e6a83 lib: Move a variable declaration closer to its use
via 71447e1fde2 lib: Remove extern const data_blob_null
via 74858220d9f lib: Remove &data_blob_null refs
via 47c523afb1a printing: Inline oneliners used just once
via 2f43bd54693 printing: Simplify mapping permissions
via 48a0b2d4caf printing: Make structures const static
via ae45e424ca4 printing: Simplify file_version_is_newer()
via 81b7b835b0b printing: Make file_version_is_newer() more precise
via 23f5c0581fd printing: Fix file_version_is_newer()
via 2a2a9b740c8 printing: Apply some const
via 8ca1460d158 printing: Simplify driver_unix_convert()
via d223c1ef182 printing: Remove indentation with a "goto done"
via 115b484e44b printing: A little bit of README.Coding in nt_printing.c
via fe8d9b41897 printing: Slightly simplify
move_driver_file_to_download_area()
via 888437cedf9 printing: Modernize a few DEBUGs
via 6f0ff4b4899 vfs_fruit: Introduce two helper variables
via 53a41fe78c9 vfs_fruit: Move two variable declarations closer to
their use
via a664053eefe vfs_fruit: Fix short-term error path talloc leaks
via a99e48b6860 vfs_fruit: Introduce a helper variable
via e08fa36381d vfs_fruit: Modernize DEBUGs
via 290a060c57a lib: Remove a function unused since 2016
via 7efa529a659 srvsvc: Move valid_share_pathname() to where it's used
via ec0a59bebd9 lib: Remove the pointless unix_format() macro
via a1831c15789 printing: Simplify move_driver_to_download_area()
via c525d164f41 ldb: Avoid a few memset()s with direct structs
via 81eb0375425 auth: Avoid a memset with calloc
via 2058d52573b lib: Reduce indentation with an early return
via 3d2e957956b smbd: Fix a panic message
via 6e003590b10 torture: Apply some "static const"
via dca79456db3 loadparm: Simplify canonicalize_servicename()
via 7fb0b00a71f loadparm: Modernize DEBUGs
via 51ec0bdf3cc libgpo: Use ISDOT/ISDOTDOT
via 24405244278 smbd: Remove unused STR_TO_SMB_BIG_UINT
via 4984f6ca9d0 smbd: Scan output of get quota command with sscanf
via 431ab4cfa34 smbd: Add a NULL check for get quota command output
via 3632a0b622b smbd: Reduce indentation with an early return
via 5bb5e3dd55d smbd: Replace dfree command output parsing with sscanf
via db2c61f0437 smbd: Add a NULL check for dfree command output
via 0a8255d444f smbd: Reduce indentation in handle_dfree_command with
early returns
via 1f6d5b79d53 smbd: Factor out handling of dfree command into a
separate function
via 9766169d87d smbd: Modernize a few DEBUGs
from 1f432474c40 manpages/vfs_ceph_new: document fscrypt and keybridge
options
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 12c502041cdfc3fc3585749704e4677663572702
Author: Volker Lendecke <[email protected]>
Date: Tue Jan 6 16:29:30 2026 +0100
lib: Delay get_iconv_handle() in strchr_m()
Do it the same way as in strrchr_m()
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
Autobuild-User(master): Volker Lendecke <[email protected]>
Autobuild-Date(master): Tue Jan 20 12:56:27 UTC 2026 on atb-devel-224
commit 4450a4e6a83b0b3d6cd7a569f4a546836c223653
Author: Volker Lendecke <[email protected]>
Date: Wed Jan 7 12:46:42 2026 +0100
lib: Move a variable declaration closer to its use
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 71447e1fde280dd6a41fb73abcb24f1d8173b5af
Author: Volker Lendecke <[email protected]>
Date: Wed Dec 31 14:57:36 2025 +0100
lib: Remove extern const data_blob_null
This actually saves some .text bytes in the code referencing this constant.
The
compiler should be smarter to do the right thing than to copy from a shared
location.
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 74858220d9fdcb26244d9fb5a0252c98e3a46e2d
Author: Volker Lendecke <[email protected]>
Date: Tue Dec 30 10:34:49 2025 +0100
lib: Remove &data_blob_null refs
The next patch will remove the data_blob_null global constant. The
APIs here are a bit weird in that they don't work fine with a NULL
pointer but require a reference to a NULL blob. But that's few enough
to add the special case in the callers.
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 47c523afb1ae3fe049f3d918930fa8edbdb715f9
Author: Volker Lendecke <[email protected]>
Date: Sun Jan 4 13:05:49 2026 +0100
printing: Inline oneliners used just once
This patch and the 2 previous ones could be squashed, but it's the way those
unfolded :-)
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 2f43bd546935e19dec3ce05ea74482159bede0fe
Author: Volker Lendecke <[email protected]>
Date: Sun Jan 4 13:04:27 2026 +0100
printing: Simplify mapping permissions
Use security_acl_map_generic()
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 48a0b2d4caf77d9ea5b902a045ba01b10478ff55
Author: Volker Lendecke <[email protected]>
Date: Sun Jan 4 13:02:26 2026 +0100
printing: Make structures const static
While there, remove an unused mapping
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit ae45e424ca4e26fa2f78be7e12716b4223c2ab40
Author: Volker Lendecke <[email protected]>
Date: Sun Jan 4 11:31:17 2026 +0100
printing: Simplify file_version_is_newer()
We don't need to call fstat(), driver_unix_convert() already does it
via filename_convert_dirfsp().
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 81b7b835b0b26fd5c083d5e88e85b99543ce40ed
Author: Volker Lendecke <[email protected]>
Date: Sun Jan 4 11:23:56 2026 +0100
printing: Make file_version_is_newer() more precise
We have timespec_compare, we don't have to loose info.
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 23f5c0581fde4aad9ce62bff0629f394eab81f1a
Author: Volker Lendecke <[email protected]>
Date: Sun Jan 4 10:29:26 2026 +0100
printing: Fix file_version_is_newer()
fstring as a function parameter does not really make sense...
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 2a2a9b740c856970e0558676aae62ade9d95a612
Author: Volker Lendecke <[email protected]>
Date: Sun Jan 4 10:29:12 2026 +0100
printing: Apply some const
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 8ca1460d1586af1b6a1f6397a6ac44280920a3a6
Author: Volker Lendecke <[email protected]>
Date: Sun Jan 4 10:20:31 2026 +0100
printing: Simplify driver_unix_convert()
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit d223c1ef18200e85837c0ca79c844b753a2ac7a3
Author: Volker Lendecke <[email protected]>
Date: Sat Jan 3 12:35:36 2026 +0100
printing: Remove indentation with a "goto done"
Review with "git show -w".
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 115b484e44b26ab168a183cabc683987d6aaf057
Author: Volker Lendecke <[email protected]>
Date: Sat Jan 3 12:32:14 2026 +0100
printing: A little bit of README.Coding in nt_printing.c
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit fe8d9b418978333d323fb863ce2dae04caac01cf
Author: Volker Lendecke <[email protected]>
Date: Sat Jan 3 12:14:09 2026 +0100
printing: Slightly simplify move_driver_file_to_download_area()
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 888437cedf90dff74d82f034fb98498d84a17c05
Author: Volker Lendecke <[email protected]>
Date: Sat Jan 3 12:09:14 2026 +0100
printing: Modernize a few DEBUGs
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 6f0ff4b48992bba415aca5d58ec0814a5ab9b29c
Author: Volker Lendecke <[email protected]>
Date: Sat Jan 3 15:48:16 2026 +0100
vfs_fruit: Introduce two helper variables
Makes it a bit easier to read for me.
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 53a41fe78c9a0e5562c9a0b33e0b4d18b0952c16
Author: Volker Lendecke <[email protected]>
Date: Sat Jan 3 15:28:23 2026 +0100
vfs_fruit: Move two variable declarations closer to their use
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit a664053eefe4d0b6bc95673d28bf503cc6f46bb0
Author: Volker Lendecke <[email protected]>
Date: Sat Jan 3 15:25:27 2026 +0100
vfs_fruit: Fix short-term error path talloc leaks
In the error returns we leaked "streams" on "req". Fix this and
simplify the error paths by using "streams" as temporary talloc
context.
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit a99e48b68605a317629c744397f7be27a8fd5a06
Author: Volker Lendecke <[email protected]>
Date: Sat Jan 3 15:20:46 2026 +0100
vfs_fruit: Introduce a helper variable
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit e08fa36381d5dac4a870844131a71c933c0d5631
Author: Volker Lendecke <[email protected]>
Date: Sat Jan 3 10:32:16 2026 +0100
vfs_fruit: Modernize DEBUGs
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 290a060c57a8ec16e4d26f65f2bac16f9cc62fbe
Author: Volker Lendecke <[email protected]>
Date: Sat Jan 3 10:17:17 2026 +0100
lib: Remove a function unused since 2016
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 7efa529a659c29bb83cc7e71257241763605a2e1
Author: Volker Lendecke <[email protected]>
Date: Sat Jan 3 10:12:49 2026 +0100
srvsvc: Move valid_share_pathname() to where it's used
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit ec0a59bebd942b2ddd26d9bbd384a97f0715a3ea
Author: Volker Lendecke <[email protected]>
Date: Sat Jan 3 09:52:48 2026 +0100
lib: Remove the pointless unix_format() macro
One of the two callers even had a comment what it does...
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit a1831c15789abe8725df272bc42a1a23bf6fb333
Author: Volker Lendecke <[email protected]>
Date: Sat Jan 3 09:38:58 2026 +0100
printing: Simplify move_driver_to_download_area()
No need to call strlen() here. Just came across this while looking at
SMB_VFS_CREATE_FILE callers...
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit c525d164f41cd7e9b06a9a7c2ac1e484650995dd
Author: Volker Lendecke <[email protected]>
Date: Tue Jan 13 09:42:36 2026 +0100
ldb: Avoid a few memset()s with direct structs
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 81eb0375425009d876dda811693942ca649d42c5
Author: Volker Lendecke <[email protected]>
Date: Tue Jan 13 08:51:29 2026 +0100
auth: Avoid a memset with calloc
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 2058d52573ba34962530c030d533de19b02ae86f
Author: Volker Lendecke <[email protected]>
Date: Fri Jan 9 10:45:40 2026 +0100
lib: Reduce indentation with an early return
Review with "git show -w"
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 3d2e957956b5aac9b5ade7e11e724a14e7ad6ea1
Author: Volker Lendecke <[email protected]>
Date: Fri Jan 9 10:44:47 2026 +0100
smbd: Fix a panic message
%s is not a proper file name :-)
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 6e003590b10312af3a14e6c3d774ce479562f49d
Author: Volker Lendecke <[email protected]>
Date: Wed Jan 7 14:56:12 2026 +0100
torture: Apply some "static const"
Only used in this file and never modified
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit dca79456db3b759348ca702b0caadd3f6bbe6e65
Author: Volker Lendecke <[email protected]>
Date: Wed Jan 7 12:56:28 2026 +0100
loadparm: Simplify canonicalize_servicename()
We have strlower_talloc()
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 7fb0b00a71f0fb05f973876a7ff50df7e2378ac6
Author: Volker Lendecke <[email protected]>
Date: Wed Jan 7 12:52:04 2026 +0100
loadparm: Modernize DEBUGs
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 51ec0bdf3cc8c1b88792a0a8664dede369ac1d20
Author: Volker Lendecke <[email protected]>
Date: Wed Jan 14 10:31:57 2026 +0100
libgpo: Use ISDOT/ISDOTDOT
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 244052442789134cfe4be069a0dd1c1bea8acc2b
Author: Volker Lendecke <[email protected]>
Date: Wed Jan 14 10:21:06 2026 +0100
smbd: Remove unused STR_TO_SMB_BIG_UINT
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 4984f6ca9d0d47919cdcd74b29e80ff46c386efa
Author: Volker Lendecke <[email protected]>
Date: Wed Jan 14 10:17:22 2026 +0100
smbd: Scan output of get quota command with sscanf
sscanf can skip white space and also parse uint32/uint64 for us.
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 431ab4cfa34893eb8e143693da60b9138d534937
Author: Volker Lendecke <[email protected]>
Date: Wed Jan 14 10:12:22 2026 +0100
smbd: Add a NULL check for get quota command output
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 3632a0b622b3db4107538d8d116d1dc988ea1d9d
Author: Volker Lendecke <[email protected]>
Date: Wed Jan 14 10:11:18 2026 +0100
smbd: Reduce indentation with an early return
Review with "git show -w"
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 5bb5e3dd55df2e781108e10f556f75ce08fcc6d7
Author: Volker Lendecke <[email protected]>
Date: Wed Jan 14 08:18:15 2026 +0100
smbd: Replace dfree command output parsing with sscanf
No need to do manual parsing with STR_TO_SMB_BIG_UINT and manually
skipping whitespace
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit db2c61f0437eac0ddeb05eeb9e021090ca80d75f
Author: Volker Lendecke <[email protected]>
Date: Wed Jan 14 08:12:13 2026 +0100
smbd: Add a NULL check for dfree command output
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 0a8255d444ffd65f35c3e0d29767ba371b8e0cdb
Author: Volker Lendecke <[email protected]>
Date: Tue Jan 13 22:12:48 2026 +0100
smbd: Reduce indentation in handle_dfree_command with early returns
Review with git show -w
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 1f6d5b79d536aa50951c3efa8326e32391c30f2f
Author: Volker Lendecke <[email protected]>
Date: Tue Jan 13 22:06:06 2026 +0100
smbd: Factor out handling of dfree command into a separate function
Will enable code simplifications with early returns
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
commit 9766169d87d6bf8137bdda1a2018b373d615a27b
Author: Volker Lendecke <[email protected]>
Date: Wed Jan 14 08:28:57 2026 +0100
smbd: Modernize a few DEBUGs
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
-----------------------------------------------------------------------
Summary of changes:
lib/ldb/common/ldb_dn.c | 8 +-
lib/ldb/common/ldb_msg.c | 6 +-
lib/ldb/common/ldb_parse.c | 3 +-
lib/util/charset/util_str.c | 4 +-
lib/util/data_blob.c | 2 -
lib/util/data_blob.h | 2 +-
libcli/auth/tests/ntlm_check.c | 3 +-
libgpo/gpo_filesync.c | 2 +-
source3/auth/pampass.c | 4 +-
source3/include/nt_printing.h | 4 -
source3/include/proto.h | 3 -
source3/include/smb_macros.h | 1 -
source3/lib/sysquotas.c | 145 ++++++-------------
source3/lib/util.c | 39 -----
source3/lib/util_sec.c | 25 ++--
source3/lib/util_str.c | 27 ----
source3/modules/vfs_fruit.c | 62 ++++----
source3/param/loadparm.c | 20 +--
source3/printing/nt_printing.c | 231 +++++++++++++-----------------
source3/rpc_server/srvsvc/srv_srvsvc_nt.c | 33 +++++
source3/smbd/close.c | 7 +-
source3/smbd/dfree.c | 134 +++++++++--------
source3/smbd/smb1_utils.c | 4 +-
source4/kdc/ad_claims.c | 3 +-
source4/kdc/pac-glue.c | 9 +-
source4/torture/vfs/fruit.c | 2 +-
26 files changed, 334 insertions(+), 449 deletions(-)
Changeset truncated at 500 lines:
diff --git a/lib/ldb/common/ldb_dn.c b/lib/ldb/common/ldb_dn.c
index 389da444904..7596ce056f9 100644
--- a/lib/ldb/common/ldb_dn.c
+++ b/lib/ldb/common/ldb_dn.c
@@ -1258,9 +1258,7 @@ static struct ldb_dn_component ldb_dn_copy_component(
TALLOC_CTX *mem_ctx,
struct ldb_dn_component *src)
{
- struct ldb_dn_component dst;
-
- memset(&dst, 0, sizeof(dst));
+ struct ldb_dn_component dst = {};
if (src == NULL) {
return dst;
@@ -1304,9 +1302,7 @@ static struct ldb_dn_ext_component
ldb_dn_ext_copy_component(
TALLOC_CTX *mem_ctx,
struct ldb_dn_ext_component
*src)
{
- struct ldb_dn_ext_component dst;
-
- memset(&dst, 0, sizeof(dst));
+ struct ldb_dn_ext_component dst = {};
if (src == NULL) {
return dst;
diff --git a/lib/ldb/common/ldb_msg.c b/lib/ldb/common/ldb_msg.c
index 8477ab2b00b..5c77a2ca68d 100644
--- a/lib/ldb/common/ldb_msg.c
+++ b/lib/ldb/common/ldb_msg.c
@@ -1603,12 +1603,11 @@ char *ldb_timestring(TALLOC_CTX *mem_ctx, time_t t)
*/
time_t ldb_string_to_time(const char *s)
{
- struct tm tm;
+ struct tm tm = {};
time_t t;
if (s == NULL) return 0;
- memset(&tm, 0, sizeof(tm));
if (sscanf(s, "%04u%02u%02u%02u%02u%02u.0Z",
&tm.tm_year, &tm.tm_mon, &tm.tm_mday,
&tm.tm_hour, &tm.tm_min, &tm.tm_sec) != 6) {
@@ -1727,11 +1726,10 @@ char *ldb_timestring_utc(TALLOC_CTX *mem_ctx, time_t t)
*/
time_t ldb_string_utc_to_time(const char *s)
{
- struct tm tm;
+ struct tm tm = {};
if (s == NULL) return 0;
- memset(&tm, 0, sizeof(tm));
if (sscanf(s, "%02u%02u%02u%02u%02u%02uZ",
&tm.tm_year, &tm.tm_mon, &tm.tm_mday,
&tm.tm_hour, &tm.tm_min, &tm.tm_sec) != 6) {
diff --git a/lib/ldb/common/ldb_parse.c b/lib/ldb/common/ldb_parse.c
index f1d224a255e..49f817771c3 100644
--- a/lib/ldb/common/ldb_parse.c
+++ b/lib/ldb/common/ldb_parse.c
@@ -87,8 +87,7 @@ struct ldb_val ldb_binary_decode(TALLOC_CTX *mem_ctx, const
char *str)
ok = hex_byte(&str[i+1], &c);
if (!ok) {
talloc_free(ret.data);
- memset(&ret, 0, sizeof(ret));
- return ret;
+ return (struct ldb_val){};
}
((uint8_t *)ret.data)[j++] = c;
i += 2;
diff --git a/lib/util/charset/util_str.c b/lib/util/charset/util_str.c
index c52b77384ce..4c243e6976a 100644
--- a/lib/util/charset/util_str.c
+++ b/lib/util/charset/util_str.c
@@ -360,7 +360,7 @@ _PUBLIC_ size_t strlen_m_term_null(const char *s)
_PUBLIC_ char *strchr_m(const char *src, char c)
{
const char *s;
- struct smb_iconv_handle *ic = get_iconv_handle();
+ struct smb_iconv_handle *ic = NULL;
if (src == NULL) {
return NULL;
}
@@ -388,6 +388,8 @@ _PUBLIC_ char *strchr_m(const char *src, char c)
s = src;
#endif
+ ic = get_iconv_handle();
+
while (*s) {
size_t size;
codepoint_t c2 = next_codepoint_handle(ic, s, &size);
diff --git a/lib/util/data_blob.c b/lib/util/data_blob.c
index 12f4173c5e6..06375814ecb 100644
--- a/lib/util/data_blob.c
+++ b/lib/util/data_blob.c
@@ -24,8 +24,6 @@
#include "lib/util/samba_util.h"
#include "lib/util/tsort.h"
-const DATA_BLOB data_blob_null = { NULL, 0 };
-
/**
* @file
* @brief Manipulation of arbitrary data blobs
diff --git a/lib/util/data_blob.h b/lib/util/data_blob.h
index 1196eb52eb1..9fed49b5b5d 100644
--- a/lib/util/data_blob.h
+++ b/lib/util/data_blob.h
@@ -276,7 +276,7 @@ _PUBLIC_ bool data_blob_append(TALLOC_CTX *mem_ctx,
DATA_BLOB *blob,
_PUBLIC_ bool data_blob_pad(TALLOC_CTX *mem_ctx, DATA_BLOB *blob,
size_t pad);
-extern const DATA_BLOB data_blob_null;
+#define data_blob_null ((DATA_BLOB){})
/** @} */ /* data_blob */
diff --git a/libcli/auth/tests/ntlm_check.c b/libcli/auth/tests/ntlm_check.c
index 79b8ec9e28c..b637f2c50a3 100644
--- a/libcli/auth/tests/ntlm_check.c
+++ b/libcli/auth/tests/ntlm_check.c
@@ -350,6 +350,7 @@ static void test_ntlmv2_only_ntlm_and_lanman(void **state)
static void test_ntlmv2_only_ntlm_once(void **state)
{
DATA_BLOB user_sess_key, lm_sess_key;
+ DATA_BLOB null_blob = {};
struct ntlm_state *ntlm_state
= talloc_get_type_abort(*state,
struct ntlm_state);
@@ -359,7 +360,7 @@ static void test_ntlmv2_only_ntlm_once(void **state)
NTLM_AUTH_NTLMV2_ONLY,
0,
&ntlm_state->challenge,
- &data_blob_null,
+ &null_blob,
&ntlm_state->ntlm,
ntlm_state->username,
ntlm_state->username,
diff --git a/libgpo/gpo_filesync.c b/libgpo/gpo_filesync.c
index 07234dc37a4..980e53a27c2 100644
--- a/libgpo/gpo_filesync.c
+++ b/libgpo/gpo_filesync.c
@@ -148,7 +148,7 @@ static NTSTATUS gpo_sync_func(struct file_info *info,
ctx = (struct sync_context *)state;
- if (strequal(info->name, ".") || strequal(info->name, "..")) {
+ if (ISDOT(info->name) || ISDOTDOT(info->name)) {
return NT_STATUS_OK;
}
diff --git a/source3/auth/pampass.c b/source3/auth/pampass.c
index 88a909b7bd2..0fee228b381 100644
--- a/source3/auth/pampass.c
+++ b/source3/auth/pampass.c
@@ -148,12 +148,10 @@ static int smb_pam_conv(int num_msg,
return PAM_CONV_ERR;
}
- reply = SMB_MALLOC_ARRAY(struct pam_response, num_msg);
+ reply = SMB_CALLOC_ARRAY(struct pam_response, num_msg);
if (!reply)
return PAM_CONV_ERR;
- memset(reply, '\0', sizeof(struct pam_response) * num_msg);
-
for (replies = 0; replies < num_msg; replies++) {
switch (msg[replies]->msg_style) {
case PAM_PROMPT_ECHO_ON:
diff --git a/source3/include/nt_printing.h b/source3/include/nt_printing.h
index b89c3bd60e5..15d23d381d0 100644
--- a/source3/include/nt_printing.h
+++ b/source3/include/nt_printing.h
@@ -173,10 +173,6 @@ WERROR clean_up_driver_struct(TALLOC_CTX *mem_ctx,
uint32_t flags,
const char **driver_directory);
-void map_printer_permissions(struct security_descriptor *sd);
-
-void map_job_permissions(struct security_descriptor *sd);
-
bool print_time_access_check(const struct auth_session_info *server_info,
struct messaging_context *msg_ctx,
const char *servicename);
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 8847c3f4617..ca659235697 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -366,8 +366,6 @@ bool split_domain_user(TALLOC_CTX *mem_ctx,
char **user);
const char *strip_hostname(const char *s);
bool any_nt_status_not_ok(NTSTATUS err1, NTSTATUS err2, NTSTATUS *result);
-int timeval_to_msec(struct timeval t);
-char *valid_share_pathname(TALLOC_CTX *ctx, const char *dos_pathname);
bool is_executable(const char *fname);
bool map_open_params_to_ntcreate(const char *smb_base_fname,
int deny_mode, int open_func,
@@ -542,7 +540,6 @@ bool strlower_m(char *s);
bool strupper_m(char *s);
int fstr_sprintf(fstring s, const char *fmt, ...);
-uint64_t STR_TO_SMB_BIG_UINT(const char *nptr, const char **entptr);
uint64_t conv_str_size(const char * str);
char *talloc_asprintf_strupper_m(TALLOC_CTX *t, const char *fmt, ...)
PRINTF_ATTRIBUTE(2,3);
diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h
index 0d7ed45b770..73a9c78ef2e 100644
--- a/source3/include/smb_macros.h
+++ b/source3/include/smb_macros.h
@@ -175,7 +175,6 @@ copy an IP address from one buffer to another
****************************************************************************/
#define IS_DIRECTORY_SEP(c) ((c) == '\\' || (c) == '/')
-#define unix_format(fname) string_replace(fname,'\\','/')
/****************************************************************************
Make a file into DOS format.
diff --git a/source3/lib/sysquotas.c b/source3/lib/sysquotas.c
index ba8234165bd..52e5f384b83 100644
--- a/source3/lib/sysquotas.c
+++ b/source3/lib/sysquotas.c
@@ -249,11 +249,13 @@ static int command_get_quota(const char *path, enum
SMB_QUOTA_TYPE qtype, unid_t
loadparm_s3_global_substitution();
const char *get_quota_command = NULL;
char **lines = NULL;
+ char *line = NULL;
const char *p = NULL;
char *p2 = NULL;
int _id = -1;
int error = 0;
char **argl = NULL;
+ int ret;
get_quota_command = lp_get_quota_command(talloc_tos(), lp_sub);
if ((get_quota_command == NULL) || (get_quota_command[0] == '\0')) {
@@ -271,7 +273,7 @@ static int command_get_quota(const char *path, enum
SMB_QUOTA_TYPE qtype, unid_t
_id = id.gid;
break;
default:
- DEBUG(0,("invalid quota type.\n"));
+ DBG_ERR("invalid quota type.\n");
return -1;
}
@@ -293,120 +295,55 @@ static int command_get_quota(const char *path, enum
SMB_QUOTA_TYPE qtype, unid_t
lines = file_lines_ploadv(talloc_tos(), argl, NULL);
TALLOC_FREE(argl);
- if (lines) {
- char *line = lines[0];
-
- DEBUG (3, ("Read output from get_quota, \"%s\"\n", line));
-
- /* we need to deal with long long unsigned here, if supported */
-
- dp->qflags = smb_strtoul(line,
- &p2,
- 10,
- &error,
- SMB_STR_STANDARD);
- if (error != 0) {
- goto invalid_param;
- }
-
- p = p2;
- while (p && *p && isspace(*p)) {
- p++;
- }
-
- if (p && *p) {
- dp->curblocks = STR_TO_SMB_BIG_UINT(p, &p);
- } else {
- goto invalid_param;
- }
-
- while (p && *p && isspace(*p)) {
- p++;
- }
-
- if (p && *p) {
- dp->softlimit = STR_TO_SMB_BIG_UINT(p, &p);
- } else {
- goto invalid_param;
- }
-
- while (p && *p && isspace(*p)) {
- p++;
- }
-
- if (p && *p) {
- dp->hardlimit = STR_TO_SMB_BIG_UINT(p, &p);
- } else {
- goto invalid_param;
- }
-
- while (p && *p && isspace(*p)) {
- p++;
- }
-
- if (p && *p) {
- dp->curinodes = STR_TO_SMB_BIG_UINT(p, &p);
- } else {
- goto invalid_param;
- }
-
- while (p && *p && isspace(*p)) {
- p++;
- }
+ if ((lines == NULL) || (lines[0] == NULL)) {
+ DBG_ERR("get_quota_command failed!\n");
+ TALLOC_FREE(lines);
+ return -1;
+ }
- if (p && *p) {
- dp->isoftlimit = STR_TO_SMB_BIG_UINT(p, &p);
- } else {
- goto invalid_param;
- }
+ line = lines[0];
- while (p && *p && isspace(*p)) {
- p++;
- }
+ DBG_NOTICE("Read output from get_quota, \"%s\"\n", line);
- if (p && *p) {
- dp->ihardlimit = STR_TO_SMB_BIG_UINT(p, &p);
- } else {
- goto invalid_param;
- }
+ dp->bsize = 1024;
- while (p && *p && isspace(*p)) {
- p++;
- }
+ ret = sscanf(line,
+ "%" SCNu32 " %" SCNu64 " %" SCNu64 " %" SCNu64 " %" SCNu64
+ " %" SCNu64 " %" SCNu64 " %" SCNu64,
+ &dp->qflags,
+ &dp->curblocks,
+ &dp->softlimit,
+ &dp->hardlimit,
+ &dp->curinodes,
+ &dp->isoftlimit,
+ &dp->ihardlimit,
+ &dp->bsize);
- if (p && *p) {
- dp->bsize = STR_TO_SMB_BIG_UINT(p, NULL);
- } else {
- dp->bsize = 1024;
- }
+ TALLOC_FREE(lines);
- TALLOC_FREE(lines);
- lines = NULL;
-
- DBG_INFO("Parsed output of get_quota, ...\n"
- "qflags:%" PRIu32 " curblocks:%" PRIu64
- " softlimit:%" PRIu64 " hardlimit:%" PRIu64
- "\n"
- "curinodes:%" PRIu64 " isoftlimit:%" PRIu64
- " ihardlimit:%" PRIu64 " bsize:%" PRIu64 "\n",
- dp->qflags,
- dp->curblocks,
- dp->softlimit,
- dp->hardlimit,
- dp->curinodes,
- dp->isoftlimit,
- dp->ihardlimit,
- dp->bsize);
- return 0;
+ if (ret != 7) {
+ DBG_ERR("The output of get_quota_command is invalid!\n");
+ return -1;
}
- DEBUG (0, ("get_quota_command failed!\n"));
- return -1;
+ DBG_INFO("Parsed output of get_quota, ...\n"
+ "qflags:%" PRIu32 " curblocks:%" PRIu64 " softlimit:%" PRIu64
+ " hardlimit:%" PRIu64 "\n"
+ "curinodes:%" PRIu64 " isoftlimit:%" PRIu64
+ " ihardlimit:%" PRIu64 " bsize:%" PRIu64 "\n",
+ dp->qflags,
+ dp->curblocks,
+ dp->softlimit,
+ dp->hardlimit,
+ dp->curinodes,
+ dp->isoftlimit,
+ dp->ihardlimit,
+ dp->bsize);
+ return 0;
invalid_param:
-
TALLOC_FREE(lines);
- DEBUG(0,("The output of get_quota_command is invalid!\n"));
+ DBG_ERR("The output of get_quota_command is invalid!\n");
return -1;
}
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 41e18b55591..3308654d236 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -1531,45 +1531,6 @@ bool any_nt_status_not_ok(NTSTATUS err1, NTSTATUS err2,
NTSTATUS *result)
return false;
}
-int timeval_to_msec(struct timeval t)
-{
- return t.tv_sec * 1000 + (t.tv_usec+999) / 1000;
-}
-
-/*******************************************************************
- Check a given DOS pathname is valid for a share.
-********************************************************************/
-
-char *valid_share_pathname(TALLOC_CTX *ctx, const char *dos_pathname)
-{
- char *ptr = NULL;
-
- if (!dos_pathname) {
- return NULL;
- }
-
- ptr = talloc_strdup(ctx, dos_pathname);
- if (!ptr) {
- return NULL;
- }
- /* Convert any '\' paths to '/' */
- unix_format(ptr);
- ptr = unix_clean_name(ctx, ptr);
- if (!ptr) {
- return NULL;
- }
-
- /* NT is braindead - it wants a C: prefix to a pathname ! So strip it.
*/
- if (strlen(ptr) > 2 && ptr[1] == ':' && ptr[0] != '/')
- ptr += 2;
-
- /* Only absolute paths allowed. */
- if (*ptr != '/')
- return NULL;
-
- return ptr;
-}
-
/*******************************************************************
Return True if the filename is one of the special executable types.
********************************************************************/
diff --git a/source3/lib/util_sec.c b/source3/lib/util_sec.c
index 8fe0efa0bf4..73d1314b17e 100644
--- a/source3/lib/util_sec.c
+++ b/source3/lib/util_sec.c
@@ -60,27 +60,28 @@ as non-root while catching trapdoor systems
void sec_init(void)
{
- static int initialized;
+ static bool initialized = false;
- if (!initialized) {
+ if (initialized) {
+ return;
+ }
#ifndef AUTOCONF_TEST
- if (uid_wrapper_enabled()) {
- setenv("UID_WRAPPER_MYUID", "1", 1);
- }
+ if (uid_wrapper_enabled()) {
+ setenv("UID_WRAPPER_MYUID", "1", 1);
+ }
#endif
- initial_uid = geteuid();
- initial_gid = getegid();
+ initial_uid = geteuid();
+ initial_gid = getegid();
#ifndef AUTOCONF_TEST
- if (uid_wrapper_enabled()) {
- unsetenv("UID_WRAPPER_MYUID");
- }
+ if (uid_wrapper_enabled()) {
+ unsetenv("UID_WRAPPER_MYUID");
+ }
#endif
- initialized = 1;
- }
+ initialized = true;
}
/****************************************************************************
--
Samba Shared Repository