summaryrefslogtreecommitdiff
path: root/src/plugins/auth-pam/auth-pam.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/auth-pam/auth-pam.c')
-rw-r--r--src/plugins/auth-pam/auth-pam.c40
1 files changed, 10 insertions, 30 deletions
diff --git a/src/plugins/auth-pam/auth-pam.c b/src/plugins/auth-pam/auth-pam.c
index ae514d7..1767d1e 100644
--- a/src/plugins/auth-pam/auth-pam.c
+++ b/src/plugins/auth-pam/auth-pam.c
@@ -16,9 +16,10 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
@@ -62,9 +63,6 @@
#define RESPONSE_VERIFY_SUCCEEDED 12
#define RESPONSE_VERIFY_FAILED 13
-/* Pointers to functions exported from openvpn */
-static plugin_secure_memzero_t plugin_secure_memzero = NULL;
-
/*
* Plugin state, used by foreground
*/
@@ -276,10 +274,8 @@ name_value_match(const char *query, const char *match)
return strncasecmp(match, query, strlen(match)) == 0;
}
-OPENVPN_EXPORT int
-openvpn_plugin_open_v3(const int v3structver,
- struct openvpn_plugin_args_open_in const *args,
- struct openvpn_plugin_args_open_return *ret)
+OPENVPN_EXPORT openvpn_plugin_handle_t
+openvpn_plugin_open_v1(unsigned int *type_mask, const char *argv[], const char *envp[])
{
pid_t pid;
int fd[2];
@@ -289,16 +285,6 @@ openvpn_plugin_open_v3(const int v3structver,
const int base_parms = 2;
- const char **argv = args->argv;
- const char **envp = args->envp;
-
- /* Check API compatibility -- struct version 4 or higher needed */
- if (v3structver < 4)
- {
- fprintf(stderr, "AUTH-PAM: This plugin is incompatible with the running version of OpenVPN\n");
- return OPENVPN_PLUGIN_FUNC_ERROR;
- }
-
/*
* Allocate our context
*/
@@ -312,10 +298,7 @@ openvpn_plugin_open_v3(const int v3structver,
/*
* Intercept the --auth-user-pass-verify callback.
*/
- ret->type_mask = OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY);
-
- /* Save global pointers to functions exported from openvpn */
- plugin_secure_memzero = args->callbacks->plugin_secure_memzero;
+ *type_mask = OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY);
/*
* Make sure we have two string arguments: the first is the .so name,
@@ -403,8 +386,7 @@ openvpn_plugin_open_v3(const int v3structver,
if (status == RESPONSE_INIT_SUCCEEDED)
{
context->foreground_fd = fd[0];
- ret->handle = (openvpn_plugin_handle_t *) context;
- return OPENVPN_PLUGIN_FUNC_SUCCESS;
+ return (openvpn_plugin_handle_t) context;
}
}
else
@@ -438,7 +420,7 @@ error:
{
free(context);
}
- return OPENVPN_PLUGIN_FUNC_ERROR;
+ return NULL;
}
OPENVPN_EXPORT int
@@ -716,7 +698,7 @@ pam_server(int fd, const char *service, int verb, const struct name_value_list *
struct user_pass up;
int command;
#ifdef USE_PAM_DLOPEN
- static const char pam_so[] = "libpam.so";
+ static const char pam_so[] = "libpam.so.0";
#endif
/*
@@ -803,7 +785,6 @@ pam_server(int fd, const char *service, int verb, const struct name_value_list *
goto done;
}
}
- plugin_secure_memzero(up.password, sizeof(up.password));
break;
case COMMAND_EXIT:
@@ -821,7 +802,6 @@ pam_server(int fd, const char *service, int verb, const struct name_value_list *
}
done:
- plugin_secure_memzero(up.password, sizeof(up.password));
#ifdef USE_PAM_DLOPEN
dlclose_pam();
#endif