</variablelist>
</refsect1>
-
<refsect1>
<title>Unprivileged Write Access</title>
</para></listitem>
</varlistentry>
-
<varlistentry>
<term><varname>SplitMode=</varname></term>
seconds.</para></listitem>
</varlistentry>
-
<varlistentry>
<term><varname>SyncIntervalSec=</varname></term>
}
</programlisting>
-
<para><function>SD_ID128_CONST_STR()</function> may be used to
convert constant 128-bit IDs into constant strings for output. The
following example code will output the string
errno-style error code.</para>
</refsect1>
-
<refsect1>
<title>Errors</title>
<paramdef>char **<parameter>ret</parameter></paramdef>
</funcprototype>
-
</funcsynopsis>
</refsynopsisdiv>
</para></listitem>
</varlistentry>
-
<varlistentry>
<term><option>--save-state</option><optional>=<replaceable>PATH</replaceable></optional></term>
</variablelist>
</refsect1>
-
<refsect1>
<title>Security</title>
</variablelist>
</refsect1>
-
<refsect1>
<title>Sandboxing</title>
</para>
</refsect1>
-
</refentry>
</variablelist>
</refsect1>
-
<refsect1>
<title>[DHCPServer] Section Options</title>
<para>The <literal>[DHCPServer]</literal> section contains
suffix.</para></listitem>
</varlistentry>
-
<varlistentry>
<term><varname>Persistent=</varname></term>
char *architecture;
};
-
static int acquire_systemd_bus(sd_bus **bus) {
bool user = arg_scope != UNIT_FILE_SYSTEM;
else if (!unit_id)
size = strpcpyf(&ptr, size, "\ncould not find default.target");
-
ptr = strdup(buf);
if (!ptr)
return log_oom();
assert_not_reached("Unexpected type?");
}
-
return d->formatted;
}
.compare = string_compare_func
};
-
void path_hash_func(const void *p, struct siphash *state) {
const char *q = p;
size_t n;
return NULL;
}
-
int mount_propagation_flags_from_string(const char *name, unsigned long *ret) {
if (isempty(name))
#endif
x = 0;
-
x ^= (unsigned) now(CLOCK_REALTIME);
x ^= (unsigned) gettid();
Copyright 2010 Lennart Poettering
***/
-
#include <sys/time.h>
#include "macro.h"
if (!mac_selinux_use())
return NULL;
-
freecon(label);
#endif
return -EOPNOTSUPP;
}
-
*ret = p;
return 0;
}
};
int r;
-
/* Similar to flush_fd() but flushes all incoming connection by accepting them and immediately closing them. */
for (;;) {
EFI_TCG2_GET_RESULT_OF_SET_ACTIVE_PCR_BANKS GetResultOfSetActivePcrBanks;
} EFI_TCG2;
-
static EFI_STATUS tpm1_measure_to_pcr_and_event_log(const EFI_TCG *tcg, UINT32 pcrindex, const EFI_PHYSICAL_ADDRESS buffer,
UINTN buffer_size, const CHAR16 *description) {
EFI_STATUS status;
break;
-
case STATE_SIGNAL_ARG:
if (t == XML_ATTRIBUTE_NAME) {
break;
}
-
case SD_BUS_TYPE_DOUBLE: {
double z;
arg_expect_reply = !!r;
break;
-
case ARG_AUTO_START:
r = parse_boolean(optarg);
if (r < 0) {
arg_auto_start = !!r;
break;
-
case ARG_ALLOW_INTERACTIVE_AUTHORIZATION:
r = parse_boolean(optarg);
if (r < 0) {
Copyright 2012 Lennart Poettering
***/
-
#include <errno.h>
#include "audit-fd.h"
u->in_cgroup_realize_queue = false;
}
-
/* Check if necessary controllers and attributes for a unit are in place.
*
* If so, do nothing.
void *userdata,
sd_bus_error *error) {
-
ExecContext *c = userdata;
int32_t n;
void *userdata,
sd_bus_error *error) {
-
ExecContext *c = userdata;
int32_t n;
void *userdata,
sd_bus_error *error) {
-
ExecContext *c = userdata;
assert(bus);
void *userdata,
sd_bus_error *error) {
-
ExecContext *c = userdata;
assert(bus);
void *userdata,
sd_bus_error *error) {
-
ExecContext *c = userdata;
assert(bus);
void *userdata,
sd_bus_error *error) {
-
Socket *s = SOCKET(userdata);
SocketPort *p;
int r;
return sd_bus_message_close_container(reply);
}
-
static int property_get_fdname(
sd_bus *bus,
const char *path,
} else
return 0;
-
/* If the object is newly created, then put it to the hashmap which manages ExecRuntime objects. */
if (rt_create) {
r = hashmap_put(u->manager->exec_runtime_by_id, rt_create->id, rt_create);
job_set_state(j, JOB_RUNNING);
job_add_to_dbus_queue(j);
-
switch (j->type) {
case JOB_VERIFY_ACTIVE: {
make sure to only send this after SIGTERM so
that SIGTERM is always first in the queue. */
-
if (get_ctty_devnr(pid, NULL) >= 0)
/* it's OK if the process is gone, just ignore the result */
(void) kill(pid, SIGHUP);
Copyright 2010 Lennart Poettering
***/
-
#include "conf-parser.h"
#include "fs-util.h"
#include "load-dropin.h"
void *data,
void *userdata) {
-
ExecContext *c = data;
int x;
void *data,
void *userdata) {
-
ExecContext *c = data;
int r;
"Job type %s is not applicable for unit %s.",
job_type_to_string(type), unit->id);
-
/* First add the job. */
ret = transaction_add_one_job(tr, type, unit, &is_new);
if (!ret)
path_startswith(p, "/proc"))
continue;
-
/* If we are in a container, don't attempt to
* read-only mount anything as that brings no real
* benefits, but might confuse the host, as we remount
}
}
-
int unit_add_node_dependency(Unit *u, const char *what, bool wants, UnitDependency dep, UnitDependencyMask mask) {
Unit *device;
_cleanup_free_ char *e = NULL;
"RequiresMountsFor=%s\n",
u_escaped);
-
r = generator_write_timeouts(arg_dest, device, name, options, &filtered);
if (r < 0)
return r;
return strdup("computer");
}
-
static bool hostname_is_useful(const char *hn) {
return !isempty(hn) && !is_localhost(hn);
}
if (!streq(method, "GET"))
return mhd_respond(connection, MHD_HTTP_NOT_ACCEPTABLE, "Unsupported method.");
-
if (!*connection_cls) {
if (!request_meta(connection_cls))
return respond_oom(connection);
log_debug("Started MHD %s daemon on fd:%d (wrapper @ %p)",
key ? "HTTPS" : "HTTP", fd, d);
-
info = MHD_get_daemon_info(d->daemon, MHD_DAEMON_INFO_EPOLL_FD_LINUX_ONLY);
if (!info) {
log_error("µhttp returned NULL daemon info");
if (r <= 0)
return r == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
-
if (arg_listen_http || arg_listen_https) {
r = setup_gnutls_logger(arg_gnutls_log);
if (r < 0)
return 0;
}
-
-
int start_upload(Uploader *u,
size_t (*input_callback)(void *ptr,
size_t size,
REENABLE_WARNING;
}
-
static int mhd_respond_internal(struct MHD_Connection *connection,
enum MHD_RequestTerminationCode code,
const char *buffer,
SD_ID128_FORMAT_VAL(id), s);
}
-
int catalog_list(FILE *f, const char *database, bool oneline) {
_cleanup_close_ int fd = -1;
void *p = NULL;
#endif
}
-
int decompress_blob_xz(const void *src, uint64_t src_size,
void **dst, size_t *dst_alloc_size, size_t* dst_size, size_t dst_max) {
return -EBADMSG;
}
-
int decompress_startswith_xz(const void *src, uint64_t src_size,
void **buffer, size_t *buffer_size,
const void *prefix, size_t prefix_len,
arg_action = ACTION_SETUP_KEYS;
break;
-
case ARG_VERIFY_KEY:
arg_action = ACTION_VERIFY;
r = free_and_strdup(&arg_verify_key, optarg);
arg_system_units = strv_free(arg_system_units);
}
-
#if HAVE_PCRE2
if (arg_pattern) {
unsigned flags;
return 0;
}
-
static int add_syslog_identifier(sd_journal *j) {
int r;
char **i;
storage->metrics.min_use = MAX(storage->metrics.min_use, storage->space.vfs_used);
}
-
static int determine_space(Server *s, uint64_t *available, uint64_t *limit) {
JournalStorage *js;
int r;
return c;
}
-
/*
--------------------------------------------------------------------
hashword2() -- same as hashword(), but take two seeds and return two
*pc=c; *pb=b;
}
-
/*
-------------------------------------------------------------------------------
hashlittle() -- hash a variable-length key into a 32-bit value
return c;
}
-
/*
* hashlittle2: return 2 32-bit hash values
*
*pc=c; *pb=b;
}
-
-
/*
* hashbig():
* This is the same as hashword() on big-endian machines. It is different
return c;
}
-
#ifdef SELF_TEST
/* used for timings */
uint8_t buf[1];
uint32_t h,i,state[HASHSTATE];
-
buf[0] = ~0;
for (i=0; i<HASHSTATE; ++i) state[i] = 1;
printf("These should all be different\n");
printf("hash is %.8lx\n", c); /* cd628161 */
}
-
int main()
{
driver1(); /* test that the key is hashed: used for timings */
break;
}
-
p += length, left -= length;
}
return 0;
}
-
void serialize_in_addrs(FILE *f, const struct in_addr *addresses, size_t size) {
unsigned i;
assert_se(!found_iana);
found_iana = true;
-
assert_se(optlen == 40);
assert_se(!memcmp(optval, &test_iaid, sizeof(test_iaid)));
sd_bus_message_unref(m);
}
-
return NULL;
}
return 0;
}
-
_public_ int sd_bus_creds_get_fsuid(sd_bus_creds *c, uid_t *fsuid) {
assert_return(c, -EINVAL);
assert_return(fsuid, -EINVAL);
components[n_components].value_u8 = u;
n_components++;
-
if (q[quoted] == 0)
break;
return 0;
}
-
static int message_peek_body(
sd_bus_message *m,
size_t *rindex,
break;
-
case BUS_MESSAGE_HEADER_SIGNATURE: {
const char *s;
char *c;
return -EINVAL;
}
-
int signature_element_length(const char *s, size_t *l) {
return signature_element_length_internal(s, true, 0, 0, l);
}
key.interface = slot->node_vtable.interface;
key.member = v->x.method.member;
-
x = hashmap_remove(slot->bus->vtable_properties, &key);
break;
}}
return bus_default(sd_bus_open_system, &default_system_bus, ret);
}
-
_public_ int sd_bus_default_user(sd_bus **ret) {
return bus_default(sd_bus_open_user, &default_user_bus, ret);
}
return 0;
}
-
int sd_netlink_message_append_u16(sd_netlink_message *m, unsigned short type, uint16_t data) {
int r;
assert_se((r = sd_netlink_message_unref(r)) == NULL);
}
-
static void test_address_get(sd_netlink *rtnl, int ifindex) {
sd_netlink_message *m;
sd_netlink_message *r;
} else
log_debug("Locale settings were not modified.");
-
return sd_bus_reply_method_return(m, NULL);
}
if (s->desktop) {
_cleanup_free_ char *escaped;
-
escaped = cescape(s->desktop);
if (!escaped) {
r = -ENOMEM;
return 0;
}
-
static int show_image_properties(sd_bus *bus, const char *path, bool *new_line) {
int r;
Copyright 2014 Tom Gundersen
***/
-
#include "netdev/dummy.h"
const NetDevVTable dummy_vtable = {
log_netdev_debug(netdev, "Creating");
-
return r;
}
}
}
-
static int netdev_wireguard_post_create(NetDev *netdev, Link *link, sd_netlink_message *m) {
Wireguard *w;
peer->preshared_key);
}
-
int config_parse_wireguard_public_key(const char *unit,
const char *filename,
unsigned line,
log_link_warning_errno(link, r, "Failed to set DNS server for DHCP server, ignoring: %m");
}
-
if (link->network->dhcp_server_emit_ntp) {
if (link->network->n_dhcp_server_ntp > 0)
return 0;
}
-
static int setup_propagate(const char *root) {
const char *p, *q;
int r;
} else
r = list_homes();
-
finish:
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}
{}
};
-
enum {
TYPE_REGULAR,
TYPE_PRIVATE, /* -p: Not supported, treated identically to TYPE_REGULAR */
*out = rr->tlsa.data;
return rr->tlsa.data_size;
-
case DNS_TYPE_OPENPGPKEY:
default:
*out = rr->generic.data;
dns_transaction_complete(t, DNS_TRANSACTION_DNSSEC_FAILED);
return 0;
-
default:
log_debug("Auxiliary DNSSEC RR query failed with %s", dns_transaction_state_to_string(dt->state));
goto fail;
assert(t);
assert(t->scope);
-
switch (t->scope->protocol) {
case DNS_PROTOCOL_DNS:
} else
d = s;
-
r = sd_bus_message_append(m, "(ssbt)", s, d, ignore_enoent, flags);
if (r < 0)
return bus_log_create_error(r);
*_s = s;
return 0;
-
fail:
if (s)
set_free(MAKE_SET(s));
uint16_t remote_port,
const union in_addr_union *previous_remote) {
-
_cleanup_(iptc_freep) struct xtc_handle *h = NULL;
struct ipt_entry *entry, *mask;
struct ipt_entry_target *t;
return 0;
}
-
int import_url_change_last_component(const char *url, const char *suffix, char **ret) {
const char *e;
char *s;
int r;
_cleanup_free_ char *t = NULL, *z = NULL;
-
r = sd_journal_get_catalog(j, &t);
if (r < 0)
return r;
nl = length - field_len;
-
buf = newdup_suffix0(char, (const char*) data + field_len, nl);
if (!buf)
return log_oom();
return write_utmp_wtmp(&store, &store_wtmp);
}
-
int utmp_put_runlevel(int runlevel, int previous) {
struct utmpx store = {};
int r;
}
}
-
switch (action[0]) {
case ADD_RANGE:
gather_stdout_three,
};
-
static void test_stdout_gathering(void) {
char template[] = "/tmp/test-exec-util.XXXXXXX";
const char *dirs[] = {template, NULL};
assert_se(r < 0);
}
-
static void test_search_and_fopen_nulstr(void) {
const char dirs[] = "/tmp/foo/bar\0/tmp\0";
char name[] = "/tmp/test-search_and_fopen.XXXXXX";
assert_not_reached("Unhandled option code.");
}
-
/* add sys path if needed */
if (!startswith(syspath, "/sys"))
syspath = strjoina("/sys/", syspath);
Copyright 2014 Ronny Chevalier
***/
-
#include "locale-util.h"
#include "macro.h"
#include "strv.h"
}
}
-
static void test_gethostbyname3_r(void *handle, const char *module, const char *name, int af) {
const char *fname;
_nss_gethostbyname3_r_t f;
char **name;
int i;
-
log_info("======== %s ========", module);
handle = open_handle(streq(module, "dns") ? NULL : dir,
assert_se(parse_nice("19", &n) >= 0 && n == 19);
assert_se(parse_nice("+19", &n) >= 0 && n == 19);
-
assert_se(parse_nice("", &n) == -EINVAL);
assert_se(parse_nice("-", &n) == -EINVAL);
assert_se(parse_nice("+", &n) == -EINVAL);
service_state_to_string(service->state),
service_result_to_string(service->result));
-
/* But we timeout if the service has not been started in the allocated time */
n = now(CLOCK_MONOTONIC);
if (ts + timeout < n) {
assert_se(is_symlink(name_link) == 1);
assert_se(is_symlink("/a/file/which/does/not/exist/i/guess") < 0);
-
unlink(name);
unlink(name_link);
}
assert_se(streq(zero, ""));
}
-
static void test_strappend(void) {
_cleanup_free_ char *t1, *t2, *t3, *t4;
NULL,
};
-
static void test_strv_find(void) {
assert_se(strv_find((char **)input_table_multiple, "three"));
assert_se(!strv_find((char **)input_table_multiple, "four"));
c1 = c1->command_next;
check_execcommand(c1, "/bin/grep", NULL, "\\w+\\K", NULL, false);
-
log_info("/* trailing backslash: \\ */");
/* backslash is invalid */
r = config_parse_exec(NULL, "fake", 4, "section", 1,
assert_se(streq(r, "ab\\x2b\\x2dc.a-bc\\x40foo.service"));
}
-
static void test_u_n_t_one(const char *name, const char *expected, int ret) {
_cleanup_free_ char *f = NULL;
0x01, 0x03, 0xD9, 0x01, 0xFF, 0x18, 0x02, 0xDF, 0x01, 0x20
};
-
void probe_smart_media(int mtd_fd, mtd_info_t* info) {
int sector_size;
int block_size;
return 0;
}
-
/* Get device identification VPD page */
static int do_scsi_page83_inquiry(struct udev *udev,
struct scsi_id_device *dev_scsi, int fd,
log_warning_errno(r, "Failed to redirect standard streams to /dev/null: %m");
}
-
-
pid = fork();
switch (pid) {
case 0:
--- /dev/null
+#!/bin/sh
+# SPDX-License-Identifier: LGPL-2.1+
+
+case "$1" in
+
+ recdiff)
+ if [ "$2" = "" ] ; then
+ DIR="$PWD/.."
+ else
+ DIR="$2"
+ fi
+
+ find $DIR -type f \( -name '*.c' -o -name '*.xml' \) -exec $0 diff \{\} \;
+ ;;
+
+ recpatch)
+ if [ "$2" = "" ] ; then
+ DIR="$PWD/.."
+ else
+ DIR="$2"
+ fi
+
+ find $DIR -type f \( -name '*.c' -o -name '*.xml' \) -exec $0 patch \{\} \;
+ ;;
+
+ diff)
+ T=`mktemp`
+ sed '/^$/N;/^\n$/D' < "$2" > "$T"
+ diff -u "$2" "$T"
+ rm -f "$T"
+ ;;
+
+ patch)
+ sed -i '/^$/N;/^\n$/D' "$2"
+ ;;
+
+ *)
+ echo "Expected recdiff|recpatch|diff|patch as verb." >&2
+ ;;
+esac