Compare commits

...

2 Commits

Author SHA1 Message Date
Dag-Erling Smørgrav 0458be7855 Decrement optc when removing an option. 2023-06-26 19:56:56 +02:00
Dag-Erling Smørgrav 4b2e3c92df Remove unused variable. 2023-06-26 19:51:48 +02:00
5 changed files with 8 additions and 4 deletions

View File

@ -45,6 +45,7 @@ ideas:
Mikko Työläjärvi <mbsd@pacbell.net> Mikko Työläjärvi <mbsd@pacbell.net>
Nick Hibma <nick@van-laarhoven.org> Nick Hibma <nick@van-laarhoven.org>
Patrick Bihan-Faou <patrick-fbsd@mindstep.com> Patrick Bihan-Faou <patrick-fbsd@mindstep.com>
Robert Morris <rtm@lcs.mit.edu>
Robert Watson <rwatson@freebsd.org> Robert Watson <rwatson@freebsd.org>
Ruslan Ermilov <ru@freebsd.org> Ruslan Ermilov <ru@freebsd.org>
Sebastian Krahmer <sebastian.krahmer@gmail.com> Sebastian Krahmer <sebastian.krahmer@gmail.com>

View File

@ -2,6 +2,9 @@ OpenPAM ??? 2020-07-??
- BUGFIX: Fix race condition in openpam_ttyconv(3) when used with - BUGFIX: Fix race condition in openpam_ttyconv(3) when used with
expect scripts. expect scripts.
- BUGFIX: In openpam_set_option(3), when removing an option, properly
decrement the option count.
============================================================================ ============================================================================
OpenPAM Tabebuia 2019-02-24 OpenPAM Tabebuia 2019-02-24

View File

@ -1,6 +1,6 @@
Copyright (c) 2002-2003 Networks Associates Technology, Inc. Copyright (c) 2002-2003 Networks Associates Technology, Inc.
Copyright (c) 2004-2019 Dag-Erling Smørgrav Copyright (c) 2004-2023 Dag-Erling Smørgrav
All rights reserved. All rights reserved.
This software was developed for the FreeBSD Project by ThinkSec AS and This software was developed for the FreeBSD Project by ThinkSec AS and

View File

@ -1,6 +1,6 @@
/*- /*-
* Copyright (c) 2002-2003 Networks Associates Technology, Inc. * Copyright (c) 2002-2003 Networks Associates Technology, Inc.
* Copyright (c) 2004-2011 Dag-Erling Smørgrav * Copyright (c) 2004-2023 Dag-Erling Smørgrav
* All rights reserved. * All rights reserved.
* *
* This software was developed for the FreeBSD Project by ThinkSec AS and * This software was developed for the FreeBSD Project by ThinkSec AS and
@ -83,6 +83,7 @@ openpam_set_option(pam_handle_t *pamh,
for (free(cur->optv[i]); i < cur->optc; ++i) for (free(cur->optv[i]); i < cur->optc; ++i)
cur->optv[i] = cur->optv[i + 1]; cur->optv[i] = cur->optv[i + 1];
cur->optv[i] = NULL; cur->optv[i] = NULL;
--cur->optc;
RETURNC(PAM_SUCCESS); RETURNC(PAM_SUCCESS);
} }
if (asprintf(&opt, "%.*s=%s", (int)len, option, value) < 0) if (asprintf(&opt, "%.*s=%s", (int)len, option, value) < 0)

View File

@ -122,7 +122,7 @@ end:
static int static int
t_straddch_realloc_ok(char **desc CRYB_UNUSED, void *arg CRYB_UNUSED) t_straddch_realloc_ok(char **desc CRYB_UNUSED, void *arg CRYB_UNUSED)
{ {
char *str, *_str; char *str;
size_t size, _size, len, _len; size_t size, _size, len, _len;
int i, ret; int i, ret;
@ -136,7 +136,6 @@ t_straddch_realloc_ok(char **desc CRYB_UNUSED, void *arg CRYB_UNUSED)
if (!ret) if (!ret)
goto end; goto end;
// repeatedly append to it until size changes // repeatedly append to it until size changes
_str = str;
_size = size; _size = size;
_len = len; _len = len;
for (i = ' '; i <= '~'; i++) { // assume ascii for (i = ' '; i <= '~'; i++) { // assume ascii