From nobody Wed Mar 23 20:31:08 2022 X-Original-To: freebsd-hackers@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 937E41A28F5F for ; Wed, 23 Mar 2022 20:31:19 +0000 (UTC) (envelope-from phil@freebsd.org) Received: from mx0b-00273201.pphosted.com (mx0b-00273201.pphosted.com [67.231.152.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "Thawte RSA CA 2018" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KP0PL39lYz4f9y; Wed, 23 Mar 2022 20:31:18 +0000 (UTC) (envelope-from phil@freebsd.org) Received: from pps.filterd (m0108163.ppops.net [127.0.0.1]) by mx0b-00273201.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 22NGAjat025582; Wed, 23 Mar 2022 13:31:12 -0700 Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam07lp2042.outbound.protection.outlook.com [104.47.51.42]) by mx0b-00273201.pphosted.com (PPS) with ESMTPS id 3eygncbur5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 23 Mar 2022 13:31:11 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KUunSsn6DstYiZWv9cn4xoYq9WWGgSG52T4l5UIrjSBRJ4D2Ln7HupdBecO9LLWTHEYC5iUn2s58siHmmTLrh+4/BdMhYRFJWefa7fknuHRG3ojBoRyuYGzqNhvu1hjG5PiiMMBwsGvlHBfayXXltb/sFzQ2fJT1P7K41Q8/Xj6E4fYnRiF8z1s69xsOxmRbaQ0r6+wlyr2t/xS6/NKH29T5sHDhO550aQ6dR57Aj34f4jz99LkD1So4ddWXfYwmv9Ijen+lMrgsuBSM0jKGZ58Bq55VcEcYD8KDthNB5V+hdcm5YU+rsQI1TDe4SUCKKiGW+ECNMLE5EblKBvllpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/iUpukdpw1SLk+i7vaQiwg527kRCT/HeURV2R49dtzM=; b=PWvI/QaYcDaQqMwOIy10l0ZccvX3k970Chh1IxGeHBUuBh/HtPXPR0ceNEDmDcXfMVxYD/UxaimPiSyrPTfJ9j5j3kukT+FMxaTHOjkFw4cJd4SstU2TU00uuanfN3yX4rSoXEO0TQizMMWdVNWYMEUpbMZ5c9+w8rynLGxwtYPMe6d3hmyVXZIjEKgE8m/fwVAKYQR3LUfJHKaKeGyfFe8KQDpskmCezJV2IpFFnq5oNd+VFSkvlDNzF8KG9o7yGntFbieBYkqGVPluuSaLu9jcCew41zaBQ1Wi0OW8wm1NOAnJqVuYOHIzEQKb8dVazvcD3faglpeag40AYgw/aQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 66.129.242.14) smtp.rcpttodomain=freebsd.org smtp.mailfrom=freebsd.org; dmarc=none action=none header.from=freebsd.org; dkim=none (message not signed); arc=none Received: from MWHPR12CA0058.namprd12.prod.outlook.com (2603:10b6:300:103::20) by PH0PR05MB8463.namprd05.prod.outlook.com (2603:10b6:510:cd::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.15; Wed, 23 Mar 2022 20:31:10 +0000 Received: from MW2NAM12FT027.eop-nam12.prod.protection.outlook.com (2603:10b6:300:103:cafe::98) by MWHPR12CA0058.outlook.office365.com (2603:10b6:300:103::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.17 via Frontend Transport; Wed, 23 Mar 2022 20:31:10 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 66.129.242.14) smtp.mailfrom=freebsd.org; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=freebsd.org; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning freebsd.org discourages use of 66.129.242.14 as permitted sender) Received: from p-exchfe-eqx-01.jnpr.net (66.129.242.14) by MW2NAM12FT027.mail.protection.outlook.com (10.13.180.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.7 via Frontend Transport; Wed, 23 Mar 2022 20:31:09 +0000 Received: from p-exchbe-eqx-02.jnpr.net (10.104.9.15) by p-exchfe-eqx-01.jnpr.net (10.104.9.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.27; Wed, 23 Mar 2022 15:31:09 -0500 Received: from p-exchbe-eqx-01.jnpr.net (10.104.9.14) by p-exchbe-eqx-02.jnpr.net (10.104.9.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.27; Wed, 23 Mar 2022 15:31:09 -0500 Received: from p-mailhub01.juniper.net (10.104.20.6) by p-exchbe-eqx-01.jnpr.net (10.104.9.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.27 via Frontend Transport; Wed, 23 Mar 2022 15:31:08 -0500 Received: from idle.juniper.net (idleski.juniper.net [172.25.4.10]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id 22NKV85V007936; Wed, 23 Mar 2022 13:31:08 -0700 (envelope-from phil@freebsd.org) Received: from [172.25.4.159] (localhost [127.0.0.1]) by idle.juniper.net (8.16.1/8.16.1) with ESMTP id 22NKNTFr026369; Wed, 23 Mar 2022 16:23:29 -0400 (EDT) (envelope-from phil@freebsd.org) From: Phil Shafer To: FreeBSD Hackers CC: "Simon J. Gerraty" Subject: What's the locale for system files (e.g. /etc/fstab)? Date: Wed, 23 Mar 2022 16:31:08 -0400 X-Mailer: MailMate (1.13.2r5673) Message-ID: <70B211BB-15BA-47A4-8F9C-C833AA8C1EAA@freebsd.org> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-EXCLAIMER-MD-CONFIG: e3cb0ff2-54e7-4646-8a04-0dae4ac7b136 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a2bdca03-107a-46d9-1955-08da0d0c10da X-MS-TrafficTypeDiagnostic: PH0PR05MB8463:EE_ X-MS-Exchange-AtpMessageProperties: SA|SL X-Microsoft-Antispam-PRVS: X-JNPR-Received-From: outside X-MS-Exchange-SenderADCheck: 2 X-MS-Exchange-AntiSpam-Relay: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: q3SUBRNQmvworerFmMDczU79kGAmeFzakgqRpTERNtgjJFikckt25lHQXT9oB/ABIBvNb/a/yn8JlPwGqndNBcwX0SX+dbU/a8aiUD+px/9ziWPHIunFnaWDI6Uz+1Sm8cRw96ApZ1JAsD6I5yFyBhuhNupPEZQEHWCd1O/Dc1Mz3YHL8LPkgTPOiQciz4BTq2rAwASRStN2i0eAleOJJyTljcCEUHjENkynvdE6IQ7X26gFDbGfkJg4/0Tm0OkwDDF3H1OSptH5u3f1E3K+pO49QHAdvH1Dt0402q3Qq82SjFf8Dj16YCTpvubZm1m40h+ZeIOOe6QEn2hjiU42Fi+85LY5wXvg52BTWBJk5XwodtI6bIych7h6ZyExFVFVK1rbu5pN5ivcG9DOIH1o4zDm4mLFcrN0bNv6X3p6K3w6SkNhGC9uPOQofgl5rIlrlIts9PZh25qaHa5QcfgogoIOwozxHkBDzoFm1VvIE2V1Tysfde4/UelKFb+HVFNK5pzHJzUdT9ZS3wE7V6f3X/OGw9FmvUqnVL6zbTdCZURu1/BJBxTG3f1NQtdr29yn/P1GeSXQUIYAzCPUn5W+hrCvWiP03NmFx5h+6EaIQ48bALOvFY8iHDTPGbjzIdh984psOfdKniRstZ93BySNgrCcBJE/W6TciB62pVD13x6QjT/helxkgcf8rN81htIG X-Forefront-Antispam-Report: CIP:66.129.242.14;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:p-exchfe-eqx-01.jnpr.net;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(46966006)(40470700004)(6666004)(2906002)(26005)(53546011)(70586007)(70206006)(86362001)(36756003)(6636002)(6916009)(336012)(508600001)(7126003)(35950700001)(47076005)(450100002)(33656002)(82310400004)(81166007)(356005)(8936002)(5660300002)(4326008)(8676002)(316002)(2616005)(37006003)(40460700003);DIR:OUT;SFP:1022; X-OriginatorOrg: junipernetworks.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2022 20:31:09.9062 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a2bdca03-107a-46d9-1955-08da0d0c10da X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4;Ip=[66.129.242.14];Helo=[p-exchfe-eqx-01.jnpr.net] X-MS-Exchange-CrossTenant-AuthSource: MW2NAM12FT027.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR05MB8463 X-Proofpoint-GUID: briQ4amP9HSiQiRlxxIWEPZfXkDPjBYa X-Proofpoint-ORIG-GUID: briQ4amP9HSiQiRlxxIWEPZfXkDPjBYa X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.850,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-23_08,2022-03-23_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 impostorscore=0 bulkscore=0 clxscore=1011 lowpriorityscore=0 phishscore=0 spamscore=0 mlxlogscore=661 suspectscore=0 malwarescore=0 priorityscore=1501 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203230106 X-Rspamd-Queue-Id: 4KP0PL39lYz4f9y X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=none; spf=softfail (mx1.freebsd.org: 67.231.152.164 is neither permitted nor denied by domain of phil@freebsd.org) smtp.mailfrom=phil@freebsd.org X-Spamd-Result: default: False [-1.27 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; FREEFALL_USER(0.00)[phil]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; R_SPF_SOFTFAIL(0.00)[~all:c]; NEURAL_SPAM_MEDIUM(0.93)[0.928]; NEURAL_HAM_LONG(-1.00)[-0.998]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[104.47.51.42:received]; MLMMJ_DEST(0.00)[freebsd-hackers]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:22843, ipnet:67.231.152.0/24, country:US]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector9901:i=1]; RCVD_COUNT_SEVEN(0.00)[11]; RCVD_IN_DNSWL_LOW(-0.10)[67.231.152.164:from] X-ThisMailContainsUnwantedMimeParts: N On 23 Mar 2022, at 11:51, Piotr Pawel Stefaniak wrote: > mount: make libxo support more locale-aware > > "special", "node", and "mounter" are not guaranteed to be encoded > with > UTF-8. Use the appropriate modifier. > > - xo_emit("{:special}{L: on }{:node}{L: (}{:fstype}", > sfp->f_mntfromname, > + xo_emit("{:special/%hs}{L: on }{:node/%hs}{L: (}{:fstype}", > sfp->f_mntfromname, sfp->f_mntonname, sfp->f_fstypename); This recent "mount" patch highlights a libxo-related problem for which I don't have a solution: There are several files for which the encoding is not known. Since locale is user specific, we don't know how to interpret the contents of /etc/fstab. It's assumably been encoded with the format of the user who wrote it, but that information is lost. Put more generally, there's not a system-wide place which declares the encoding for system files, which leads to this problem where we interpret files from one user's locale using another user's locale. One solution would a symlink in /etc that "points to" the name of the current system-wide locale name. % ls -Fl /etc/locale lrwxr-xr-x 1 root wheel 7 Mar 23 15:42 /etc/locale@ -> C.UTF-8 (Or "/etc/system.locale" ?) If the symlink doesn't exist, would "C.UTF-8" be a suitable default moving forwards? It certainly would not be backwards compatible, since an existing fstab could have non-UTF-8 strings in it, encoded with the locale of the user who touched the file. But there's really no backwards compatible solution, given that there's no guarantee that (for any specific FreeBSD system) all system files were written with the same locale. Fun, eh? ;^) Opinions, thoughts, please? Thanks, Phil