summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hromatka <tom.hromatka@oracle.com>2019-02-05 15:27:45 -0700
committerPaul Moore <paul@paul-moore.com>2019-02-18 13:03:46 -0500
commit4a35b6ea6f7c836734536420c50a2745a9e24c69 (patch)
treee6116c4533a589ebb8a2f6bf58f33c3314f12e82
parentcd14d2cf6d975729af2783870aa23e027895261d (diff)
downloadlibseccomp-4a35b6ea6f7c836734536420c50a2745a9e24c69.tar.gz
db: Return -EDOM on endian mismatch during arch add
This commit clarifies the error code when seccomp_arch_add() or seccomp_merge() fails due to an endian mismatch. Previously, libseccomp would return -EEXIST if the new architecture's endianness did not match. This addresses GitHub Issue #86 - BUG: seccomp_arch_add() returns -EEXISTS on endian mismatch Reported-by: Michael Vogt <michael.vogt@gmail.com> Suggested-by: Paul Moore <paul@paul-moore.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
-rw-r--r--src/db.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/db.c b/src/db.c
index 1173534..596dbcd 100644
--- a/src/db.c
+++ b/src/db.c
@@ -1089,7 +1089,7 @@ int db_col_merge(struct db_filter_col *col_dst, struct db_filter_col *col_src)
/* verify that the endianess is a match */
if (col_dst->endian != col_src->endian)
- return -EEXIST;
+ return -EDOM;
/* make sure we don't have any arch/filter collisions */
for (iter_a = 0; iter_a < col_dst->filter_cnt; iter_a++) {
@@ -1286,7 +1286,7 @@ int db_col_db_add(struct db_filter_col *col, struct db_filter *db)
struct db_filter **dbs;
if (col->endian != 0 && col->endian != db->arch->endian)
- return -EEXIST;
+ return -EDOM;
if (db_col_arch_exist(col, db->arch->token))
return -EEXIST;