pam: Don't check if unsigned is < 0
authorSimon Wilkinson <sxw@your-file-system.com>
Fri, 30 Mar 2012 18:23:24 +0000 (19:23 +0100)
committerDerrick Brashear <shadow@dementix.org>
Sun, 8 Apr 2012 01:27:54 +0000 (18:27 -0700)
uid_t is unsigned, so checking to see if it is less than 0 is a bit
redundant.

Remove the checks to silence a warning from clang.

Change-Id: I5ae429247d328b3320063b4c035f6e5bb101620b
Reviewed-on: http://gerrit.openafs.org/7079
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

src/pam/afs_auth.c
src/pam/afs_setcred.c

index b4c220f..cdeeb0e 100644 (file)
@@ -102,7 +102,7 @@ pam_sm_authenticate(pam_handle_t * pamh, int flags, int argc,
            } else {
                ignore_uid = 1;
                ignore_uid_id = (uid_t) strtol(argv[i], (char **)NULL, 10);
-               if ((ignore_uid_id < 0) || (ignore_uid_id > IGNORE_MAX)) {
+               if (ignore_uid_id > IGNORE_MAX) {
                    ignore_uid = 0;
                    pam_afs_syslog(LOG_ERR, PAMAFS_IGNOREUID, argv[i]);
                }
index f3d2cb8..e52d988 100644 (file)
@@ -92,7 +92,7 @@ pam_sm_setcred(pam_handle_t * pamh, int flags, int argc, const char **argv)
            } else {
                ignore_uid = 1;
                ignore_uid_id = (uid_t) strtol(argv[i], (char **)NULL, 10);
-               if ((0 > ignore_uid_id) || (ignore_uid_id > IGNORE_MAX)) {
+               if (ignore_uid_id > IGNORE_MAX) {
                    ignore_uid = 0;
                    pam_afs_syslog(LOG_ERR, PAMAFS_IGNOREUID, argv[i]);
                }