mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-26 10:03:40 +03:00
sd-bus: remove ucred parameter from bus_message_from_header() since we don't use it anymore
This commit is contained in:
parent
3c42e8b281
commit
aa0d0ed6b8
@ -498,7 +498,6 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) {
|
|||||||
footer, footer_size,
|
footer, footer_size,
|
||||||
n_bytes,
|
n_bytes,
|
||||||
fds, n_fds,
|
fds, n_fds,
|
||||||
NULL,
|
|
||||||
seclabel, 0, &m);
|
seclabel, 0, &m);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
@ -435,7 +435,6 @@ int bus_message_from_header(
|
|||||||
size_t message_size,
|
size_t message_size,
|
||||||
int *fds,
|
int *fds,
|
||||||
unsigned n_fds,
|
unsigned n_fds,
|
||||||
const struct ucred *ucred,
|
|
||||||
const char *label,
|
const char *label,
|
||||||
size_t extra,
|
size_t extra,
|
||||||
sd_bus_message **ret) {
|
sd_bus_message **ret) {
|
||||||
@ -528,23 +527,6 @@ int bus_message_from_header(
|
|||||||
m->fds = fds;
|
m->fds = fds;
|
||||||
m->n_fds = n_fds;
|
m->n_fds = n_fds;
|
||||||
|
|
||||||
if (ucred) {
|
|
||||||
m->creds.pid = ucred->pid;
|
|
||||||
m->creds.euid = ucred->uid;
|
|
||||||
m->creds.egid = ucred->gid;
|
|
||||||
|
|
||||||
/* Due to namespace translations some data might be
|
|
||||||
* missing from this ucred record. */
|
|
||||||
if (m->creds.pid > 0)
|
|
||||||
m->creds.mask |= SD_BUS_CREDS_PID;
|
|
||||||
|
|
||||||
if (m->creds.euid != UID_INVALID)
|
|
||||||
m->creds.mask |= SD_BUS_CREDS_EUID;
|
|
||||||
|
|
||||||
if (m->creds.egid != GID_INVALID)
|
|
||||||
m->creds.mask |= SD_BUS_CREDS_EGID;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (label) {
|
if (label) {
|
||||||
m->creds.label = (char*) m + ALIGN(sizeof(sd_bus_message)) + ALIGN(extra);
|
m->creds.label = (char*) m + ALIGN(sizeof(sd_bus_message)) + ALIGN(extra);
|
||||||
memcpy(m->creds.label, label, label_sz + 1);
|
memcpy(m->creds.label, label, label_sz + 1);
|
||||||
@ -565,7 +547,6 @@ int bus_message_from_malloc(
|
|||||||
size_t length,
|
size_t length,
|
||||||
int *fds,
|
int *fds,
|
||||||
unsigned n_fds,
|
unsigned n_fds,
|
||||||
const struct ucred *ucred,
|
|
||||||
const char *label,
|
const char *label,
|
||||||
sd_bus_message **ret) {
|
sd_bus_message **ret) {
|
||||||
|
|
||||||
@ -579,7 +560,7 @@ int bus_message_from_malloc(
|
|||||||
buffer, length,
|
buffer, length,
|
||||||
length,
|
length,
|
||||||
fds, n_fds,
|
fds, n_fds,
|
||||||
ucred, label,
|
label,
|
||||||
0, &m);
|
0, &m);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
@ -205,7 +205,6 @@ int bus_message_from_header(
|
|||||||
size_t message_size,
|
size_t message_size,
|
||||||
int *fds,
|
int *fds,
|
||||||
unsigned n_fds,
|
unsigned n_fds,
|
||||||
const struct ucred *ucred,
|
|
||||||
const char *label,
|
const char *label,
|
||||||
size_t extra,
|
size_t extra,
|
||||||
sd_bus_message **ret);
|
sd_bus_message **ret);
|
||||||
@ -216,7 +215,6 @@ int bus_message_from_malloc(
|
|||||||
size_t length,
|
size_t length,
|
||||||
int *fds,
|
int *fds,
|
||||||
unsigned n_fds,
|
unsigned n_fds,
|
||||||
const struct ucred *ucred,
|
|
||||||
const char *label,
|
const char *label,
|
||||||
sd_bus_message **ret);
|
sd_bus_message **ret);
|
||||||
|
|
||||||
|
@ -915,7 +915,6 @@ static int bus_socket_make_message(sd_bus *bus, size_t size) {
|
|||||||
bus->rbuffer, size,
|
bus->rbuffer, size,
|
||||||
bus->fds, bus->n_fds,
|
bus->fds, bus->n_fds,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
|
||||||
&t);
|
&t);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
free(b);
|
free(b);
|
||||||
|
@ -198,7 +198,7 @@ static void test_marshal(void) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
assert_se(bus_message_from_malloc(bus, blob, sz, NULL, 0, NULL, NULL, &n) >= 0);
|
assert_se(bus_message_from_malloc(bus, blob, sz, NULL, 0, NULL, &n) >= 0);
|
||||||
blob = NULL;
|
blob = NULL;
|
||||||
|
|
||||||
assert_se(bus_message_dump(n, NULL, BUS_MESSAGE_DUMP_WITH_HEADER) >= 0);
|
assert_se(bus_message_dump(n, NULL, BUS_MESSAGE_DUMP_WITH_HEADER) >= 0);
|
||||||
|
@ -212,7 +212,7 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
m = sd_bus_message_unref(m);
|
m = sd_bus_message_unref(m);
|
||||||
|
|
||||||
r = bus_message_from_malloc(bus, buffer, sz, NULL, 0, NULL, NULL, &m);
|
r = bus_message_from_malloc(bus, buffer, sz, NULL, 0, NULL, &m);
|
||||||
assert_se(r >= 0);
|
assert_se(r >= 0);
|
||||||
|
|
||||||
bus_message_dump(m, stdout, BUS_MESSAGE_DUMP_WITH_HEADER);
|
bus_message_dump(m, stdout, BUS_MESSAGE_DUMP_WITH_HEADER);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user