This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2125339 - vfs_crossrename not working in samba-4.15.*
Summary: vfs_crossrename not working in samba-4.15.*
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: samba
Version: 8.6
Hardware: Unspecified
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Pavel Filipensky
QA Contact: Denis Karpelevich
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-09-08 16:45 UTC by Chino Soliard
Modified: 2023-09-05 12:19 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-09-05 12:19:32 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   RHEL-2223 0 None Migrated None 2023-09-05 12:19:28 UTC
Red Hat Issue Tracker RHELPLAN-133566 0 None None None 2022-09-08 16:55:43 UTC
Red Hat Issue Tracker SSSD-5043 0 None None None 2022-09-20 11:44:53 UTC

Description Chino Soliard 2022-09-08 16:45:23 UTC
-----------------------
Description of problem:
-----------------------
Trying to create a trash (recycle) for a Samba share, the path
for the recycle is in another filesystem. Using vfs_crossrename
is a requirement.
While the configuration is working with samba-4.12.3-14, it is
not working in newest Samba version (4.15.5).

Note: It looks like a regression.

-------------------------------------------------------------
Version-Release number of selected component (if applicable):
-------------------------------------------------------------

- Working:
  - samba-4.12.3-14

- Not working
  - samba-4.13.3-3
  - latest samba version 4.15.5
  - Versions between 4.13.3 and 4.15.5 were not tested

-----------------
How reproducible:
-----------------

This issue is constantly happening, is not an intermittent
issue. vfs_crossrename is not working in newer versions.

Steps to Reproduce:
-------------------

1. Install Samba packages

2. Configure recycle in a share using another filesystem
   than the Samba share itself:
    _________________________________________________________

    [test]
        comment = test
        path = /test/
        writeable = Yes
        read only = No
        browseable = No

        vfs objects = full_audit recycle crossrename
        full_audit:success = open write unlink rmdir mkdir rename chmod chown
        full_audit:failure = none
        full_audit:prefix = %u|%I
        full_audit:facility = LOCAL5
        full_audit:priority = NOTICE

        recycle:exclude = *.~*, ~*.*, *.bak, *.tmp, *.TMP, *.temp, *.o, *.obj,  Thumbs.db, .~lock.*, *.lnk
        recycle:keeptree = yes
        recycle:touch = true
        recycle:versions = yes
        recycle:noversions = *.doc,*.xls,*.htm,*.html,*.txt,*.ppt,*.mp3,*.docx,*.pptx,*.xlsx,*.ods,*.odt,*.odp,*.jpg,*.jpeg,*.png,*.bmp,*.pdf
        recycle:repository = /anotherfilesystem/
        crossrename:sizelimit = 2000
    _________________________________________________________

3. Remove a file from a Samba client (Windows, for example).


Actual results:
---------------
- The file is not going to be moved to the recycle path.

Expected results:
-----------------
- The file should be moved to recycle path.

Additional info:
----------------
- Same configuration is working with samba-4.12.3-14
- If recycle path is changed to the same filesystem, it works

Comment 3 Pavel Filipensky 2022-09-20 10:36:19 UTC
I was able to reproduced it. Starting analysis.

Comment 5 Pavel Filipensky 2022-10-05 09:44:09 UTC
I have found the root cause:

copy_reg() in source3/modules/vfs_crossrename.c is no longer checking errno aganst ENOENT from unlink() call.
Older/working samba version does:

if (ret == -1 && errno != ENOENT) {

Comment 6 Pavel Filipensky 2022-10-11 07:55:08 UTC
There is ongoing discussion with the upstream about the fix. After the recent implementation of symbolic link related security fixes, the crossrename module no longer works and there is no easy way to fix it. A question, if we should remove the crossrename module, has arised. The correct setup of share directories should not use crossrename module anyway.

Can you please check it with the customer?

Comment 9 Pavel Filipensky 2022-10-24 07:19:32 UTC
Hi Chino,

the issue was discussed in the samba team and the decision is to fix the crossrename. 
It can take a longer time, since the fix is not easy.

Meanwhile, the customer can consider to configure the recycle bin on the same filesystem and remove the crossrename module.

Pavel

Comment 13 RHEL Program Management 2023-09-05 12:15:47 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 14 RHEL Program Management 2023-09-05 12:19:32 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues.


Note You need to log in before you can comment on or make changes to this bug.