Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package restorecond for openSUSE:Factory checked in at 2026-12-05 19:09:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/restorecond (Old) and /work/SRC/openSUSE:Factory/.restorecond.new.1340718 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "restorecond" Sat Dec 5 19:09:57 2026 rev:24 rq:1402970 version:3.12 Changes: -------- --- /work/SRC/openSUSE:Factory/restorecond/restorecond.changes 2026-07-13 14:25:16.365684948 +0200 +++ /work/SRC/openSUSE:Factory/.restorecond.new.1340718/restorecond.changes 2026-12-05 19:11:27.617843276 +0100 @@ -1,0 +2,23 @@ +Thu Dec 3 09:00:36 UTC 2026 - Cathy Hu <[email protected]> + +- Update to version 3.12 + https://github.com/SELinuxProject/selinux/releases/tag/v3.12 + - Security/hardening changes: + - Hardened sandbox, newrole, restorecond and mcstrans handling of + commands, temporary files, signals and configuration data, including + constant-time comparison of shadow password hashes in newrole, bounded + Include nesting depth in mcstrans, a hardened mcstrans systemd service + file, and use of openat2() where available in sandbox/seunshare, + restorecond and selinux_restorecon(3). + - Notable bug fixes: + - restorecond: switch terminate to sig_atomic_t for async-signal-safety + - restorecond: copy homedir to avoid overwrite by later getpw*() calls + - restorecond: fix type of utmpwatcher_handle() +- Source URLs: upstream tags are prefixed with "v" now + +------------------------------------------------------------------- +Wed Dec 2 13:07:50 UTC 2026 - Cathy Hu <[email protected]> + +- keyring: update bachradsusi.gpg for next release + +-------------------------------------------------------------------- Old: ---- restorecond-3.11.tar.gz restorecond-3.11.tar.gz.asc New: ---- restorecond-3.12.tar.gz restorecond-3.12.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ restorecond.spec ++++++ --- /var/tmp/diff_new_pack.SlkLIE/_old 2026-12-05 19:11:28.447878256 +0100 +++ /var/tmp/diff_new_pack.SlkLIE/_new 2026-12-05 19:11:28.448878298 +0100 @@ -16,16 +16,16 @@ # -%define libselinux_ver 3.11 +%define libselinux_ver 3.12 Name: restorecond -Version: 3.11 +Version: 3.12 Release: 0 Summary: Daemon to restore SELinux contexts License: GPL-2.0-or-later Group: Productivity/Security URL: https://github.com/SELinuxProject/selinux.git -Source0: https://github.com/SELinuxProject/selinux/releases/download/%{version}/%{name}-%{version}.tar.gz -Source1: https://github.com/SELinuxProject/selinux/releases/download/%{version}/%{name}-%{version}.tar.gz.asc +Source0: https://github.com/SELinuxProject/selinux/releases/download/v%{version}/%{name}-%{version}.tar.gz +Source1: https://github.com/SELinuxProject/selinux/releases/download/v%{version}/%{name}-%{version}.tar.gz.asc Source2: restorecond.keyring Patch0: harden_restorecond.service.patch BuildRequires: dbus-1-glib-devel ++++++ restorecond-3.11.tar.gz -> restorecond-3.12.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/restorecond-3.11/VERSION new/restorecond-3.12/VERSION --- old/restorecond-3.11/VERSION 2026-07-01 18:51:05.000000000 +0200 +++ new/restorecond-3.12/VERSION 2026-12-02 18:39:01.000000000 +0100 @@ -1 +1 @@ -3.11 +3.12 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/restorecond-3.11/restorecond.8 new/restorecond-3.12/restorecond.8 --- old/restorecond-3.11/restorecond.8 2026-07-01 18:51:05.000000000 +0200 +++ new/restorecond-3.12/restorecond.8 2026-12-02 18:39:01.000000000 +0100 @@ -11,7 +11,11 @@ .BR restorecond program. .P -This daemon uses inotify to watch files listed in the /etc/selinux/restorecond.conf, when they are created, this daemon will make sure they have +This daemon uses inotify to watch files listed in the +.I {/etc,/usr/lib}/selinux/restorecond.conf +file. + +When any of the listed files are created, this daemon will make sure they have the correct file context associated with the policy. .SH "OPTIONS" @@ -30,7 +34,9 @@ Run in foreground, do not become a daemon. .TP .B \-u -Turns on user mode. Runs restorecond in the user session and reads /etc/selinux/restorecond_user.conf. Uses dbus to make sure only one restorecond is running per user session. +Turns on user mode. Runs restorecond in the user session and reads the +.I {/etc,/usr/lib}/selinux/restorecond_user.conf +file. Uses dbus to make sure only one restorecond is running per user session. .TP .B \-v Turns on verbose debugging. (Report missing files) @@ -39,8 +45,22 @@ This man page and program was written by Dan Walsh <[email protected]>. .SH "FILES" -/etc/selinux/restorecond.conf -/etc/selinux/restorecond_user.conf +.TP +.I /etc/selinux/restorecond.conf +.TP +.I /usr/lib/selinux/restorecond.conf +The restorecond root daemon configuration file. The file in +.B /etc +overrides the default configuration provided by the vendor in +.BR /usr/lib . +.TP +.I /etc/selinux/restorecond_user.conf +.TP +.I /usr/lib/selinux/restorecond_user.conf +The restorecond user session configuration file. The file in +.B /etc +overrides the default configuration provided by the vendor in +.BR /usr/lib . .SH "SEE ALSO" .BR restorecon (8), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/restorecond-3.11/restorecond.c new/restorecond-3.12/restorecond.c --- old/restorecond-3.11/restorecond.c 2026-07-01 18:51:05.000000000 +0200 +++ new/restorecond-3.12/restorecond.c 2026-12-02 18:39:01.000000000 +0100 @@ -65,15 +65,39 @@ const char *homedir; static int master_fd = -1; -static const char *server_watch_file = "/etc/selinux/restorecond.conf"; -static const char *user_watch_file = "/etc/selinux/restorecond_user.conf"; +#ifndef RESTORECOND_CONFDIRS +#define RESTORECOND_CONFDIRS "/etc/selinux/", "/usr/lib/selinux/" +#endif + +static const char *resolve_watch_file(const char *name, char *out, size_t len) +{ + static const char *dirs[] = { RESTORECOND_CONFDIRS, NULL }; + unsigned int i; + + for (i = 0; dirs[i]; i++) { + snprintf(out, len, "%s%s", dirs[i], name); + if (access(out, R_OK) == 0) + return out; + } + /* + * Nothing found: return the primary path so the eventual open() + * error names the location an administrator would create. + */ + snprintf(out, len, "%s%s", dirs[0], name); + return out; +} + +static char server_watch_path[PATH_MAX]; +static char user_watch_path[PATH_MAX]; +static const char *server_watch_file; +static const char *user_watch_file; static const char *watch_file; struct restore_opts r_opts; #include <selinux/selinux.h> int debug_mode = 0; -int terminate = 0; +volatile sig_atomic_t terminate = 0; int master_wd = -1; int run_as_user = 0; int foreground_mode = 0; @@ -152,6 +176,13 @@ if (is_selinux_enabled() != 1) return 0; + server_watch_file = resolve_watch_file("restorecond.conf", + server_watch_path, + sizeof(server_watch_path)); + + user_watch_file = resolve_watch_file("restorecond_user.conf", + user_watch_path, + sizeof(user_watch_path)); watch_file = server_watch_file; /* Set all options to zero/NULL except for ignore_noent, digest, and skip_multilink. */ @@ -206,7 +237,10 @@ if (!pwd) exitApp("getpwuid"); - homedir = pwd->pw_dir; + homedir = strdup(pwd->pw_dir); + if (!homedir) + exitApp("strdup"); + if (uid != 0) { if (run_as_user) return server(master_fd, user_watch_file); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/restorecond-3.11/restorecond.h new/restorecond-3.12/restorecond.h --- old/restorecond-3.11/restorecond.h 2026-07-01 18:51:05.000000000 +0200 +++ new/restorecond-3.12/restorecond.h 2026-12-02 18:39:01.000000000 +0100 @@ -24,9 +24,11 @@ #ifndef RESTORED_CONFIG_H #define RESTORED_CONFIG_H +#include <signal.h> + extern int debug_mode; extern const char *homedir; -extern int terminate; +extern volatile sig_atomic_t terminate; extern int master_wd; extern int run_as_user; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/restorecond-3.11/utmpwatcher.c new/restorecond-3.12/utmpwatcher.c --- old/restorecond-3.11/utmpwatcher.c 2026-07-01 18:51:05.000000000 +0200 +++ new/restorecond-3.12/utmpwatcher.c 2026-12-02 18:39:01.000000000 +0100 @@ -45,7 +45,7 @@ static struct stringsList *utmp_ptr = NULL; static int utmp_wd = -1; -unsigned int utmpwatcher_handle(int inotify_fd, int wd) +int utmpwatcher_handle(int inotify_fd, int wd) { int changed = 0; struct utmp u; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/restorecond-3.11/utmpwatcher.h new/restorecond-3.12/utmpwatcher.h --- old/restorecond-3.11/utmpwatcher.h 2026-07-01 18:51:05.000000000 +0200 +++ new/restorecond-3.12/utmpwatcher.h 2026-12-02 18:39:01.000000000 +0100 @@ -23,7 +23,7 @@ #ifndef UTMPWATCHER_H #define UTMPWATCHER_H -unsigned int utmpwatcher_handle(int inotify_fd, int wd); +int utmpwatcher_handle(int inotify_fd, int wd); void utmpwatcher_add(int inotify_fd, const char *path); void utmpwatcher_free(void); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/restorecond-3.11/watch.c new/restorecond-3.12/watch.c --- old/restorecond-3.11/watch.c 2026-07-01 18:51:05.000000000 +0200 +++ new/restorecond-3.12/watch.c 2026-12-02 18:39:01.000000000 +0100 @@ -12,6 +12,10 @@ #include <glob.h> #include <libgen.h> #include <sys/stat.h> +#include <sys/syscall.h> +#ifdef __NR_openat2 +#include <linux/openat2.h> +#endif #include <string.h> #include <stdio.h> #include <fcntl.h> @@ -72,6 +76,25 @@ return -1; } +#ifdef __NR_openat2 + struct open_how how = { + .flags = O_PATH | O_NOFOLLOW | O_CLOEXEC, + .resolve = RESOLVE_NO_SYMLINKS | RESOLVE_NO_MAGICLINKS, + }; + + nfd = syscall(__NR_openat2, AT_FDCWD, path, &how, sizeof(how)); + if (nfd >= 0) { + if (fstat(nfd, sb) < 0) { + close(nfd); + return -1; + } + return nfd; + } + + if (errno != ENOSYS && errno != EINVAL) + return -1; +#endif + copy = strdup(path); if (!copy) return -1; @@ -401,7 +424,7 @@ while (getline(&line_buf, &len, cfg) > 0) { char *buffer = line_buf; - while (isspace(*buffer)) + while (isspace((unsigned char)*buffer)) buffer++; if (buffer[0] == '#') continue; ++++++ restorecond.keyring ++++++ ++++ 626 lines (skipped) ++++ between restorecond.keyring ++++ and /work/SRC/openSUSE:Factory/.restorecond.new.1340718/restorecond.keyring
