Home
last modified time | relevance | path

Searched refs:ucred (Results 1 – 25 of 42) sorted by relevance

12

/systemd-251/src/journal/
Djournald-native.c32 static bool allow_object_pid(const struct ucred *ucred) { in allow_object_pid() argument
33 return ucred && ucred->uid == 0; in allow_object_pid()
38 const struct ucred *ucred, in server_process_entry_meta() argument
85 allow_object_pid(ucred)) { in server_process_entry_meta()
99 const struct ucred *ucred, in server_process_entry() argument
179 server_process_entry_meta(p, l, ucred, in server_process_entry()
232 server_process_entry_meta(k, (e - p) + 1 + l, ucred, in server_process_entry()
264 … server_forward_syslog(s, syslog_fixup_facility(priority), identifier, message, ucred, tv); in server_process_entry()
267 server_forward_kmsg(s, priority, identifier, message, ucred); in server_process_entry()
270 server_forward_console(s, priority, identifier, message, ucred); in server_process_entry()
[all …]
Djournald-syslog.c32 const struct ucred *ucred, in forward_syslog_iovec() argument
42 CMSG_BUFFER_TYPE(CMSG_SPACE(sizeof(struct ucred))) control; in forward_syslog_iovec()
60 if (ucred) { in forward_syslog_iovec()
68 cmsg->cmsg_len = CMSG_LEN(sizeof(struct ucred)); in forward_syslog_iovec()
69 memcpy(CMSG_DATA(cmsg), ucred, sizeof(struct ucred)); in forward_syslog_iovec()
86 if (ucred && IN_SET(errno, ESRCH, EPERM)) { in forward_syslog_iovec()
87 struct ucred u; in forward_syslog_iovec()
93 u = *ucred; in forward_syslog_iovec()
95 memcpy(CMSG_DATA(cmsg), &u, sizeof(struct ucred)); in forward_syslog_iovec()
110 …*s, int priority, const char *buffer, size_t buffer_len, const struct ucred *ucred, const struct t… in forward_syslog_raw() argument
[all …]
Djournald-context.c200 static void client_context_read_uid_gid(ClientContext *c, const struct ucred *ucred) { in client_context_read_uid_gid() argument
205 if (ucred && uid_is_valid(ucred->uid)) in client_context_read_uid_gid()
206 c->uid = ucred->uid; in client_context_read_uid_gid()
210 if (ucred && gid_is_valid(ucred->gid)) in client_context_read_uid_gid()
211 c->gid = ucred->gid; in client_context_read_uid_gid()
506 const struct ucred *ucred, in client_context_really_refresh() argument
518 client_context_read_uid_gid(c, ucred); in client_context_really_refresh()
543 const struct ucred *ucred, in client_context_maybe_refresh() argument
570 if (ucred && uid_is_valid(ucred->uid) && c->uid != ucred->uid) in client_context_maybe_refresh()
573 if (ucred && gid_is_valid(ucred->gid) && c->gid != ucred->gid) in client_context_maybe_refresh()
[all …]
Djournald-stream.c79 struct ucred ucred; member
266 else if (pid_is_valid(s->ucred.pid)) { in stdout_stream_log()
267 …r = client_context_acquire(s->server, s->ucred.pid, &s->ucred, s->label, strlen_ptr(s->label), s->… in stdout_stream_log()
284 …rver_forward_syslog(s->server, syslog_fixup_facility(priority), s->identifier, p, &s->ucred, NULL); in stdout_stream_log()
287 server_forward_kmsg(s->server, priority, s->identifier, p, &s->ucred); in stdout_stream_log()
290 server_forward_console(s->server, priority, s->identifier, p, &s->ucred); in stdout_stream_log()
293 server_forward_wall(s->server, priority, s->identifier, p, &s->ucred); in stdout_stream_log()
382 if (s->ucred.uid == 0 && in stdout_stream_line()
549 CMSG_BUFFER_TYPE(CMSG_SPACE(sizeof(struct ucred))) control; in stdout_stream_process()
552 struct ucred *ucred; in stdout_stream_process() local
[all …]
Dfuzz-journald-native-fd.c18 struct ucred ucred; in LLVMFuzzerTestOneInput() local
31 ucred = (struct ucred) { in LLVMFuzzerTestOneInput()
36 server_process_native_file(&s, sealed_fd, &ucred, tv, label, label_len); in LLVMFuzzerTestOneInput()
42 server_process_native_file(&s, unsealed_fd, &ucred, tv, label, label_len); in LLVMFuzzerTestOneInput()
Djournald-context.h63 const struct ucred *ucred,
71 const struct ucred *ucred,
81 const struct ucred *ucred,
Djournald-wall.c16 const struct ucred *ucred) { in server_forward_wall() argument
28 if (ucred) { in server_forward_wall()
30 (void) get_process_comm(ucred->pid, &ident_buf); in server_forward_wall()
34 … if (asprintf(&l_buf, "%s["PID_FMT"]: %s", strempty(identifier), ucred->pid, message) < 0) { in server_forward_wall()
Dfuzz-journald.c31 …void (*f)(Server *s, const char *buf, size_t raw_len, const struct ucred *ucred, const struct time… in fuzz_journald_processing_function() argument
36 struct ucred *ucred = NULL; in fuzz_journald_processing_function() local
43 (*f)(&s, s.buffer, size, ucred, tv, label, label_len); in fuzz_journald_processing_function()
Djournald-console.c39 const struct ucred *ucred) { in server_forward_console() argument
67 if (ucred) { in server_forward_console()
69 (void) get_process_comm(ucred->pid, &ident_buf); in server_forward_console()
73 xsprintf(header_pid, "["PID_FMT"]: ", ucred->pid); in server_forward_console()
Djournald-native.h10 const struct ucred *ucred,
18 const struct ucred *ucred,
Djournald-syslog.h10 …t priority, const char *identifier, const char *message, const struct ucred *ucred, const struct t…
12 …slog_message(Server *s, const char *buf, size_t buf_len, const struct ucred *ucred, const struct t…
Djournald-console.h6 …e(Server *s, int priority, const char *identifier, const char *message, const struct ucred *ucred);
Djournald-wall.h8 …l(Server *s, int priority, const char *identifier, const char *message, const struct ucred *ucred);
Djournald-kmsg.c33 const struct ucred *ucred) { in server_forward_kmsg() argument
61 if (ucred) { in server_forward_kmsg()
63 (void) get_process_comm(ucred->pid, &ident_buf); in server_forward_kmsg()
67 xsprintf(header_pid, "["PID_FMT"]: ", ucred->pid); in server_forward_kmsg()
Djournald-audit.h7 …ssage(Server *s, const void *buffer, size_t buffer_size, const struct ucred *ucred, const union so…
Djournald-kmsg.h9 …g(Server *s, int priority, const char *identifier, const char *message, const struct ucred *ucred);
Dfuzz-journald.h11 …void (*f)(Server *s, const char *buf, size_t raw_len, const struct ucred *ucred, const struct time…
/systemd-251/src/libsystemd/sd-login/
Dsd-login.c139 struct ucred ucred = UCRED_INVALID; in sd_peer_get_session() local
145 r = getpeercred(fd, &ucred); in sd_peer_get_session()
149 return cg_pid_get_session(ucred.pid, session); in sd_peer_get_session()
153 struct ucred ucred; in sd_peer_get_owner_uid() local
159 r = getpeercred(fd, &ucred); in sd_peer_get_owner_uid()
163 return cg_pid_get_owner_uid(ucred.pid, uid); in sd_peer_get_owner_uid()
167 struct ucred ucred; in sd_peer_get_unit() local
173 r = getpeercred(fd, &ucred); in sd_peer_get_unit()
177 return cg_pid_get_unit(ucred.pid, unit); in sd_peer_get_unit()
181 struct ucred ucred; in sd_peer_get_user_unit() local
[all …]
/systemd-251/src/udev/
Dudev-ctrl.c158 CMSG_BUFFER_TYPE(CMSG_SPACE(sizeof(struct ucred))) control; in udev_ctrl_connection_event_handler()
166 struct ucred *cred; in udev_ctrl_connection_event_handler()
196 cred = (struct ucred *) CMSG_DATA(cmsg); in udev_ctrl_connection_event_handler()
222 struct ucred ucred; in udev_ctrl_event_handler() local
236 r = getpeercred(sock, &ucred); in udev_ctrl_event_handler()
242 if (ucred.uid > 0) { in udev_ctrl_event_handler()
243 log_error("Invalid sender uid "UID_FMT", closing connection", ucred.uid); in udev_ctrl_event_handler()
/systemd-251/src/libsystemd/sd-daemon/
Dsd-daemon.c495 (send_ucred ? CMSG_SPACE(sizeof(struct ucred)) : 0); in sd_pid_notify_with_fds()
512 struct ucred *ucred; in sd_pid_notify_with_fds() local
516 cmsg->cmsg_len = CMSG_LEN(sizeof(struct ucred)); in sd_pid_notify_with_fds()
518 ucred = (struct ucred*) CMSG_DATA(cmsg); in sd_pid_notify_with_fds()
519 ucred->pid = pid != 0 ? pid : getpid_cached(); in sd_pid_notify_with_fds()
520 ucred->uid = getuid(); in sd_pid_notify_with_fds()
521 ucred->gid = getgid(); in sd_pid_notify_with_fds()
533 msghdr.msg_controllen -= CMSG_SPACE(sizeof(struct ucred)); in sd_pid_notify_with_fds()
/systemd-251/src/shared/
Dvarlink.c130 struct ucred ucred; member
261 .ucred = UCRED_INVALID, in varlink_new()
1174 uid_is_valid(v->ucred.uid)) { in varlink_detach_server()
1177 c = PTR_TO_UINT(hashmap_get(v->server->by_uid, UID_TO_PTR(v->ucred.uid))); in varlink_detach_server()
1181 (void) hashmap_remove(v->server->by_uid, UID_TO_PTR(v->ucred.uid)); in varlink_detach_server()
1183 … (void) hashmap_replace(v->server->by_uid, UID_TO_PTR(v->ucred.uid), UINT_TO_PTR(c - 1)); in varlink_detach_server()
1793 r = getpeercred(v->fd, &v->ucred); in varlink_acquire_ucred()
1811 if (!uid_is_valid(v->ucred.uid)) in varlink_get_peer_uid()
1814 *ret = v->ucred.uid; in varlink_get_peer_uid()
1828 if (!pid_is_valid(v->ucred.pid)) in varlink_get_peer_pid()
[all …]
Dbus-util.c181 struct ucred ucred; in bus_check_peercred() local
190 r = getpeercred(fd, &ucred); in bus_check_peercred()
194 if (ucred.uid != 0 && ucred.uid != geteuid()) in bus_check_peercred()
Dask-password-api.c830 CMSG_BUFFER_TYPE(CMSG_SPACE(sizeof(struct ucred))) control; in ask_password_agent()
833 struct ucred *ucred; in ask_password_agent() local
905 ucred = CMSG_FIND_DATA(&msghdr, SOL_SOCKET, SCM_CREDENTIALS, struct ucred); in ask_password_agent()
906 if (!ucred) { in ask_password_agent()
911 if (ucred->uid != 0) { in ask_password_agent()
/systemd-251/src/basic/
Dsocket-util.c589 struct ucred ucred = UCRED_INVALID; in getpeername_pretty() local
594 r = getpeercred(fd, &ucred); in getpeername_pretty()
598 if (asprintf(ret, "PID "PID_FMT"/UID "UID_FMT, ucred.pid, ucred.uid) < 0) in getpeername_pretty()
869 int getpeercred(int fd, struct ucred *ucred) { in getpeercred() argument
870 socklen_t n = sizeof(struct ucred); in getpeercred()
871 struct ucred u; in getpeercred()
875 assert(ucred); in getpeercred()
881 if (n != sizeof(struct ucred)) in getpeercred()
891 *ucred = u; in getpeercred()
/systemd-251/src/test/
Dtest-socket-util.c170 struct ucred ucred; in TEST() local
201 assert_se(getpeercred(pair[0], &ucred) >= 0); in TEST()
203 assert_se(ucred.uid == test_uid); in TEST()
204 assert_se(ucred.gid == test_gid); in TEST()
205 assert_se(ucred.pid == getpid_cached()); in TEST()

12