summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-11-05 08:54:50 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-11-05 14:50:38 -0400
commita476bf85436d8a8195df1693db5b806a9c8f56bd (patch)
tree38aa0856fc67b470c89c66c9d3aa9538de89b9d7 /src
parentd64940d823b7d860ef65e000f084fd3f62b51d81 (diff)
downloadsssd-a476bf85436d8a8195df1693db5b806a9c8f56bd.tar.gz
sssd-a476bf85436d8a8195df1693db5b806a9c8f56bd.tar.bz2
sssd-a476bf85436d8a8195df1693db5b806a9c8f56bd.zip
Properly check the return value from semanage_commit
semanage_commit() returns -1 on error, and can return a positive value on success. https://bugzilla.redhat.com/show_bug.cgi?id=649037
Diffstat (limited to 'src')
-rw-r--r--src/tools/selinux.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/selinux.c b/src/tools/selinux.c
index 27cc5680..647fc17a 100644
--- a/src/tools/selinux.c
+++ b/src/tools/selinux.c
@@ -324,7 +324,7 @@ int set_seuser(const char *login_name, const char *seuser_name)
}
ret = semanage_commit(handle);
- if (ret != 0) {
+ if (ret < 0) {
DEBUG(1, ("Cannot commit SELinux transaction\n"));
ret = EIO;
goto done;
@@ -394,7 +394,7 @@ int del_seuser(const char *login_name)
}
ret = semanage_commit(handle);
- if (ret != 0) {
+ if (ret < 0) {
DEBUG(1, ("Cannot commit SELinux transaction\n"));
ret = EIO;
goto done;