diff options
author | Tom Gundersen <teg@jklm.no> | 2015-08-12 15:19:23 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-08-12 15:19:23 +0200 |
commit | 02d0f8a8a52297da2d77f80e2f32a7e233fd8c21 (patch) | |
tree | 4522038e07320dae3cbddcd9f71bd1e9e424a3a0 /src/udev | |
parent | f19121bbaecb6d481081850ed491e8e84a2bac21 (diff) | |
parent | a592ab6ae891ceb63c7115257a0de0c6c45a2f42 (diff) |
Merge pull request #939 from karelzak/smatch
treewide: trivial issues detected by smatch
Diffstat (limited to 'src/udev')
-rw-r--r-- | src/udev/udev-ctrl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/udev/udev-ctrl.c b/src/udev/udev-ctrl.c index b0ad277f73..b4ae0944eb 100644 --- a/src/udev/udev-ctrl.c +++ b/src/udev/udev-ctrl.c @@ -379,13 +379,14 @@ struct udev_ctrl_msg *udev_ctrl_receive_msg(struct udev_ctrl_connection *conn) { cmsg_close_all(&smsg); cmsg = CMSG_FIRSTHDR(&smsg); - cred = (struct ucred *) CMSG_DATA(cmsg); if (cmsg == NULL || cmsg->cmsg_type != SCM_CREDENTIALS) { log_error("no sender credentials received, message ignored"); goto err; } + cred = (struct ucred *) CMSG_DATA(cmsg); + if (cred->uid != 0) { log_error("sender uid="UID_FMT", message ignored", cred->uid); goto err; |