libselinux/utils: use correct type for backend argument

selabel_open(3) expects the backend to be of type unsigned int.

Also initialize with a macro flag instead raw 0.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Acked-by: James Carter <jwcart2@gmail.com>
This commit is contained in:
Christian Göttsche 2023-08-09 19:55:36 +02:00 committed by James Carter
parent 0eb989f699
commit e28f6a8a15
2 changed files with 4 additions and 2 deletions

View File

@ -59,7 +59,8 @@ static int run_check_digest(char *cmd, char *selabel_digest)
int main(int argc, char **argv)
{
int backend = 0, rc, opt, validate = 0;
unsigned int backend = SELABEL_CTX_FILE;
int rc, opt, validate = 0;
char *baseonly = NULL, *file = NULL, *digest = (char *)1;
char **specfiles = NULL;
unsigned char *sha1_digest = NULL;

View File

@ -32,7 +32,8 @@ static __attribute__ ((__noreturn__)) void usage(const char *progname)
int main(int argc, char **argv)
{
int raw = 0, type = 0, backend = 0, rc, opt;
int raw = 0, type = 0, rc, opt;
unsigned int backend = SELABEL_CTX_FILE;
char *validate = NULL, *key = NULL, *context = NULL, *file = NULL;
struct selabel_handle *hnd;