1
0
mirror of https://github.com/systemd/systemd synced 2025-09-27 15:54:47 +02:00

Compare commits

..

No commits in common. "ba9385d91f4724dd55a655da153f3a89e7943b4e" and "258190a0d5b2c1fe8ee50e3a9204d845947d4835" have entirely different histories.

7 changed files with 27 additions and 129 deletions

29
.github/labeler.yml vendored
View File

@ -1,29 +0,0 @@
hwdb:
- hwdb.d/**/*
units:
- units/**/*
documentation:
- NEWS
- man/*
- docs/*
network:
- src/libsystemd-network/**/*
- src/network/**/*
udev:
- src/udev/**/*
- src/libudev/*
selinux:
- '**/*selinux*'
apparmor:
- '**/*apparmor*'
meson:
- '**/meson.build'
- meson_option.txt
busctl:
- src/busctl/*
systemctl:
- src/systemctl/*
journal:
- src/journal/*
journal-remote:
- src/journal-remote/*

View File

@ -1,12 +0,0 @@
name: "Pull Request Labeler"
on:
- pull_request_target
jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@main
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/labeler.yml

View File

@ -30,16 +30,15 @@ typedef struct StaticDestructor {
_alignptr_ \
/* Make sure this is not dropped from the image because not explicitly referenced */ \
_used_ \
/* Make sure that AddressSanitizer doesn't pad this variable: we want everything in this section
* packed next to each other so that we can enumerate it. */ \
/* Make sure that AddressSanitizer doesn't pad this variable: we want everything in this section packed next to each other so that we can enumerate it. */ \
_variable_no_sanitize_address_ \
static const StaticDestructor UNIQ_T(static_destructor_entry, uq) = { \
.data = &(variable), \
.destroy = UNIQ_T(static_destructor_wrapper, uq), \
}
/* Beginning and end of our section listing the destructors. We define these as weak as we want this to work
* even if no destructors are defined and the section is missing. */
/* Beginning and end of our section listing the destructors. We define these as weak as we want this to work even if
* there's not a single destructor is defined in which case the section will be missing. */
extern const struct StaticDestructor _weak_ __start_SYSTEMD_STATIC_DESTRUCT[];
extern const struct StaticDestructor _weak_ __stop_SYSTEMD_STATIC_DESTRUCT[];

View File

