From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from forward500a.mail.yandex.net (forward500a.mail.yandex.net [178.154.239.80]) by sourceware.org (Postfix) with ESMTPS id 8BF433858D28 for ; Tue, 11 Apr 2023 22:20:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8BF433858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=yandex.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=yandex.ru Received: from mail-nwsmtp-smtp-production-main-81.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-81.vla.yp-c.yandex.net [IPv6:2a02:6b8:c1d:63cd:0:640:4ab5:0]) by forward500a.mail.yandex.net (Yandex) with ESMTP id 622535E8A3; Wed, 12 Apr 2023 01:20:00 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-81.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id xJetRR3DZa60-xCmqMWHf; Wed, 12 Apr 2023 01:20:00 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1681251600; bh=KAbyBhsGSMfhj50w2sgSMD+vRVHxBJqqazO/SFkmNJI=; h=In-Reply-To:Subject:Date:References:To:Message-ID:Reply-To:From; b=vCzEJPv9YiyyXep7/H+/U2Hb0JddlLMTbF6nGIkAXJekRB8EBECP0hXtcU2qWOEhK Yh4qBNBIdkvR424Os+0sPwP2CAaUl/m2+vof3arpt/R6zwSGalzaGI2cin1qQNduCS t/Iu2LhfYe7i+WjFPI1YpVEVMQj5va8ZxE9wXatQ= Authentication-Results: mail-nwsmtp-smtp-production-main-81.vla.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Tue, 11 Apr 2023 22:16:25 -0000 Date: Wed, 12 Apr 2023 01:16:25 +0300 From: Andrey Repin X-Mailer: The Bat! (v9.3.4) Professional Reply-To: cygwin@cygwin.com Message-ID: <1948929705.20230412011625@yandex.ru> To: Thomas Schweikle , cygwin@cygwin.com Subject: Re: Changing user home to overlap Windows user home possible? Or a bad idea? In-Reply-To: <35f76e45-b209-0329-a497-2d53242dd854@bfs.de> References: <5eae9f1f-9d58-d8a1-cf43-e6eeb77c7e1b@bfs.de> <174205789.20230408113047@yandex.ru> <35f76e45-b209-0329-a497-2d53242dd854@bfs.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_THEBAT,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Greetings, Thomas Schweikle! > Am Sa., 08.Apr..2023 um 10:30:47 schrieb Andrey Repin: >> Greetings, Thomas Schweikle! >> >> Is it possible to have the same home for Windows and cygwin? >> > See /etc/nsswitch.conf and https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nsswitch >> >> Using "C:\Users\" for Cygwin home setting mount points for users? >> > I don't get this question. Can you please rephrase? > I've tried to set > C:/Users /home ntfs binary,posix=0,nouser 0 0 +,noacl > Then have "C:/Users/..." and "/home/..." the same. That's an option, but not without side-effects. > Did not work this way. Starting some shell got cygwin exhaust "Could not > create "/home/" -- true: the directory was there already, but cygwin > did not notice. Can't tell why. I could switch to /home/, while cygwin > couldn't setting $HOME to /tmp. I had success with > mklink /D C:\cygwin\home C:\Users > and then setting /etc/nsswitch.conf to > db_home: /home/%U > this did the trick: cygwin starting a shell works now as expected. > One last problem: the owner of the files was not the one expected. Could > change him to the expected one using windows tools. But then Cygwin tools would complain. > The remaining problems are all git related: git seems to have problems > creating symlinks for clones. Maybe this is just a case enabling privileges > via GPO for users needing them. I suggest you do NOT use symlinks with git. The very idea is unstable and error prone. Other than that, it depends, which sources and which symlinks you are using. > Looks like some sources fail to compile if symlinks are not available. >>> Or is this a bad idea? Or is it something which has some drawbacks you've >>> to decide to live with? At the moment the most ugly drawback is duplication >>> of various data needed within "C:\cygwin\home\" and "C:\Users\". >>> Would be nice if I could overlay both. >> There's some caveats to using %USERPROFILE% as $HOME, most notable, you have >> to be careful with overly sensitive programs, like SSH or GPG. Other than >> that, the noacl flag on the cygdrive mount will cover you for the time being. >> I.e.: > This was why I tried to mount C:\Users to /home, having two identical > directories making ssh, gpg and others happy. No. That will NOT make gpg and ssh happy. Quite the opposite, using noacl mount as default home, ssh and gpg will complain about incorrect permissions on their configuration directories. Or, if you do not mount users root with noacl, Cygwin will attempt to treat profile as POSIX directory, potentially wreaking havoc on files and directories for Windows programs not expecting such surprise. What I did, I made a symlink to /home/$user/.{gnupg,ssh} in my profile directory. Thus the permissions on the respective directories are matching the POSIX standard, but parent directory (profile) permissions do not affect them. >>>> none /cygdrive cygdrive noacl,binary,nouser,posix=0 0 0 >> And usertemp idea is also a good one: >>>> none /tmp usertemp binary,nouser,posix=0 0 0 > This was helpful. It is a little bit problematic switching users, but it is > lots better than having a global /tmp for all users. -- With best regards, Andrey Repin Wednesday, April 12, 2023 00:59:45 Sorry for my terrible english...