CVS commit: src/lib/libpam/modules/pam_krb5

2023-09-27 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Sep 28 02:31:05 UTC 2023

Modified Files:
src/lib/libpam/modules/pam_krb5: pam_krb5.c

Log Message:
pam_krb5: Fix PR lib/57631.

Loose ends in the fix for NetBSD-SA2023-006 that weren't caught by
review or, somehow, by my own testing.  Evidently we need automatic
tests for this pam business.

XXX pullup-10
XXX pullup-9
XXX pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libpam/modules/pam_krb5/pam_krb5.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libpam/modules/pam_krb5

2023-09-27 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Sep 28 02:31:05 UTC 2023

Modified Files:
src/lib/libpam/modules/pam_krb5: pam_krb5.c

Log Message:
pam_krb5: Fix PR lib/57631.

Loose ends in the fix for NetBSD-SA2023-006 that weren't caught by
review or, somehow, by my own testing.  Evidently we need automatic
tests for this pam business.

XXX pullup-10
XXX pullup-9
XXX pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libpam/modules/pam_krb5/pam_krb5.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libpam/modules/pam_krb5/pam_krb5.c
diff -u src/lib/libpam/modules/pam_krb5/pam_krb5.c:1.31 src/lib/libpam/modules/pam_krb5/pam_krb5.c:1.32
--- src/lib/libpam/modules/pam_krb5/pam_krb5.c:1.31	Tue Jun 20 22:17:18 2023
+++ src/lib/libpam/modules/pam_krb5/pam_krb5.c	Thu Sep 28 02:31:04 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pam_krb5.c,v 1.31 2023/06/20 22:17:18 riastradh Exp $	*/
+/*	$NetBSD: pam_krb5.c,v 1.32 2023/09/28 02:31:04 riastradh Exp $	*/
 
 /*-
  * This pam_krb5 module contains code that is:
@@ -53,7 +53,7 @@
 #ifdef __FreeBSD__
 __FBSDID("$FreeBSD: src/lib/libpam/modules/pam_krb5/pam_krb5.c,v 1.22 2005/01/24 16:49:50 rwatson Exp $");
 #else
-__RCSID("$NetBSD: pam_krb5.c,v 1.31 2023/06/20 22:17:18 riastradh Exp $");
+__RCSID("$NetBSD: pam_krb5.c,v 1.32 2023/09/28 02:31:04 riastradh Exp $");
 #endif
 
 #include 
@@ -341,7 +341,6 @@ pam_sm_authenticate(pam_handle_t *pamh, 
 	krbret = verify_krb_v5_tgt(pam_context, ccache, srvdup,
 	debug,
 	auth_service, auth_princ, auth_phost, _data);
-	free(srvdup);
 	if (krbret == -1) {
 		PAM_VERBOSE_ERROR("Kerberos 5 error");
 		krb5_cc_destroy(pam_context, ccache);
@@ -955,6 +954,7 @@ verify_krb_v5_tgt_begin(krb5_context con
 	const char *services[3], **service;
 
 	*servicep = NULL;
+	*princp = NULL;
 
 	if (debug)
 		openlog_r("pam_krb5", LOG_PID, LOG_AUTHPRIV, datap);
@@ -996,6 +996,8 @@ verify_krb_v5_tgt_begin(krb5_context con
 		);
 		if (retval != 0)
 			continue;
+		*servicep = *service;
+		*princp = princ;
 		break;
 	}
 	if (keyblock)



Re: CVS commit: src/sbin/gpt

2023-09-27 Thread Robert Elz
Date:Wed, 27 Sep 2023 09:44:10 +
From:"Taylor R Campbell" 
Message-ID:  <20230927094410.b9257f...@cvs.netbsd.org>

  | gpt(8): Make gpt type array and enum match again.

Thanks, and apologies for not checking that better - I did test
that it recognised the new one properly...

kre




CVS commit: src/sbin/gpt

2023-09-27 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Sep 27 09:44:10 UTC 2023

Modified Files:
src/sbin/gpt: gpt_uuid.c gpt_uuid.h

Log Message:
gpt(8): Make gpt type array and enum match again.

Add cross-referencing comment to reduce the probability of these
getting out of sync again.

Should fix a slew of failing tests since kre's recent change to add
windows-recovery to the array but not to the enum:

sbin/gpt/t_gpt:create_2part
sbin/gpt/t_gpt:migrate_disklabel
sbin/gpt/t_gpt:recover_backup
sbin/gpt/t_gpt:recover_primary
sbin/gpt/t_gpt:remove_2part
sbin/gpt/t_gpt:resize_2part
sbin/gpt/t_gpt:restore_2part

Fail: stdout does not match golden output
--- /usr/tests/sbin/gpt/gpt.2part.show.normal   2023-09-26 15:48:30.0 
+
+++ /tmp/check.sc6ylB/stdout2023-09-26 23:30:42.388157924 
+
@@ -3,6 +3,6 @@
   1  1 Pri GPT header
   2 32 Pri GPT table
  34   1024  1  GPT part - EFI System
-   1058   9150  2  GPT part - NetBSD FFSv1/FFSv2
+   1058   9150  2  GPT part - NetBSD Cryptographic Disk
   10208 32 Sec GPT table
   10240  1 Sec GPT header

https://releng.netbsd.org/b5reports/i386/commits-2023.09.html#build-2023.09.26.15.47.11


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sbin/gpt/gpt_uuid.c
cvs rdiff -u -r1.9 -r1.10 src/sbin/gpt/gpt_uuid.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sbin/gpt

2023-09-27 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Sep 27 09:44:10 UTC 2023

Modified Files:
src/sbin/gpt: gpt_uuid.c gpt_uuid.h

Log Message:
gpt(8): Make gpt type array and enum match again.

Add cross-referencing comment to reduce the probability of these
getting out of sync again.

Should fix a slew of failing tests since kre's recent change to add
windows-recovery to the array but not to the enum:

sbin/gpt/t_gpt:create_2part
sbin/gpt/t_gpt:migrate_disklabel
sbin/gpt/t_gpt:recover_backup
sbin/gpt/t_gpt:recover_primary
sbin/gpt/t_gpt:remove_2part
sbin/gpt/t_gpt:resize_2part
sbin/gpt/t_gpt:restore_2part

Fail: stdout does not match golden output
--- /usr/tests/sbin/gpt/gpt.2part.show.normal   2023-09-26 15:48:30.0 
+
+++ /tmp/check.sc6ylB/stdout2023-09-26 23:30:42.388157924 
+
@@ -3,6 +3,6 @@
   1  1 Pri GPT header
   2 32 Pri GPT table
  34   1024  1  GPT part - EFI System
-   1058   9150  2  GPT part - NetBSD FFSv1/FFSv2
+   1058   9150  2  GPT part - NetBSD Cryptographic Disk
   10208 32 Sec GPT table
   10240  1 Sec GPT header

https://releng.netbsd.org/b5reports/i386/commits-2023.09.html#build-2023.09.26.15.47.11


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sbin/gpt/gpt_uuid.c
cvs rdiff -u -r1.9 -r1.10 src/sbin/gpt/gpt_uuid.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/gpt/gpt_uuid.c
diff -u src/sbin/gpt/gpt_uuid.c:1.20 src/sbin/gpt/gpt_uuid.c:1.21
--- src/sbin/gpt/gpt_uuid.c:1.20	Tue Sep 26 15:48:30 2023
+++ src/sbin/gpt/gpt_uuid.c	Wed Sep 27 09:44:10 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: gpt_uuid.c,v 1.20 2023/09/26 15:48:30 kre Exp $	*/
+/*	$NetBSD: gpt_uuid.c,v 1.21 2023/09/27 09:44:10 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include 
 #ifdef __RCSID
-__RCSID("$NetBSD: gpt_uuid.c,v 1.20 2023/09/26 15:48:30 kre Exp $");
+__RCSID("$NetBSD: gpt_uuid.c,v 1.21 2023/09/27 09:44:10 riastradh Exp $");
 #endif
 
 #include 
@@ -65,6 +65,7 @@ static const struct {
 	const char *n;
 	const char *d;
 } gpt_nv[] = {
+	/* Must match the gpt_type_t enum in gpt_uuid.h */
 	{ GPT_ENT_TYPE_APPLE_HFS, "apple", "Apple HFS" },
 	{ GPT_ENT_TYPE_APPLE_UFS, "apple-ufs", "Apple UFS" },
 	{ GPT_ENT_TYPE_BIOS, "bios", "BIOS Boot" },