@ -2,7 +2,6 @@
#include <netdb.h>
#include <nss.h>
#include <pthread.h>
#include "sd-bus.h"
#include "sd-login.h"
@ -15,27 +14,12 @@
#include "format-util.h"
#include "hostname-util.h"
#include "in-addr-util.h"
#include "log.h"
#include "macro.h"
#include "memory-util.h"
#include "nss-util.h"
#include "signal-util.h"
#include "string-util.h"
static void setup_logging(void) {
/* We need a dummy function because log_parse_environment is a macro. */
log_parse_environment();
}
static void setup_logging_once(void) {
static pthread_once_t once = PTHREAD_ONCE_INIT;
assert_se(pthread_once(&once, setup_logging) == 0);
}
#define NSS_ENTRYPOINT_BEGIN \
BLOCK_SIGNALS(NSS_SIGNALS_BLOCK); \
setup_logging_once()
NSS_GETHOSTBYNAME_PROTOTYPES(mymachines);
NSS_GETPW_PROTOTYPES(mymachines);
NSS_GETGR_PROTOTYPES(mymachines);
@ -110,7 +94,7 @@ enum nss_status _nss_mymachines_gethostbyname4_r(
int n_ifindices, r;
PROTECT_ERRNO;
NSS_ENTRYPOINT_BEGIN;
BLOCK_SIGNALS(NSS_SIGNALS_BLOCK);
assert(name);
assert(pat);
@ -260,7 +244,7 @@ enum nss_status _nss_mymachines_gethostbyname3_r(
int r;
PROTECT_ERRNO;
NSS_ENTRYPOINT_BEGIN;
BLOCK_SIGNALS(NSS_SIGNALS_BLOCK);
assert(name);
assert(result);

View File

@ -3,7 +3,6 @@
#include <errno.h>
#include <netdb.h>
#include <nss.h>
#include <pthread.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
@ -18,24 +17,6 @@
#include "strv.h"
#include "varlink.h"
static JsonDispatchFlags json_dispatch_flags = 0;
static void setup_logging(void) {
log_parse_environment();
if (DEBUG_LOGGING)
json_dispatch_flags = JSON_LOG;
}
static void setup_logging_once(void) {
static pthread_once_t once = PTHREAD_ONCE_INIT;
assert_se(pthread_once(&once, setup_logging) == 0);
}
#define NSS_ENTRYPOINT_BEGIN \
BLOCK_SIGNALS(NSS_SIGNALS_BLOCK); \
setup_logging_once()
NSS_GETHOSTBYNAME_PROTOTYPES(resolve);
NSS_GETHOSTBYADDR_PROTOTYPES(resolve);
@ -202,7 +183,7 @@ enum nss_status _nss_resolve_gethostbyname4_r(
int r;
PROTECT_ERRNO;
NSS_ENTRYPOINT_BEGIN;
BLOCK_SIGNALS(NSS_SIGNALS_BLOCK);
assert(name);
assert(pat);
@ -233,7 +214,7 @@ enum nss_status _nss_resolve_gethostbyname4_r(
goto fail;
}
r = json_dispatch(rparams, resolve_hostname_reply_dispatch_table, NULL, json_dispatch_flags, &p);
r = json_dispatch(rparams, resolve_hostname_reply_dispatch_table, NULL, 0, &p);
if (r < 0)
goto fail;
if (json_variant_is_blank_object(p.addresses))
@ -242,7 +223,7 @@ enum nss_status _nss_resolve_gethostbyname4_r(
JSON_VARIANT_ARRAY_FOREACH(entry, p.addresses) {
AddressParameters q = {};
r = json_dispatch(entry, address_parameters_dispatch_table, NULL, json_dispatch_flags, &q);
r = json_dispatch(entry, address_parameters_dispatch_table, NULL, 0, &q);
if (r < 0)
goto fail;
@ -279,7 +260,7 @@ enum nss_status _nss_resolve_gethostbyname4_r(
JSON_VARIANT_ARRAY_FOREACH(entry, p.addresses) {
AddressParameters q = {};
r = json_dispatch(entry, address_parameters_dispatch_table, NULL, json_dispatch_flags, &q);
r = json_dispatch(entry, address_parameters_dispatch_table, NULL, 0, &q);
if (r < 0)
goto fail;
@ -346,7 +327,7 @@ enum nss_status _nss_resolve_gethostbyname3_r(
int r;
PROTECT_ERRNO;
NSS_ENTRYPOINT_BEGIN;
BLOCK_SIGNALS(NSS_SIGNALS_BLOCK);
assert(name);
assert(result);
@ -380,7 +361,7 @@ enum nss_status _nss_resolve_gethostbyname3_r(
goto fail;
}
r = json_dispatch(rparams, resolve_hostname_reply_dispatch_table, NULL, json_dispatch_flags, &p);
r = json_dispatch(rparams, resolve_hostname_reply_dispatch_table, NULL, 0, &p);
if (r < 0)
goto fail;
if (json_variant_is_blank_object(p.addresses))
@ -389,7 +370,7 @@ enum nss_status _nss_resolve_gethostbyname3_r(
JSON_VARIANT_ARRAY_FOREACH(entry, p.addresses) {
AddressParameters q = {};
r = json_dispatch(entry, address_parameters_dispatch_table, NULL, json_dispatch_flags, &q);
r = json_dispatch(entry, address_parameters_dispatch_table, NULL, 0, &q);
if (r < 0)
goto fail;
@ -434,7 +415,7 @@ enum nss_status _nss_resolve_gethostbyname3_r(
JSON_VARIANT_ARRAY_FOREACH(entry, p.addresses) {
AddressParameters q = {};
r = json_dispatch(entry, address_parameters_dispatch_table, NULL, json_dispatch_flags, &q);
r = json_dispatch(entry, address_parameters_dispatch_table, NULL, 0, &q);
if (r < 0)
goto fail;
@ -546,7 +527,7 @@ enum nss_status _nss_resolve_gethostbyaddr2_r(
int r;
PROTECT_ERRNO;
NSS_ENTRYPOINT_BEGIN;
BLOCK_SIGNALS(NSS_SIGNALS_BLOCK);
assert(addr);
assert(result);
@ -584,7 +565,7 @@ enum nss_status _nss_resolve_gethostbyaddr2_r(
goto fail;
}
r = json_dispatch(rparams, resolve_address_reply_dispatch_table, NULL, json_dispatch_flags, &p);
r = json_dispatch(rparams, resolve_address_reply_dispatch_table, NULL, 0, &p);
if (r < 0)
goto fail;
if (json_variant_is_blank_object(p.names))
@ -593,7 +574,7 @@ enum nss_status _nss_resolve_gethostbyaddr2_r(
JSON_VARIANT_ARRAY_FOREACH(entry, p.names) {
_cleanup_(name_parameters_destroy) NameParameters q = {};
r = json_dispatch(entry, name_parameters_dispatch_table, NULL, json_dispatch_flags, &q);
r = json_dispatch(entry, name_parameters_dispatch_table, NULL, 0, &q);
if (r < 0)
goto fail;
@ -634,7 +615,7 @@ enum nss_status _nss_resolve_gethostbyaddr2_r(
size_t l;
char *z;
r = json_dispatch(entry, name_parameters_dispatch_table, NULL, json_dispatch_flags, &q);
r = json_dispatch(entry, name_parameters_dispatch_table, NULL, 0, &q);
if (r < 0)
goto fail;

View File

@ -6,7 +6,6 @@
#include "env-util.h"
#include "errno-util.h"
#include "fd-util.h"
#include "log.h"
#include "macro.h"
#include "nss-systemd.h"
#include "nss-util.h"
@ -73,20 +72,6 @@ static GetentData getgrent_data = {
.mutex = PTHREAD_MUTEX_INITIALIZER
};
static void setup_logging(void) {
/* We need a dummy function because log_parse_environment is a macro. */
log_parse_environment();
}
static void setup_logging_once(void) {
static pthread_once_t once = PTHREAD_ONCE_INIT;
assert_se(pthread_once(&once, setup_logging) == 0);
}
#define NSS_ENTRYPOINT_BEGIN \
BLOCK_SIGNALS(NSS_SIGNALS_BLOCK); \
setup_logging_once()
NSS_GETPW_PROTOTYPES(systemd);
NSS_GETGR_PROTOTYPES(systemd);
NSS_PWENT_PROTOTYPES(systemd);
@ -103,7 +88,7 @@ enum nss_status _nss_systemd_getpwnam_r(
int e;
PROTECT_ERRNO;
NSS_ENTRYPOINT_BEGIN;
BLOCK_SIGNALS(NSS_SIGNALS_BLOCK);
assert(name);
assert(pwd);
@ -154,7 +139,7 @@ enum nss_status _nss_systemd_getpwuid_r(
int e;
PROTECT_ERRNO;
NSS_ENTRYPOINT_BEGIN;
BLOCK_SIGNALS(NSS_SIGNALS_BLOCK);
assert(pwd);
assert(errnop);
@ -203,7 +188,7 @@ enum nss_status _nss_systemd_getgrnam_r(
int e;
PROTECT_ERRNO;
NSS_ENTRYPOINT_BEGIN;
BLOCK_SIGNALS(NSS_SIGNALS_BLOCK);
assert(name);
assert(gr);
@ -251,7 +236,7 @@ enum nss_status _nss_systemd_getgrgid_r(
int e;
PROTECT_ERRNO;
NSS_ENTRYPOINT_BEGIN;
BLOCK_SIGNALS(NSS_SIGNALS_BLOCK);
assert(gr);
assert(errnop);
@ -290,7 +275,7 @@ enum nss_status _nss_systemd_getgrgid_r(
static enum nss_status nss_systemd_endent(GetentData *p) {
PROTECT_ERRNO;
NSS_ENTRYPOINT_BEGIN;
BLOCK_SIGNALS(NSS_SIGNALS_BLOCK);
assert(p);
@ -313,7 +298,7 @@ enum nss_status _nss_systemd_endgrent(void) {
enum nss_status _nss_systemd_setpwent(int stayopen) {
PROTECT_ERRNO;
NSS_ENTRYPOINT_BEGIN;
BLOCK_SIGNALS(NSS_SIGNALS_BLOCK);
if (_nss_systemd_is_blocked())
return NSS_STATUS_NOTFOUND;
@ -337,7 +322,7 @@ enum nss_status _nss_systemd_setpwent(int stayopen) {
enum nss_status _nss_systemd_setgrent(int stayopen) {
PROTECT_ERRNO;
NSS_ENTRYPOINT_BEGIN;
BLOCK_SIGNALS(NSS_SIGNALS_BLOCK);
if (_nss_systemd_is_blocked())
return NSS_STATUS_NOTFOUND;
@ -364,7 +349,7 @@ enum nss_status _nss_systemd_getpwent_r(
int r;
PROTECT_ERRNO;
NSS_ENTRYPOINT_BEGIN;
BLOCK_SIGNALS(NSS_SIGNALS_BLOCK);
assert(result);
assert(errnop);
@ -411,7 +396,7 @@ enum nss_status _nss_systemd_getgrent_r(
int r;
PROTECT_ERRNO;
NSS_ENTRYPOINT_BEGIN;
BLOCK_SIGNALS(NSS_SIGNALS_BLOCK);
assert(result);
assert(errnop);
@ -540,7 +525,7 @@ enum nss_status _nss_systemd_initgroups_dyn(
int r;
PROTECT_ERRNO;
NSS_ENTRYPOINT_BEGIN;
BLOCK_SIGNALS(NSS_SIGNALS_BLOCK);
assert(user_name);
assert(start);

View File

@ -3854,16 +3854,6 @@ int json_log_internal(
"CONFIG_COLUMN=%u", source_column,
LOG_MESSAGE("%s:%u:%u: %s", source, source_line, source_column, buffer),
NULL);
else if (source_line > 0 && source_column > 0)
return log_struct_internal(
LOG_REALM_PLUS_LEVEL(LOG_REALM_SYSTEMD, level),
error,
file, line, func,
"MESSAGE_ID=" SD_MESSAGE_INVALID_CONFIGURATION_STR,
"CONFIG_LINE=%u", source_line,
"CONFIG_COLUMN=%u", source_column,
LOG_MESSAGE("(string):%u:%u: %s", source_line, source_column, buffer),
NULL);
else
return log_struct_internal(
LOG_REALM_PLUS_LEVEL(LOG_REALM_SYSTEMD, level),