From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 14AEF1F9FC for ; Fri, 26 Mar 2021 04:23:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229671AbhCZEXN (ORCPT ); Fri, 26 Mar 2021 00:23:13 -0400 Received: from cloud.peff.net ([104.130.231.41]:49470 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbhCZEWm (ORCPT ); Fri, 26 Mar 2021 00:22:42 -0400 Received: (qmail 28493 invoked by uid 109); 26 Mar 2021 04:22:42 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Fri, 26 Mar 2021 04:22:42 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 7444 invoked by uid 111); 26 Mar 2021 04:22:43 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Fri, 26 Mar 2021 00:22:43 -0400 Authentication-Results: peff.net; auth=none Date: Fri, 26 Mar 2021 00:22:41 -0400 From: Jeff King To: =?utf-8?Q?Ren=C3=A9_Scharfe=2E?= Cc: Git List , Junio C Hamano , Johannes Schindelin Subject: Re: [PATCH] daemon: sanitize all directory separators Message-ID: References: <314451a4-ee8f-fb68-016f-66a4f3bea409@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <314451a4-ee8f-fb68-016f-66a4f3bea409@web.de> Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Thu, Mar 25, 2021 at 05:21:24PM +0100, René Scharfe. wrote: > When sanitizing client-supplied strings on Windows, also strip off > backslashes, not just slashes. > [...] > static void sanitize_client(struct strbuf *out, const char *in) > { > for (; *in; in++) { > - if (*in == '/') > + if (is_dir_sep(*in)) Yeah, this seems like the obviously correct thing to be doing. -Peff