Bug 13070 - Avoid running RPM/DPKG-suffixed event scripts
Summary: Avoid running RPM/DPKG-suffixed event scripts
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: CTDB (show other bugs)
Version: 4.7.0
Hardware: All All
: P5 enhancement (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-04 08:38 UTC by Mathieu Parent
Modified: 2017-11-01 08:56 UTC (History)
3 users (show)

See Also:


Attachments
Patches for v4-7 (3.14 KB, patch)
2017-10-20 04:21 UTC, Amitay Isaacs
martins: review+
Details
Patches for v4-6 (1.72 KB, patch)
2017-10-20 04:21 UTC, Amitay Isaacs
martins: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Parent 2017-10-04 08:38:59 UTC
If events script run during package upgrade, events scripts will be duplicated (with .rpmnew on RH, and .dpkg-new on Debian). This will lead to error, especially for 10.interface ("IP reallocation failed with result -1")

The function script_filter (https://git.samba.org/?p=samba.git;a=blob;f=ctdb/common/run_event.c;h=e5d562c96b3926600efc0cf3b0e4d370c87a5c55;hb=HEAD#l40) should be improved to skip files ending with .cfgsaved, .rpmsave, .rpmorig, .rpmnew, .swp, .dpkg-old, .dpkg-dist, .dpkg-new, .dpkg-tmp)


I can write a patch inspired by run-parts (https://anonscm.debian.org/cgit/users/clint/debianutils.git/tree/run-parts.c), but I don't know if using regexp is common practice in samba codebase. Please tell me what to do!
Comment 1 Amitay Isaacs 2017-10-20 04:21:31 UTC
Created attachment 13707 [details]
Patches for v4-7
Comment 2 Amitay Isaacs 2017-10-20 04:21:56 UTC
Created attachment 13708 [details]
Patches for v4-6
Comment 3 Martin Schwenke 2017-10-20 04:57:42 UTC
Hi Karolin,

This is ready for 4.7, 4.6.

Thanks...
Comment 4 Karolin Seeger 2017-10-24 10:55:37 UTC
(In reply to Martin Schwenke from comment #3)
Pushed to autobuild-v4-{7,6}-test.
Comment 5 Karolin Seeger 2017-11-01 08:56:16 UTC
(In reply to Karolin Seeger from comment #4)
Pushed to both branches.
Closing out bug report.

Thanks!