Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
systemd-mini.1472
1083-udev-node-warn-if-chmod-chown-fails.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1083-udev-node-warn-if-chmod-chown-fails.patch of Package systemd-mini.1472
From 543afdc63c02a5af3cf6bd2a264162f23474346a Mon Sep 17 00:00:00 2001 From: Tom Gundersen <teg@jklm.no> Date: Thu, 18 Sep 2014 19:22:09 +0200 Subject: [PATCH] udev: node - warn if chmod/chown fails No functional change, just log the warning. Fonud by Coverity. Fixes CID #1237544. --- src/udev/udev-node.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git src/udev/udev-node.c src/udev/udev-node.c index c164603..8ef7889 100644 --- src/udev/udev-node.c +++ src/udev/udev-node.c @@ -281,8 +281,12 @@ static int node_permissions_apply(struct udev_device *dev, bool apply, if ((stats.st_mode & 0777) != (mode & 0777) || stats.st_uid != uid || stats.st_gid != gid) { log_debug("set permissions %s, %#o, uid=%u, gid=%u", devnode, mode, uid, gid); - chmod(devnode, mode); - chown(devnode, uid, gid); + err = chmod(devnode, mode); + if (err < 0) + log_warning("setting mode of %s to %#o failed: %m", devnode, mode); + err = chown(devnode, uid, gid); + if (err < 0) + log_warning("setting owner of %s to uid=%u, gid=%u failed: %m", devnode, uid, gid); } else { log_debug("preserve permissions %s, %#o, uid=%u, gid=%u", devnode, mode, uid, gid); } -- 1.7.9.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor