-
Notifications
You must be signed in to change notification settings - Fork 252
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
:relnote: SSSD service will set `NISDOMAIN` value from `/etc/sysconfig/network` as a domain name at service startup. This is required to support netgroups in LDAP-stored SUDO rules. Resolves: #7224
- Loading branch information
1 parent
8cdebfc
commit c03e876
Showing
5 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/sh | ||
|
||
source /etc/sysconfig/network | ||
|
||
# Note: this tool requires 'CAP_SYS_ADMIN'. | ||
# Intended usage is to run from systemd service file. | ||
|
||
if [ -n "${NISDOMAIN}" ] && [ -x @libexecdir@/sssd/setdomainname ]; then | ||
@libexecdir@/sssd/setdomainname ${NISDOMAIN} | ||
fi | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
Copyright (C) 2024 Red Hat | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include <stddef.h> | ||
#include <unistd.h> | ||
#include <errno.h> | ||
#include <string.h> | ||
|
||
|
||
int main(int argc, const char *argv[]) | ||
{ | ||
if (argc != 2) { | ||
return EINVAL; | ||
} | ||
|
||
if ((argv[1] == NULL) || (argv[1][0] == 0)) { | ||
return EINVAL; | ||
} | ||
|
||
errno = 0; | ||
setdomainname(argv[1], strlen(argv[1])); | ||
|
||
return errno; | ||
} |