* modules/pam_localuser/pam_localuser.c: Include "pam_inline.h".
(pam_sm_authenticate): Use pam_str_skip_prefix instead of ugly strncmp
invocations.
---
modules/pam_localuser/pam_localuser.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/modules/pam_localuser/pam_localuser.c
b/modules/pam_localuser/pam_localuser.c
index e32ea6d7..139d18cd 100644
--- a/modules/pam_localuser/pam_localuser.c
+++ b/modules/pam_localuser/pam_localuser.c
@@ -52,6 +52,7 @@
#include <security/pam_modules.h>
#include <security/_pam_macros.h>
#include <security/pam_ext.h>
+#include "pam_inline.h"
#define MODULE_NAME "pam_localuser"
@@ -73,8 +74,10 @@ pam_sm_authenticate (pam_handle_t *pamh, int flags UNUSED,
}
}
for(i = 0; i < argc; i++) {
- if(strncmp("file=", argv[i], 5) == 0) {
- filename = argv[i] + 5;
+ const char *str;
+
+ if ((str = pam_str_skip_prefix(argv[i], "file="))) {
+ filename = str;
if(debug) {
pam_syslog (pamh, LOG_DEBUG,
"set filename to \"%s\"",
--
ldv