From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27435 invoked from network); 21 Oct 2023 04:06:31 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 21 Oct 2023 04:06:31 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1697861191; b=dCW26s8OFtXtK44JGjnQkKdWMq7JuBVuNqmeIWMgPqhwP27RzJKtmN24xE6YTc74bAksxOqcgE xKa8pfHi8bflRA5nDNVb8SLhdDzZwE9kJqeBDPwxOYoY+XGbVYaygTii3FhtIBImWLyq6CEg/o MfXVxP8mnsoQKfYEYnubS3aynfiSgNk3BnreW9GJOIE5mbFlPBMSRtEUSN0x1hXSSDinbau15R 4mXXww5c+4ujdLrsP/0Znu99kB3UAj5WdTsWZ504vHtKQFzcqMZch743Qq7dxSOhzjDcAR/tCc GKV0Rcv1nrCm2aGtTXupUAXi39dmRPs/ppaTtDJffYecsg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f49.google.com) smtp.remote-ip=209.85.218.49; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1697861191; bh=Li9i8uWkGwNLt21y3CbXn0SXwWBrzna3aYLwoSNOCwE=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=IQ9ywRGsBhKmb46zzq2+hu0H8hZgpPXpkzQFyzthKuMzFEGv4/1zbuQLePs0uHM1KyDjayu/va 4e9T8I5vFxf1GSLxbX0O4jdKxciH6+GN28cKRkCr/x1BHQI9tiK+JcVf3XB524fUliP/LzQntu pD6Dvv7j56DnwxPTjdxnvkhGWhrEbZ0B+quM3HFy0Q27bq8xWJmD6ZgbvcdgiRAREFEretRIio 4UQaKcf1Rb6MrG2Bi0iXZm1cdZoSVgfXf+0kklGih3WxwB0ImECbBswVZ2F4WsGxrOQpiSA54l +OC1ZNYQi2sIKKQQofjB/w9DFTuTzHsYCqhPRYz4rhVW+Q==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=+nRiGZ1gEgReuCe2orRZXOsd8Yijpp4GfMtT8YNos30=; b=VsILmmaGsoz0uy4GKsy910jgbe APJhOqg6bTGfZWuKjgfJmwvREY9NjOna5pCQ4dMvXctkKgbzj7pKZ1wpM2csFiMB8qxznoqwPH1p4 uBsiRm9Ng0YVvJQmuy0Q9UvHqmJ2tKMVWLTBjcdvtVJfPAIf3asNWJm9CwjPbX1mMS97y4Ww+/8Aj pHJI6p/uX9AozPwGE0H7/MUATxluWmSiXgrKWxHRnKI0J9dsjavz58WTedMi7Demay8iHNzS62q5M AtRE/1bAIS9DgeM45MF5XbNLemGWgbGTsUtVedzVEVTlZCedISs18S7wjFKZlL/fGF/crbf6+NfeR 7T0VzwxA==; Received: by zero.zsh.org with local id 1qu3Fu-0003Fq-Gc; Sat, 21 Oct 2023 04:06:30 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f49.google.com) smtp.remote-ip=209.85.218.49; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f49.google.com ([209.85.218.49]:49354) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1qu3FL-0002wF-NG; Sat, 21 Oct 2023 04:05:56 +0000 Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-9ada2e6e75fso220885466b.2 for ; Fri, 20 Oct 2023 21:05:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1697861155; x=1698465955; darn=zsh.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=+nRiGZ1gEgReuCe2orRZXOsd8Yijpp4GfMtT8YNos30=; b=YyRNeJpEcyKZ9ZOwulkPrrCQXsJdmVInmnZIX8NTGLMeQzhs1x3iHoqlrUjjgDZlWE M1J7PEXXszmsiXSvoHjINw6KfvapQ8s6CoGnCtHm7b3f2otH1WyFmhAGYbXbFoD54oFi uiVVQw8Xr6CiE6WHSWR9Bx0+8Q5xh21JSK+rIGqXsEWeB/yRqJAZlC1hT1KZ/ImPD2s3 YYKD6K+IKl39Xl+o0/U1+1x9m/nBGGPFalBnZTCL3D/PnwAWj46Eh+klBfASgHbB4pvJ SyFkAELOAZOTSu5LAc/rn1MvCk2A+ixoZtjsmMu6fV4GBWY38Rfb2qQdubSk1w2v5Fwv qNPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697861155; x=1698465955; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+nRiGZ1gEgReuCe2orRZXOsd8Yijpp4GfMtT8YNos30=; b=UULeepMoQ0DMDOwDduJO5rGGhP9C1OO7hoMW6rZblHhqSgc3EJ4aTyymR4MXzJkydG 0NW+HItbX+wBoIGpfQJQH6gB9rzAidz+Fh//OAtFcAvj/BX3k1WUVcoI4Jhz60hK8zpN I/zXcNixWxtwL6Mtl8r8jclJ+GOwNZdAeJ13qLDlI/zaNXjllQ0mkGXslmIwRtoullzT aDZL4FL1aYf67SVZMXN/9qgs1oE6kT0bcO0nb61Hn7Z4WnNiTMQIlQdj8eE5lZc8D2GO gHF3pkC/mAvt+XeEWEMXopAbHOngkzEDemFmO/a384CZOqP8dvzwjz8tWlkrfClsvJJO 34Rw== X-Gm-Message-State: AOJu0Yz2rfxhEmkJ1nkj46RsS4tRQpYTKy7PNukUodZNNWIzxf/9MAoh SU6wXeuNkWGQteXXwKOTl8e6qBLzlgdfa2m/WSdn1QmFUnvAWOZNsuk= X-Google-Smtp-Source: AGHT+IGgp8hmjIo5jh3Hr3SGSF4U+gsmqkQsWd8lXAonZgBk8RBTV28YNOsyBcIyE7c4y3bLTZMuU2myaTMSoZv1OCw= X-Received: by 2002:a17:907:2d87:b0:9be:6410:b3c0 with SMTP id gt7-20020a1709072d8700b009be6410b3c0mr2823907ejc.33.1697861154685; Fri, 20 Oct 2023 21:05:54 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Fri, 20 Oct 2023 21:05:43 -0700 Message-ID: Subject: Re: `pwd -P` with systemd-homed causes inconsistent cwd state To: kyle@laker.email Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52237 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On Fri, Oct 20, 2023 at 8:18=E2=80=AFPM Kyle Laker wrote= : > > I have found a strange behavior with ZSH when working with > systemd-homed. After running `pwd -P` within my home directory, it seems > as if the current working directory effectively changes to `/`. I am > currently using ZSH 5.9 and systemd 254. > > systemd-homed is configured using a BTRFS subvolume. This sounds like it must be the same issue as workers/52213 which also involves doing operations on BTRFS mounts. > What is unexpected is that after running > `pwd -P` all other subprocesses act as if the `cwd` is `/` When you run `pwd -P`, zsh invokes the getcwd() system call and prints whatever it returns. That's literally all it does. So, although I don't have BTRFS to test with, this looks from here like a problem with getcwd() internally changing the process current directory to the root when crossing a BTRFS link. That would be invisible to $PWD and therefore to the pwd command (without -P). There are some cases where zsh itself would change the current directory, e.g., if the parent of the current directory is removed from the filesystem and a few other "catastrophic failure" cases, but zsh would display a warning message in those circumstances and in your example its happening silently ... another clue that whatever it is, is behind zsh's back, so to speak.