diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-07 13:30:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-07 13:30:09 +0000 |
commit | 3c05da1bdef2a6e2142b4fcac974e7e3fc0db93c (patch) | |
tree | 9532e637f47d6ff7246ccbabb62d4e2b4b5908df /utils | |
parent | Adding debian version 1.22.6. (diff) | |
download | dpkg-3c05da1bdef2a6e2142b4fcac974e7e3fc0db93c.tar.xz dpkg-3c05da1bdef2a6e2142b4fcac974e7e3fc0db93c.zip |
Merging upstream version 1.22.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | utils/Makefile.am | 10 | ||||
-rw-r--r-- | utils/Makefile.in | 20 | ||||
-rw-r--r-- | utils/start-stop-daemon.c | 28 | ||||
-rw-r--r-- | utils/update-alternatives.c | 10 |
4 files changed, 38 insertions, 30 deletions
diff --git a/utils/Makefile.am b/utils/Makefile.am index 2ce3bce..b10961a 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -42,15 +42,17 @@ dist_bashcompletions_DATA += polkitactions_DATA += org.dpkg.pkexec.update-alternatives.policy endif -do_polkit_subst = $(SED) \ - -e 's,[@]bindir[@],$(bindir),g' \ - # EOL +subst_polkit_rules = "\ + s{[@]bindir[@]}{$(bindir)}g; \ + " + +subst_polkit_filter = $(PERL) -p -e $(subst_polkit_rules) org.dpkg.pkexec.update-alternatives.policy: update-alternatives.polkit.in Makefile @test -d `dirname $@` || $(MKDIR_P) `dirname $@` $(AM_V_GEN) GETTEXTDATADIR="$(top_srcdir)/po" \ $(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o - \ - | $(do_polkit_subst) >$@ + | $(subst_polkit_filter) >$@ EXTRA_DIST += \ README.alternatives \ diff --git a/utils/Makefile.in b/utils/Makefile.in index 93f8aeb..e809d9e 100644 --- a/utils/Makefile.in +++ b/utils/Makefile.in @@ -109,8 +109,8 @@ bin_PROGRAMS = $(am__EXEEXT_1) @BUILD_START_STOP_DAEMON_TRUE@am__append_5 = subdir = utils ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/dpkg-arch.m4 \ - $(top_srcdir)/m4/dpkg-build.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/build-to-host.m4 \ + $(top_srcdir)/m4/dpkg-arch.m4 $(top_srcdir)/m4/dpkg-build.m4 \ $(top_srcdir)/m4/dpkg-compiler.m4 \ $(top_srcdir)/m4/dpkg-coverage.m4 \ $(top_srcdir)/m4/dpkg-funcs.m4 \ @@ -351,6 +351,7 @@ PACKAGE_RELEASE_DATE = @PACKAGE_RELEASE_DATE@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VCS_ID = @PACKAGE_VCS_ID@ PACKAGE_VCS_TYPE = @PACKAGE_VCS_TYPE@ PACKAGE_VCS_URL = @PACKAGE_VCS_URL@ PACKAGE_VCS_WEB = @PACKAGE_VCS_WEB@ @@ -432,6 +433,8 @@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ +localedir_c = @localedir_c@ +localedir_c_make = @localedir_c_make@ localstatedir = @localstatedir@ logdir = @logdir@ mandir = @mandir@ @@ -488,10 +491,11 @@ CLEANFILES = org.dpkg.pkexec.update-alternatives.policy # EOL @BUILD_UPDATE_ALTERNATIVES_TRUE@ $(LIBINTL) \ @BUILD_UPDATE_ALTERNATIVES_TRUE@ # EOL -do_polkit_subst = $(SED) \ - -e 's,[@]bindir[@],$(bindir),g' \ - # EOL +subst_polkit_rules = "\ + s{[@]bindir[@]}{$(bindir)}g; \ + " +subst_polkit_filter = $(PERL) -p -e $(subst_polkit_rules) @BUILD_START_STOP_DAEMON_TRUE@start_stop_daemon_SOURCES = \ @BUILD_START_STOP_DAEMON_TRUE@ start-stop-daemon.c \ @BUILD_START_STOP_DAEMON_TRUE@ # EOL @@ -984,7 +988,7 @@ org.dpkg.pkexec.update-alternatives.policy: update-alternatives.polkit.in Makefi @test -d `dirname $@` || $(MKDIR_P) `dirname $@` $(AM_V_GEN) GETTEXTDATADIR="$(top_srcdir)/po" \ $(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o - \ - | $(do_polkit_subst) >$@ + | $(subst_polkit_filter) >$@ install-data-local: @BUILD_UPDATE_ALTERNATIVES_TRUE@ $(MKDIR_P) $(DESTDIR)$(sysconfdir)/alternatives @@ -1003,6 +1007,10 @@ tap-clean: tap-check: $(test_data) $(test_programs) $(test_scripts) [ -z "$(test_tmpdir)" ] || $(MKDIR_P) $(test_tmpdir) $(TEST_ENV_VARS) \ + TEST_PARALLEL=$(TEST_PARALLEL) \ + TEST_VERBOSE=$(TEST_VERBOSE) \ + abs_srcdir=$(abs_srcdir) \ + abs_builddir=$(abs_builddir) \ abs_top_srcdir=$(abs_top_srcdir) \ abs_top_builddir=$(abs_top_builddir) \ srcdir=$(srcdir) builddir=$(builddir) \ diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c index 203bbb6..3453462 100644 --- a/utils/start-stop-daemon.c +++ b/utils/start-stop-daemon.c @@ -103,9 +103,7 @@ #include <signal.h> #include <termios.h> #include <unistd.h> -#ifdef HAVE_STDDEF_H #include <stddef.h> -#endif #include <stdbool.h> #include <stdarg.h> #include <stdlib.h> @@ -548,7 +546,7 @@ wait_for_child(pid_t pid) do { child = waitpid(pid, &status, 0); - } while (child == -1 && errno == EINTR); + } while (child < 0 && errno == EINTR); if (child != pid) fatal("error waiting for child"); @@ -800,7 +798,7 @@ daemonize(void) * performing actions, such as creating a pidfile. */ sigemptyset(&mask); sigaddset(&mask, SIGCHLD); - if (sigprocmask(SIG_BLOCK, &mask, &oldmask) == -1) + if (sigprocmask(SIG_BLOCK, &mask, &oldmask) < 0) fatale("cannot block SIGCHLD"); if (notify_await) @@ -851,7 +849,7 @@ daemonize(void) _exit(0); } - if (sigprocmask(SIG_SETMASK, &oldmask, NULL) == -1) + if (sigprocmask(SIG_SETMASK, &oldmask, NULL) < 0) fatale("cannot restore signal mask"); debug("Detaching complete...\n"); @@ -1142,7 +1140,7 @@ set_proc_schedule(struct res_schedule *sched) param.sched_priority = sched->priority; - if (sched_setscheduler(getpid(), sched->policy, ¶m) == -1) + if (sched_setscheduler(getpid(), sched->policy, ¶m) < 0) fatale("unable to set process scheduler"); #endif } @@ -1162,7 +1160,7 @@ set_io_schedule(struct res_schedule *sched) int io_sched_mask; io_sched_mask = IOPRIO_PRIO_VALUE(sched->policy, sched->priority); - if (ioprio_set(IOPRIO_WHO_PROCESS, getpid(), io_sched_mask) == -1) + if (ioprio_set(IOPRIO_WHO_PROCESS, getpid(), io_sched_mask) < 0) warning("unable to alter IO priority to mask %i (%s)\n", io_sched_mask, strerror(errno)); #endif @@ -1624,7 +1622,7 @@ proc_status_field(pid_t pid, const char *field) return value; } -#elif (defined(OS_Solaris) || defined(OS_AIX)) && HAVE_STRUCT_PSINFO +#elif (defined(OS_Solaris) || defined(OS_AIX)) && defined(HAVE_STRUCT_PSINFO) static bool proc_get_psinfo(pid_t pid, struct psinfo *psinfo) { @@ -1736,7 +1734,7 @@ pid_is_exec(pid_t pid, const struct stat *esb) sprintf(lname, "/proc/%d/exe", pid); nread = readlink(lname, lcontents, sizeof(lcontents) - 1); - if (nread == -1) + if (nread < 0) return false; filename = lcontents; @@ -1755,7 +1753,7 @@ pid_is_exec(pid_t pid, const struct stat *esb) return (sb.st_dev == esb->st_dev && sb.st_ino == esb->st_ino); } -#elif (defined(OS_Solaris) || defined(OS_AIX)) && HAVE_STRUCT_PSINFO +#elif (defined(OS_Solaris) || defined(OS_AIX)) && defined(HAVE_STRUCT_PSINFO) static bool pid_is_exec(pid_t pid, const struct stat *esb) { @@ -1877,7 +1875,7 @@ pid_is_exec(pid_t pid, const struct stat *esb) /* Find and compare string. */ start_argv_0_p = *pid_argv_p; - /* Find end of argv[0] then copy and cut of str there. */ + /* Find end of argv[0] then copy and cut off str there. */ end_argv_0_p = strchr(*pid_argv_p, ' '); if (end_argv_0_p == NULL) /* There seems to be no space, so we have the command @@ -1885,7 +1883,7 @@ pid_is_exec(pid_t pid, const struct stat *esb) start_argv_0_p = *pid_argv_p; else { /* Tests indicate that this never happens, since - * kvm_getargv itself cuts of tailing stuff. This is + * kvm_getargv itself cuts off tailing stuff. This is * not what the manual page says, however. */ strncpy(buf, *pid_argv_p, (end_argv_0_p - start_argv_0_p)); buf[(end_argv_0_p - start_argv_0_p) + 1] = '\0'; @@ -1948,7 +1946,7 @@ pid_is_child(pid_t pid, pid_t ppid) return (pid_t)pbi.pbi_ppid == ppid; } -#elif (defined(OS_Solaris) || defined(OS_AIX)) && HAVE_STRUCT_PSINFO +#elif (defined(OS_Solaris) || defined(OS_AIX)) && defined(HAVE_STRUCT_PSINFO) static bool pid_is_child(pid_t pid, pid_t ppid) { @@ -2057,7 +2055,7 @@ pid_is_user(pid_t pid, uid_t uid) return pbi.pbi_ruid == uid; } -#elif (defined(OS_Solaris) || defined(OS_AIX)) && HAVE_STRUCT_PSINFO +#elif (defined(OS_Solaris) || defined(OS_AIX)) && defined(HAVE_STRUCT_PSINFO) static bool pid_is_user(pid_t pid, uid_t uid) { @@ -2182,7 +2180,7 @@ pid_is_cmd(pid_t pid, const char *name) return false; } -#elif (defined(OS_Solaris) || defined(OS_AIX)) && HAVE_STRUCT_PSINFO +#elif (defined(OS_Solaris) || defined(OS_AIX)) && defined(HAVE_STRUCT_PSINFO) static bool pid_is_cmd(pid_t pid, const char *name) { diff --git a/utils/update-alternatives.c b/utils/update-alternatives.c index 7d21a4d..9909cde 100644 --- a/utils/update-alternatives.c +++ b/utils/update-alternatives.c @@ -380,7 +380,7 @@ areadlink(const char *linkname) /* Read it and terminate the string properly */ size = readlink(linkname, buf, st.st_size); - if (size == -1) { + if (size < 0) { int saved_errno = errno; free(buf); @@ -400,13 +400,13 @@ spawn(const char *prog, const char *args[]) int status; pid = fork(); - if (pid == -1) + if (pid < 0) error(_("fork failed")); if (pid == 0) { execvp(prog, (char *const *)args); syserr(_("unable to execute %s (%s)"), prog, prog); } - while ((dead_pid = waitpid(pid, &status, 0)) == -1 && errno == EINTR) ; + while ((dead_pid = waitpid(pid, &status, 0)) < 0 && errno == EINTR) ; if (dead_pid != pid) error(_("wait for subprocess %s failed"), prog); @@ -1530,7 +1530,7 @@ alternative_load(struct alternative *a, enum altdb_flags flags) } /* Verify the alternative is not empty. */ - if (fstat(fileno(ctx.fh), &st) == -1) + if (fstat(fileno(ctx.fh), &st) < 0) syserr(_("cannot stat file '%s'"), ctx.filename); if (st.st_size == 0) { altdb_context_free(&ctx); @@ -1958,7 +1958,7 @@ alternative_path_classify(const char *linkname) { struct stat st; - if (fsys_lstat(linkname, &st) == -1) { + if (fsys_lstat(linkname, &st) < 0) { if (errno != ENOENT) syserr(_("cannot stat file '%s%s'"), instdir, linkname); return ALT_PATH_MISSING; |