Lines Matching defs:mask
400 uint64_t mask,
417 if (mask & SD_BUS_CREDS_PID && item->pids.pid > 0) {
419 c->mask |= SD_BUS_CREDS_PID;
422 if (mask & SD_BUS_CREDS_TID && item->pids.tid > 0) {
424 c->mask |= SD_BUS_CREDS_TID;
427 if (mask & SD_BUS_CREDS_PPID) {
430 c->mask |= SD_BUS_CREDS_PPID;
443 c->mask |= SD_BUS_CREDS_PPID;
451 if (mask & SD_BUS_CREDS_UID && (uid_t) item->creds.uid != UID_INVALID) {
453 c->mask |= SD_BUS_CREDS_UID;
456 if (mask & SD_BUS_CREDS_EUID && (uid_t) item->creds.euid != UID_INVALID) {
458 c->mask |= SD_BUS_CREDS_EUID;
461 if (mask & SD_BUS_CREDS_SUID && (uid_t) item->creds.suid != UID_INVALID) {
463 c->mask |= SD_BUS_CREDS_SUID;
466 if (mask & SD_BUS_CREDS_FSUID && (uid_t) item->creds.fsuid != UID_INVALID) {
468 c->mask |= SD_BUS_CREDS_FSUID;
471 if (mask & SD_BUS_CREDS_GID && (gid_t) item->creds.gid != GID_INVALID) {
473 c->mask |= SD_BUS_CREDS_GID;
476 if (mask & SD_BUS_CREDS_EGID && (gid_t) item->creds.egid != GID_INVALID) {
478 c->mask |= SD_BUS_CREDS_EGID;
481 if (mask & SD_BUS_CREDS_SGID && (gid_t) item->creds.sgid != GID_INVALID) {
483 c->mask |= SD_BUS_CREDS_SGID;
486 if (mask & SD_BUS_CREDS_FSGID && (gid_t) item->creds.fsgid != GID_INVALID) {
488 c->mask |= SD_BUS_CREDS_FSGID;
494 if (mask & SD_BUS_CREDS_COMM) {
499 c->mask |= SD_BUS_CREDS_COMM;
504 if (mask & SD_BUS_CREDS_TID_COMM) {
509 c->mask |= SD_BUS_CREDS_TID_COMM;
514 if (mask & SD_BUS_CREDS_EXE) {
519 c->mask |= SD_BUS_CREDS_EXE;
524 if (mask & SD_BUS_CREDS_CMDLINE) {
530 c->mask |= SD_BUS_CREDS_CMDLINE;
537 SD_BUS_CREDS_SESSION | SD_BUS_CREDS_OWNER_UID) & mask;
552 c->mask |= m;
558 SD_BUS_CREDS_INHERITABLE_CAPS | SD_BUS_CREDS_BOUNDING_CAPS) & mask;
569 c->mask |= m;
574 if (mask & SD_BUS_CREDS_SELINUX_CONTEXT) {
579 c->mask |= SD_BUS_CREDS_SELINUX_CONTEXT;
584 if (mask & SD_BUS_CREDS_AUDIT_SESSION_ID) {
586 c->mask |= SD_BUS_CREDS_AUDIT_SESSION_ID;
589 if (mask & SD_BUS_CREDS_AUDIT_LOGIN_UID) {
591 c->mask |= SD_BUS_CREDS_AUDIT_LOGIN_UID;
596 if ((mask & SD_BUS_CREDS_WELL_KNOWN_NAMES) && service_name_is_valid(item->name.name)) {
601 c->mask |= SD_BUS_CREDS_WELL_KNOWN_NAMES;
606 if (mask & SD_BUS_CREDS_DESCRIPTION) {
611 c->mask |= SD_BUS_CREDS_DESCRIPTION;
616 if (mask & SD_BUS_CREDS_SUPPLEMENTARY_GIDS) {
632 c->mask |= SD_BUS_CREDS_SUPPLEMENTARY_GIDS;
644 uint64_t mask,
677 if ((mask & SD_BUS_CREDS_AUGMENT) &&
678 (mask & (SD_BUS_CREDS_PPID|
686 mask |= SD_BUS_CREDS_PID;
689 cmd->attach_flags = attach_flags_to_kdbus(mask);
712 if (mask & SD_BUS_CREDS_UNIQUE_NAME) {
718 c->mask |= SD_BUS_CREDS_UNIQUE_NAME;
726 c->mask |= mask & SD_BUS_CREDS_WELL_KNOWN_NAMES;
728 r = bus_populate_creds_from_items(bus, conn_info, mask, c);
732 r = bus_creds_add_more(c, mask, 0, 0);
751 uint64_t mask,
762 if ((mask & SD_BUS_CREDS_UNIQUE_NAME) || mask == 0) {
781 if (mask != 0) {
786 if ((mask & SD_BUS_CREDS_UNIQUE_NAME) && unique) {
791 c->mask |= SD_BUS_CREDS_UNIQUE_NAME;
794 if ((mask & SD_BUS_CREDS_PID) ||
795 ((mask & SD_BUS_CREDS_AUGMENT) &&
796 (mask & (SD_BUS_CREDS_UID|SD_BUS_CREDS_SUID|SD_BUS_CREDS_FSUID|
824 if (mask & SD_BUS_CREDS_PID) {
826 c->mask |= SD_BUS_CREDS_PID;
832 if (mask & SD_BUS_CREDS_EUID) {
853 c->mask |= SD_BUS_CREDS_EUID;
858 if (mask & SD_BUS_CREDS_SELINUX_CONTEXT) {
885 c->mask |= SD_BUS_CREDS_SELINUX_CONTEXT;
889 r = bus_creds_add_more(c, mask, pid, 0);
905 uint64_t mask,
910 assert_return((mask & ~SD_BUS_CREDS_AUGMENT) <= _SD_BUS_CREDS_ALL, -EOPNOTSUPP);
911 assert_return(mask == 0 || creds, -EINVAL);
925 return bus_get_name_creds_kdbus(bus, name, mask, false, creds);
927 return bus_get_name_creds_dbus1(bus, name, mask, creds);
930 static int bus_get_owner_creds_kdbus(sd_bus *bus, uint64_t mask, sd_bus_creds **ret) {
946 if ((mask & SD_BUS_CREDS_AUGMENT) &&
947 (mask & (SD_BUS_CREDS_PPID|
955 mask |= SD_BUS_CREDS_PID;
957 cmd.attach_flags = attach_flags_to_kdbus(mask);
965 r = bus_populate_creds_from_items(bus, creator_info, mask, c);
970 r = bus_creds_add_more(c, mask, pid, 0);
979 static int bus_get_owner_creds_dbus1(sd_bus *bus, uint64_t mask, sd_bus_creds **ret) {
987 do_label = bus->label && (mask & SD_BUS_CREDS_SELINUX_CONTEXT);
1000 c->mask |= SD_BUS_CREDS_PID & mask;
1005 c->mask |= SD_BUS_CREDS_EUID & mask;
1010 c->mask |= SD_BUS_CREDS_EGID & mask;
1019 c->mask |= SD_BUS_CREDS_SELINUX_CONTEXT;
1022 r = bus_creds_add_more(c, mask, pid, 0);
1031 _public_ int sd_bus_get_owner_creds(sd_bus *bus, uint64_t mask, sd_bus_creds **ret) {
1033 assert_return((mask & ~SD_BUS_CREDS_AUGMENT) <= _SD_BUS_CREDS_ALL, -EOPNOTSUPP);
1041 return bus_get_owner_creds_kdbus(bus, mask, ret);
1043 return bus_get_owner_creds_dbus1(bus, mask, ret);