summaryrefslogtreecommitdiff
path: root/source3/printing
AgeCommit message (Collapse)AuthorFilesLines
2026-04-08printing: Set default value in case of non-exisiting recordVinit Agnihotri1-8/+13
This fixes regression caused by commit#e9a7dce599 Newly added function treats non-existing record as error, instead of setting just -1 i.e. default value for non-exisiting record for printing subsystem. This results into print_cache_expired returning incorrect status. Fix sets default value in case of non-exisiting record which would ensure print_cache_expired to return correct status. BUG: https://bugzilla.samba.org/show_bug.cgi?id=16038 Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com> Reviewed-by: Rabinarayan Panigrahi <rapanigr@redhat.com> Reviewed-by: Avan Thakkar <athakkar@redhat.com> Reviewed-by: Xavi Hernandez <xhernandez@redhat.com> Reviewed-by: Anoop C S <anoopcs@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
2026-04-07s3:printing: make printer_list.tdb none readable for othersShwetha Acharya1-1/+1
Signed-off-by: Shwetha Acharya <Shwetha.K.Acharya@ibm.com> Reviewed-by: Xavi Hernandez <xhernandez@redhat.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Anoop C S <anoopcs@samba.org> Autobuild-User(master): Anoop C S <anoopcs@samba.org> Autobuild-Date(master): Tue Apr 7 16:12:32 UTC 2026 on atb-devel-224
2026-03-01printing: Call create_conn_struct_chdir()Volker Lendecke1-21/+28
This is only linked from rpcd_spoolss, where we don't depend on an implicit current working directory. We don't need the "jump back to old cwd" that create_conn_struct_tos_cwd() provided. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-03-01printing: Streamline move_driver_to_download_area()Volker Lendecke1-14/+16
Centralize cleanup Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-03-01printing: Streamline delete_driver_files()Volker Lendecke1-19/+14
Centralize cleanup Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-03-01printing: Streamline get_correct_cversion()Volker Lendecke1-56/+51
Make it return WERROR, centralize cleanup at the end of the function. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-03-01printing: Modernize DEBUGsVolker Lendecke1-41/+45
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-02-15smbserver: Convert callers of sys_fsusage to sys_statvfsVolker Lendecke1-8/+14
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-30s3/printing: Fix leaking parsed optionsNoel Power1-0/+3
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15979 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Fri Jan 30 11:09:44 UTC 2026 on atb-devel-224
2026-01-30s3/printing: Fix leaked mem ctx returned from talloc_newNoel Power1-2/+3
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15979 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2026-01-21printing: Fix compilation error for native 32-bit time_tMichael Tokarev1-2/+5
commit#e9a7dce599eb12d broke samba compilation for 32-bit time_t. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15976 Used correct pointer type to fix the warning to fix compialtion. Pair-Programmed-With: Vinit Agnihotri <vagnihot@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com> Reviewed-by: Günther Deschner <gd@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Wed Jan 21 19:23:29 UTC 2026 on atb-devel-224
2026-01-20printing: Inline oneliners used just onceVolker Lendecke1-17/+3
This patch and the 2 previous ones could be squashed, but it's the way those unfolded :-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-20printing: Simplify mapping permissionsVolker Lendecke1-12/+2
Use security_acl_map_generic() Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-20printing: Make structures const staticVolker Lendecke1-11/+2
While there, remove an unused mapping Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-20printing: Simplify file_version_is_newer()Volker Lendecke1-16/+12
We don't need to call fstat(), driver_unix_convert() already does it via filename_convert_dirfsp(). Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-20printing: Make file_version_is_newer() more preciseVolker Lendecke1-15/+13
We have timespec_compare, we don't have to loose info. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-20printing: Fix file_version_is_newer()Volker Lendecke1-1/+3
fstring as a function parameter does not really make sense... Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-20printing: Apply some constVolker Lendecke1-13/+13
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-20printing: Simplify driver_unix_convert()Volker Lendecke1-5/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-20printing: Remove indentation with a "goto done"Volker Lendecke1-30/+31
Review with "git show -w". Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-20printing: A little bit of README.Coding in nt_printing.cVolker Lendecke1-1/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-20printing: Slightly simplify move_driver_file_to_download_area()Volker Lendecke1-1/+6
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-20printing: Modernize a few DEBUGsVolker Lendecke1-26/+32
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-20lib: Remove the pointless unix_format() macroVolker Lendecke1-1/+1
One of the two callers even had a comment what it does... Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-20printing: Simplify move_driver_to_download_area()Volker Lendecke1-5/+6
No need to call strlen() here. Just came across this while looking at SMB_VFS_CREATE_FILE callers... Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-17printing: Fix coverity issue CID#1669074 (Unchecked return value)Vinit Agnihotri1-1/+7
A new coverity issue (Unchecked return value) is flagged as a regression due to commit#e9a7dce599e. This could have been present prior to comit#e9a7dce599e, however got missed. This change fixes this issue by checking return value. Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com> Reviewed-by: Anoop C S <anoopcs@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Anoop C S <anoopcs@samba.org> Autobuild-Date(master): Mon Nov 17 08:31:24 UTC 2025 on atb-devel-224
2025-11-14s3:printing: Load the shares for [printers] in samba-bgqdAndreas Schneider1-0/+3
One of the main functions of bgqd is: delete_and_reload_printers_full() It isn't able to do its work, if we don't load the shares. Normally bgqd was forked from smbd and this loaded the shares. But with the introduction of samba-dcerpcd it is a standalone service now. As a standalone service it is responsible to load the shares if it needs to work on them. The following message is printed if delete_and_reload_printers_full() tries to do its job: [2025/10/23 09:57:27, 7, pid=41935, effective(0, 0), real(0, 0)] ../../source3/param/loadparm.c:4419(lp_servicenumber) lp_servicenumber: couldn't find printers [2025/10/23 09:57:27, 7, pid=41935, effective(0, 0), real(0, 0)] ../../source3/param/loadparm.c:4419(lp_servicenumber) lp_servicenumber: couldn't find printers BUG: https://bugzilla.samba.org/show_bug.cgi?id=15936 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-12printing: Fix use of time_t CID#1509005Vinit Agnihotri1-13/+13
- This Fixes coverity issue Y2K38_SAFTY in print_queue_update(), with use of fetch/store_share_cache_time helper function. - Additional changes: Use helper functions fetch/store_share_cache_time for tdb key==MSG_PENDING for print_cache_expired() Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org> Autobuild-User(master): Anoop C S <anoopcs@samba.org> Autobuild-Date(master): Wed Nov 12 16:04:43 UTC 2025 on atb-devel-224
2025-11-12printing: Fix use of time_t CID#1509036Vinit Agnihotri1-10/+12
- Use format specifier 'D' for time_t - This fixes covery reported issue Y2K38_SAFTY for pjob_store() Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-12printing: Fix use of time_t CID#1508987Vinit Agnihotri1-12/+15
- This fixes coverity issue Y2K38_SAFTY for print_update_queue_internal() Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-12printing: Define and use methods to fetch/store time in share cacheVinit Agnihotri1-5/+56
Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-10lib: Introduce cp_smb_basename() helper functionVolker Lendecke1-6/+1
I always had to look up the sequence of NULLs and 0s. Save lines. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Nov 10 14:33:28 UTC 2025 on atb-devel-224
2025-11-10s3: Remove TALLOC_REALLOC() macroVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-10s3: talloc_destroy() -> TALLOC_FREE()Volker Lendecke2-5/+5
Sweeping change, I know. Should not change compiled code in most cases, the compiler should be smart enough to elide the assignment right before a return. In the cases where this is not right before the return, TALLOC_FREE() is safer as it makes use-after-free crash. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-10s3: Replace a few calls to TALLOC() with talloc_array()Volker Lendecke1-1/+1
No explicit cast necessary Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-10printing: Fix trailing whitespaceVolker Lendecke1-6/+5
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-09-09printing: Fix an uninitialized readVolker Lendecke1-1/+1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15908 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Björn Baumbach <bb@sernet.de> Autobuild-User(master): Björn Baumbach <bb@sernet.de> Autobuild-Date(master): Tue Sep 9 11:06:34 UTC 2025 on atb-devel-224
2025-08-05source3/printing: Fix CID 1273086 - Resource LeakShwetha K Acharya1-2/+2
Ensure print_queue_struct *q is initialized to NULL to avoid undefined behavior when freeing on error paths. Move SAFE_FREE(q) outside the ret > 0 block to ensure q is always freed. Signed-off-by: Shwetha K Acharya <Shwetha.K.Acharya@ibm.com> Reviewed-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org> Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com> Autobuild-User(master): Anoop C S <anoopcs@samba.org> Autobuild-Date(master): Tue Aug 5 09:20:17 UTC 2025 on atb-devel-224
2025-05-15lib: Save lines by avoiding explicit ZERO_STRUCTP callsVolker Lendecke1-2/+1
SMB_CALLOC_ARRAY(..., 1) does this. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2025-02-05smbd: Remove vfs_file_exist()Volker Lendecke1-8/+1
Both callers followed this with SMB_VFS_CREATE_FILE which can be given FILE_NON_DIRECTORY_FILE as an option to achieve the same. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2024-12-17printing: Remove a few obsolete openat_pathref_fsp() callsVolker Lendecke1-22/+0
driver_convert_unix calls filename_convert_dirfsp, which these days fills smb_fname->fsp. So openat_pathref_fsp() will immediately return success as it finds smb_fname->fsp != NULL. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2024-12-02printing: Fix Coverity ID 1508942 Use of 32-bit time_tVolker Lendecke1-4/+7
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
2024-12-02printing: Fix Coverity ID 1509000 Use of 32-bit time_tVolker Lendecke1-4/+6
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
2024-11-06s3:printing and spoolss: s/the the\b/the/ in commentsDouglas Bagnall1-1/+1
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Volker Lendecke <vl@samba.org>
2024-09-25s3: SIGHUP handlers use consistent log level 3Jones Syue1-1/+1
When turn-on 'log level = 3', sending SIGHUP to samba processes, for example: smbd parent/children, smbd-notifyd, and smbd-cleanupd. Then monitor log.smbd in order to parse sighup logs, it looks like the log level is inconsistent among these processes: smbd parent/children use level 1, and smbd-notifyd/smbd-cleanupd use level 3. This patch raises sighup handler's log level from level 1 to level 3, which is more consistent with smbd-notifyd by Commit 6e5bff80a0a0b ("s3:notifyd: Handle sigup in notifyd to reparse smb.conf"), and smbd-cleanupd by Commit 57c1e115ecef4 ("smbd: reopen logs on SIGHUP for notifyd and cleanupd"). BUG: https://bugzilla.samba.org/show_bug.cgi?id=15706 Signed-off-by: Jones Syue <jonessyue@qnap.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Wed Sep 25 01:38:02 UTC 2024 on atb-devel-224
2024-07-19s3:printing: Allow to run samba-bgqd as a standalone systemd serviceAndreas Schneider1-1/+7
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15683 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Jul 19 11:13:28 UTC 2024 on atb-devel-224
2024-05-14s3:include: remove unused krb5_env.hStefan Metzmacher1-1/+0
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2024-05-14s3:printing: make use of ads_connect_machine()Stefan Metzmacher1-70/+9
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2024-04-16lib: Give lib/util/util_file.c its own header fileVolker Lendecke3-0/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
2024-03-22lib: Remove timeval_set()Volker Lendecke1-4/+7
We have the same function in tevent, no need to duplicate code. More lines just due to clang-format. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Mar 22 06:07:42 UTC 2024 on atb-devel-224