Index: src/sbin/gpt/gpt_uuid.h
diff -u src/sbin/gpt/gpt_uuid.h:1.9 src/sbin/gpt/gpt_uuid.h:1.10
--- src/sbin/gpt/gpt_uuid.h:1.9	Sun Jun 30 11:38:16 2019
+++ src/sbin/gpt/gpt_uuid.h	Wed Sep 27 09:44:10 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: gpt_uuid.h,v 1.9 2019/06/30 11:38:16 sevan Exp $	*/
+/*	$NetBSD: gpt_uuid.h,v 1.10 2023/09/27 09:44:10 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -46,7 +46,7 @@
  * support anyway
  */
 
-// Must match the array in gpt_uuid.c
+/* Must match the gpt_nv array in gpt_uuid.c */
 typedef enum {
 	GPT_TYPE_INVALID = -1,
 	GPT_TYPE_APPLE_HFS = 0,
@@ -64,6 +64,7 @@ typedef enum {
 	GPT_TYPE_LINUX_LVM,
 	GPT_TYPE_MS_BASIC_DATA,
 	GPT_TYPE_MS_RESERVED,
+	GPT_TYPE_MS_RECOVERY,
 	GPT_TYPE_NETBSD_CCD,
 	GPT_TYPE_NETBSD_CGD,
 	GPT_TYPE_NETBSD_FFS,



CVS commit: src/tests/net/if_ipsec

2023-09-27 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Sep 27 08:48:01 UTC 2023

Modified Files:
src/tests/net/if_ipsec: t_ipsec_unnumbered.sh

Log Message:
Update for sys/net/if_ipsec.c:r1.35


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/net/if_ipsec/t_ipsec_unnumbered.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/net/if_ipsec/t_ipsec_unnumbered.sh
diff -u src/tests/net/if_ipsec/t_ipsec_unnumbered.sh:1.1 src/tests/net/if_ipsec/t_ipsec_unnumbered.sh:1.2
--- src/tests/net/if_ipsec/t_ipsec_unnumbered.sh:1.1	Fri Nov 25 08:43:16 2022
+++ src/tests/net/if_ipsec/t_ipsec_unnumbered.sh	Wed Sep 27 08:48:01 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: t_ipsec_unnumbered.sh,v 1.1 2022/11/25 08:43:16 knakahara Exp $
+#	$NetBSD: t_ipsec_unnumbered.sh,v 1.2 2023/09/27 08:48:01 knakahara Exp $
 #
 # Copyright (c) 2022 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -73,7 +73,7 @@ add_sa()
 	local tmpfile=./tmp
 	local spi=1
 	local algo_args="$(generate_algo_args esp $algo)"
-	local uniq=8200 # 8192(reqid_base) + 2 * 4(lo0, shmif0, shmif1 and ipsec0)
+	local uniq=8192 # 8192(reqid_base) + 2 * 0(unit id of "ipsec0")
 
 	export RUMP_SERVER=$SOCK_LOCAL
 	cat > $tmpfile <<-EOF



CVS commit: src/tests/net/if_ipsec

2023-09-27 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Sep 27 08:48:01 UTC 2023

Modified Files:
src/tests/net/if_ipsec: t_ipsec_unnumbered.sh

Log Message:
Update for sys/net/if_ipsec.c:r1.35


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/net/if_ipsec/t_ipsec_unnumbered.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.