!2 Modify nss_wrapper.pl to directly change the /etc/group
Merge pull request !2 from sigui/master
This commit is contained in:
commit
129732d1b9
@ -0,0 +1,28 @@
|
|||||||
|
From a846e000b590c68ba4532c5b796614262f734328 Mon Sep 17 00:00:00 2001
|
||||||
|
From: si-gui <245140120@qq.com>
|
||||||
|
Date: Fri, 4 Sep 2020 14:46:49 +0800
|
||||||
|
Subject: [PATCH] Optimized group_save implemenation in case of selinux attr changes
|
||||||
|
Optimized group_save implemenation in case of selinux attr changes, and
|
||||||
|
calling the shell's cp command would be a good decision until a better
|
||||||
|
way is found
|
||||||
|
|
||||||
|
Signed-off-by: si-gui <245140120@qq.com>
|
||||||
|
---
|
||||||
|
nss_wrapper.pl | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/nss_wrapper.pl b/nss_wrapper.pl
|
||||||
|
index 48fa2c5..6c3f666 100755
|
||||||
|
--- a/nss_wrapper.pl
|
||||||
|
+++ b/nss_wrapper.pl
|
||||||
|
@@ -375,6 +375,7 @@ sub group_save($)
|
||||||
|
my @lines = ();
|
||||||
|
my $path = $group->{path};
|
||||||
|
my $tmppath = $path.$$;
|
||||||
|
+ system("cp -a $path $tmppath");
|
||||||
|
|
||||||
|
foreach my $eref (@{$group->{array}}) {
|
||||||
|
next unless defined($eref);
|
||||||
|
--
|
||||||
|
2.23.0
|
||||||
|
|
||||||
@ -1,10 +1,11 @@
|
|||||||
Name: nss_wrapper
|
Name: nss_wrapper
|
||||||
Version: 1.1.3
|
Version: 1.1.3
|
||||||
Release: 2
|
Release: 3
|
||||||
License: BSD
|
License: BSD
|
||||||
Summary: A wrapper for the user, group and hosts NSS API
|
Summary: A wrapper for the user, group and hosts NSS API
|
||||||
Url: https://cwrap.org/
|
Url: https://cwrap.org/
|
||||||
Source0: https://ftp.samba.org/pub/cwrap/%{name}-%{version}.tar.gz
|
Source0: https://ftp.samba.org/pub/cwrap/%{name}-%{version}.tar.gz
|
||||||
|
Patch0000: 0001-Optimized-group_save-implemenation-in-case-of-selinux-attr-changes.patch
|
||||||
|
|
||||||
BuildRequires: cmake libcmocka-devel
|
BuildRequires: cmake libcmocka-devel
|
||||||
Requires: cmake pkgconfig
|
Requires: cmake pkgconfig
|
||||||
@ -71,5 +72,8 @@ make test
|
|||||||
%{_mandir}/man1/nss_wrapper.1*
|
%{_mandir}/man1/nss_wrapper.1*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Sep 3 2020 Guoshuai Sun <sunguoshuai@huawei.com> - 1.1.3-3
|
||||||
|
- Optimized group_save implemenation in case of selinux attr changes
|
||||||
|
|
||||||
* Thu Nov 28 2019 yangjian<yangjian79@huawei.com> - 1.1.3-2
|
* Thu Nov 28 2019 yangjian<yangjian79@huawei.com> - 1.1.3-2
|
||||||
- Package init
|
- Package init
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user