From nobody Fri Jun 5 06:02:37 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gWrSZ0RSdz6gSwk for ; Fri, 05 Jun 2026 06:02:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gWrSY4kHCz3HZb for ; Fri, 05 Jun 2026 06:02:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780639357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=79gf4M0b6Tf4o2v1wskhesSrHXRwII0YUMVVDrNgIhE=; b=VswBYjEt51XVs20kJpgLPutQmwfvFUwDiy3oXqAJNkoF1OffNePU/fOBByKTuOZyO+ZM1S MK0hsSZ7j/M+LJc7sf1uN6l69QiSEnCvutHlPSbolonP8RnMJ0DSYeErPuUwtLB+vNlG4z bEeEXNXu1Im5Ves2atjThaupM+WuoYdmVYOak2zzt2AQlD8QYLcyV15QJIscOBxpA6w+mK C/8ivhRPBq36yGtO8TQBEvbtpm9r/+QirkUPhyLzjUdJ6Y0U2uW1OHlZq/AIKWhDf9zqZd L3X9ARGPTfytrwi7LA3cBTIYXmihN9ETnSrTak/kL3Q3wy8tPY4Zxv+GUP6+YA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1780639357; a=rsa-sha256; cv=none; b=H53LdJFMwtGLRBODSIebl0iYCrUj3FqoeJ40xbnxNLYYVo2QWmyM4jFlRf7GkCJjjJmpFe 1svHTWWBrFyCTmlZSnvzhogQC/NcHPCqqCJjR9LwDKqIf0xXI5DaMEURerm1Fyqeg1pOOK 4SIRpiEkKkwyFHysg7cBnzJohvE0b3wwAeY+gCNXhvvkkArROd3v7gOGVVu9ZOjqy39//U 9j8ihRmx82qGhHQmgPiAn1dHcPcBezi9m6WLm9BF26dbllZDVuYJFcKpccb8PxolJXwGoD kZEWR6HYsKVk9yrXE9/tbPUaI7HA/E5KhfMr/9590ZlPBN5WQnQgzzu4HbKYVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780639357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=79gf4M0b6Tf4o2v1wskhesSrHXRwII0YUMVVDrNgIhE=; b=OPJt4mkUHMy02w6Mhd81k0XTSIifL+q+GFxCWPBqHLHl55gi0uzcKrRjxSogi4ikrWrHcf V7DmJLMDEq2mSnvBD7tn4wNRWIUzVru1TbbvvihncM82nAIsd/FO4Sq6A1Ap1ldMSl1b8v 9iZw3ZlXwfsKlvRLmK/jLK3M5ID4LxtNLxQ3Z/iYH6hH0nlE4V1Gpo1cKfgSX7fAw0L6Fs NiUtX8jTRpBvRy/N1VxKmm86U+H4U4e0W0aAUVfPfYdvDxjEGT97uuhM751PgBbzmSnCoZ Qq/u8bKI6jxCaug97y+eNOH9a/o9eaR5T3TOEA7IXA28wt5IgILgGR5E3Xeb0Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gWrSY499Qz16W for ; Fri, 05 Jun 2026 06:02:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 27181 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 05 Jun 2026 06:02:37 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 5f9c8f142d17 - main - pw: fix const qualification in unquote() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f9c8f142d1702f5810618e02534054d28d22fa5 Auto-Submitted: auto-generated Date: Fri, 05 Jun 2026 06:02:37 +0000 Message-Id: <6a22667d.27181.44a40b6@gitrepo.freebsd.org> The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=5f9c8f142d1702f5810618e02534054d28d22fa5 commit 5f9c8f142d1702f5810618e02534054d28d22fa5 Author: Baptiste Daroussin AuthorDate: 2026-06-04 22:13:23 +0000 Commit: Baptiste Daroussin CommitDate: 2026-06-05 06:01:44 +0000 pw: fix const qualification in unquote() The unquote() function took a const char * parameter but modified the string in-place (removing quote characters). Change the parameter to char * and update callers that passed const char * to cast explicitly. --- usr.sbin/pw/pw_conf.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/usr.sbin/pw/pw_conf.c b/usr.sbin/pw/pw_conf.c index e9042b15b321..21c4824ead93 100644 --- a/usr.sbin/pw/pw_conf.c +++ b/usr.sbin/pw/pw_conf.c @@ -156,22 +156,22 @@ static char const *kwds[] = }; static char * -unquote(char const * str) +unquote(char * str) { if (str && (*str == '"' || *str == '\'')) { char *p = strchr(str + 1, *str); if (p != NULL) *p = '\0'; - return (char *) (*++str ? str : NULL); + return (*++str ? str : NULL); } - return (char *) str; + return (str); } int boolean_val(char const * str, int dflt) { - if ((str = unquote(str)) != NULL) { + if ((str = unquote((char *)str)) != NULL) { int i; for (i = 0; booltrue[i]; i++) @@ -187,7 +187,7 @@ boolean_val(char const * str, int dflt) int passwd_val(char const * str, int dflt) { - if ((str = unquote(str)) != NULL) { + if ((str = unquote((char *)str)) != NULL) { int i; for (i = 0; booltrue[i]; i++) @@ -228,7 +228,7 @@ newstr(char const * p) { char *q; - if ((p = unquote(p)) == NULL) + if ((p = unquote((char *)p)) == NULL) return (NULL); if ((q = strdup(p)) == NULL)