Update policycoreutils-rhat.patch from
4395ef2b8b
- setfiles/restorecon: fix -r/-R option
- fix -Wformat errors
This commit is contained in:
parent
06e7b82eb9
commit
bee8c3ec5f
@ -1779,9 +1779,18 @@ index 93804ac..1451903 100644
|
||||
+ except ValueError as e:
|
||||
self.error(e.args[0])
|
||||
diff --git a/policycoreutils-2.3/newrole/newrole.c b/policycoreutils-2.3/newrole/newrole.c
|
||||
index dfb8c7f..4e59a06 100644
|
||||
index dfb8c7f..2c6d1cf 100644
|
||||
--- a/policycoreutils-2.3/newrole/newrole.c
|
||||
+++ b/policycoreutils-2.3/newrole/newrole.c
|
||||
@@ -279,7 +279,7 @@ static int process_pam_config(FILE * cfg)
|
||||
continue;
|
||||
|
||||
app = service = NULL;
|
||||
- ret = sscanf(buffer, "%as %as\n", &app, &service);
|
||||
+ ret = sscanf(buffer, "%ms %ms\n", &app, &service);
|
||||
if (ret < 2 || !app || !service)
|
||||
goto err;
|
||||
|
||||
@@ -547,9 +547,7 @@ static int drop_capabilities(int full)
|
||||
if (!uid) return 0;
|
||||
|
||||
@ -1865,6 +1874,15 @@ index dfb8c7f..4e59a06 100644
|
||||
int pam_status; /* pam return code */
|
||||
pam_handle_t *pam_handle; /* opaque handle used by all PAM functions */
|
||||
|
||||
@@ -1105,7 +1110,7 @@ int main(int argc, char *argv[])
|
||||
* command when invoked by newrole.
|
||||
*/
|
||||
char *cmd = NULL;
|
||||
- rc = sscanf(argv[optind + 1], "%as", &cmd);
|
||||
+ rc = sscanf(argv[optind + 1], "%ms", &cmd);
|
||||
if (rc != EOF && cmd) {
|
||||
char *app_service_name =
|
||||
(char *)hashtab_search(app_service_names,
|
||||
@@ -1223,18 +1228,26 @@ int main(int argc, char *argv[])
|
||||
fprintf(stderr, _("Could not close descriptors.\n"));
|
||||
goto err_close_pam;
|
||||
@ -663149,7 +663167,7 @@ index 2a7cfa3..95fba09 100644
|
||||
char path[PATH_MAX + 1];
|
||||
|
||||
diff --git a/policycoreutils-2.3/setfiles/setfiles.c b/policycoreutils-2.3/setfiles/setfiles.c
|
||||
index ac1c39a..184ef52 100644
|
||||
index ac1c39a..3175268 100644
|
||||
--- a/policycoreutils-2.3/setfiles/setfiles.c
|
||||
+++ b/policycoreutils-2.3/setfiles/setfiles.c
|
||||
@@ -153,6 +153,9 @@ int main(int argc, char **argv)
|
||||
@ -663162,7 +663180,23 @@ index ac1c39a..184ef52 100644
|
||||
|
||||
memset(&r_opts, 0, sizeof(r_opts));
|
||||
|
||||
@@ -225,8 +228,13 @@ int main(int argc, char **argv)
|
||||
@@ -196,6 +199,7 @@ int main(int argc, char **argv)
|
||||
r_opts.add_assoc = 1;
|
||||
r_opts.fts_flags = FTS_PHYSICAL | FTS_XDEV;
|
||||
ctx_validate = 1;
|
||||
+ opts = sopts;
|
||||
} else {
|
||||
/*
|
||||
* restorecon:
|
||||
@@ -215,6 +219,7 @@ int main(int argc, char **argv)
|
||||
r_opts.add_assoc = 0;
|
||||
r_opts.fts_flags = FTS_PHYSICAL;
|
||||
ctx_validate = 0;
|
||||
+ opts = ropts;
|
||||
|
||||
/* restorecon only: silent exit if no SELinux.
|
||||
Allows unconditional execution by scripts. */
|
||||
@@ -225,8 +230,13 @@ int main(int argc, char **argv)
|
||||
/* This must happen before getopt. */
|
||||
r_opts.nfile = exclude_non_seclabel_mounts();
|
||||
|
||||
@ -663177,16 +663211,27 @@ index ac1c39a..184ef52 100644
|
||||
switch (opt) {
|
||||
case 'c':
|
||||
{
|
||||
@@ -326,7 +334,7 @@ int main(int argc, char **argv)
|
||||
@@ -315,18 +325,13 @@ int main(int argc, char **argv)
|
||||
recurse = 1;
|
||||
break;
|
||||
}
|
||||
- if (optind + 1 >= argc) {
|
||||
- fprintf(stderr, "usage: %s -r rootpath\n",
|
||||
- argv[0]);
|
||||
- exit(-1);
|
||||
- }
|
||||
if (NULL != r_opts.rootpath) {
|
||||
fprintf(stderr,
|
||||
"%s: only one -r can be specified\n",
|
||||
argv[0]);
|
||||
exit(-1);
|
||||
}
|
||||
- set_rootpath(argv[optind++]);
|
||||
+ set_rootpath(argv[optind]);
|
||||
+ set_rootpath(optarg);
|
||||
break;
|
||||
case 's':
|
||||
use_input_file = 1;
|
||||
@@ -337,7 +345,7 @@ int main(int argc, char **argv)
|
||||
@@ -337,7 +342,7 @@ int main(int argc, char **argv)
|
||||
if (r_opts.progress) {
|
||||
fprintf(stderr,
|
||||
"Progress and Verbose mutually exclusive\n");
|
||||
|
@ -18,7 +18,7 @@ Source2: policycoreutils_man_ru2.tar.bz2
|
||||
Source3: system-config-selinux.png
|
||||
Source4: sepolicy-icons.tgz
|
||||
# use make-rhat-patches.sh to create following patches from https://github.com/fedora-selinux/selinux/
|
||||
# https://github.com/fedora-selinux/selinux/commit/2f23ca54e96a0c1465fbfb0f83196beca0fedccf
|
||||
# HEAD https://github.com/fedora-selinux/selinux/commit/4395ef2b8bb086878b5fad80321ac9d32f424f51
|
||||
Patch: policycoreutils-rhat.patch
|
||||
Patch1: sepolgen-rhat.patch
|
||||
Obsoletes: policycoreutils < 2.0.61-2
|
||||
|
Loading…
Reference in New Issue
Block a user