From 7ac103408578ed8ed2ab01e9633021473245913c Mon Sep 17 00:00:00 2001 From: Diego Elio Pettenò Date: Sat, 23 Feb 2013 17:18:35 -0800 Subject: Fix warnings from compiler. userinfo is not a pointer-to-pointer, but just a simple pointer. recvfrom() accepts a generic pointer, rather than a char one, and requires a socklen_t argument, not an int one. --- pam_radius_auth.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pam_radius_auth.c b/pam_radius_auth.c index abea995..11bec48 100644 --- a/pam_radius_auth.c +++ b/pam_radius_auth.c @@ -766,7 +766,8 @@ static int talk_radius(radius_conf_t *conf, AUTH_HDR *request, AUTH_HDR *response, char *password, char *old_password, int tries) { - int salen, total_length; + socklen_t salen; + int total_length; fd_set set; struct timeval tv; time_t now, end; @@ -881,7 +882,7 @@ send: } else if (FD_ISSET(conf->sockfd, &set)) { /* try to receive some data */ - if ((total_length = recvfrom(conf->sockfd, (char *) response, + if ((total_length = recvfrom(conf->sockfd, (void *) response, BUFFER_SIZE, 0, &saremote, &salen)) < 0) { _pam_log(LOG_ERR, "error reading RADIUS packet from server %s: %s", @@ -1062,7 +1063,7 @@ PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh,int flags,int argc,CONST char **argv) { CONST char *user; - CONST char **userinfo; + CONST char *userinfo; char *password = NULL; CONST char *rhost; char *resp2challenge = NULL; -- cgit v1.2.3 From 0089fa4ee9c6de7e7684a88e1227d56beaaf0f85 Mon Sep 17 00:00:00 2001 From: Diego Elio Pettenò Date: Sat, 23 Feb 2013 17:20:01 -0800 Subject: doc: don't use the full path to the module in the usage examples. The path depends on the bitness of the software, so it can't be used this way. --- USAGE | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/USAGE b/USAGE index d850ddd..3caa375 100644 --- a/USAGE +++ b/USAGE @@ -3,9 +3,9 @@ is not implemented, as the RADIUS protocol does not support it. The pam configuration can be: ... -auth sufficient /lib/security/pam_radius_auth.so [options] +auth sufficient pam_radius_auth.so [options] ... -account sufficient /lib/security/pam_radius_auth.so +account sufficient pam_radius_auth.so --------------------------------------------------------------------------- -- cgit v1.2.3 From 1be5ade4364428153cca20edf5ceb99ac950d0be Mon Sep 17 00:00:00 2001 From: Diego Elio Pettenò Date: Sat, 23 Feb 2013 17:26:09 -0800 Subject: build: use GCC for build, and ensure that unneeded symbols are not exported. --- Makefile | 3 ++- pamsymbols.ver | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 pamsymbols.ver diff --git a/Makefile b/Makefile index c050a2b..1c6940e 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,7 @@ CFLAGS = -Wall -fPIC # Then copy pam_radius_auth.so to /usr/freeware/lib32/security (PAM dir) # CFLAGS = +LDFLAGS = -shared -Wl,--version-script=pamsymbols.ver ###################################################################### # @@ -55,7 +56,7 @@ pam_radius_auth.o: pam_radius_auth.c pam_radius_auth.h # gcc -shared pam_radius_auth.o md5.o -lpam -lc -o pam_radius_auth.so # pam_radius_auth.so: pam_radius_auth.o md5.o - ld -Bshareable pam_radius_auth.o md5.o -lpam -o pam_radius_auth.so + $(CC) $(LDFLAGS) pam_radius_auth.o md5.o -lpam -o pam_radius_auth.so ###################################################################### # diff --git a/pamsymbols.ver b/pamsymbols.ver new file mode 100644 index 0000000..d049312 --- /dev/null +++ b/pamsymbols.ver @@ -0,0 +1,4 @@ +{ + global: pam_sm_*; + local: *; +}; -- cgit v1.2.3 From cfc79fd0f796d3b6f9133def44ae79e10c2a0fd4 Mon Sep 17 00:00:00 2001 From: Diego Elio Pettenò Date: Sat, 23 Feb 2013 17:27:29 -0800 Subject: build: do not force flags, add to them instead. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1c6940e..d14b10e 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ VERSION=1.3.17 # # If you're not using GCC, then you'll have to change the CFLAGS. # -CFLAGS = -Wall -fPIC +CFLAGS += -Wall -fPIC # # On Irix, use this with MIPSPRo C Compiler, and don't forget to export CC=cc # gcc on Irix does not work yet for pam_radius @@ -23,7 +23,7 @@ CFLAGS = -Wall -fPIC # Then copy pam_radius_auth.so to /usr/freeware/lib32/security (PAM dir) # CFLAGS = -LDFLAGS = -shared -Wl,--version-script=pamsymbols.ver +LDFLAGS += -shared -Wl,--version-script=pamsymbols.ver ###################################################################### # -- cgit v1.2.3