diff --git a/cado.c b/cado.c index 6494bca..c2c99d7 100644 --- a/cado.c +++ b/cado.c @@ -30,6 +30,7 @@ #include #include #include +#include static void printcapset(uint64_t capset, char *indent) { cap_value_t cap; @@ -41,7 +42,7 @@ static void printcapset(uint64_t capset, char *indent) { } } if (count > 1) - printf("%s %016llx\n",indent,capset); + printf("%s %016" PRIx64 "\n",indent,capset); } #define OPTSTRING "hqvs" diff --git a/caprint.c b/caprint.c index 8809dc1..6a0a1a2 100644 --- a/caprint.c +++ b/caprint.c @@ -27,6 +27,7 @@ #include #include #include +#include char *tag="CapAmb:\t"; uint64_t get_capamb(pid_t pid) { @@ -46,7 +47,9 @@ uint64_t get_capamb(pid_t pid) { if (c == tag[status]) { status++; if (status == target) { - fscanf(f,"%llx",&capamb); + int fields = 0; + if ((fields = fscanf(f,"%" PRIx64 "",&capamb)) != 1) + fprintf(stderr, "WARNING: fscanf on %s return %d fields.\n", filename, fields); break; } } else @@ -126,6 +129,8 @@ int main(int argc, char *argv[]) { if (prompt) printf("#"); if (compact) printf("\n"); if (longlist && count > 1) - printf(" %016llx\n",capamb); + printf(" %016" PRIx64 "\n",capamb); } + + return 0; } diff --git a/capset_from_namelist.c b/capset_from_namelist.c index 8ce1229..14f52a9 100644 --- a/capset_from_namelist.c +++ b/capset_from_namelist.c @@ -51,7 +51,7 @@ static int addcap(char *name, uint64_t *capset) { int capset_from_namelist(char *namelist, uint64_t *capset) { int rv=0; char *onecap; - char *tmptok; + char *tmptok = NULL; for (; (onecap=strtok_r(namelist,",",&tmptok)) != NULL; namelist=NULL) rv |= addcap(onecap,capset); return rv; diff --git a/configure.ac b/configure.ac index c093ce4..9821c18 100644 --- a/configure.ac +++ b/configure.ac @@ -8,7 +8,6 @@ AC_CONFIG_SRCDIR([pam_check.h]) AC_CONFIG_HEADERS([config.h]) # Checks for programs. -AC_PROG_CXX AC_PROG_CC AC_PROG_INSTALL