[Packaging]: Use system-defined location for home directories#62507
[Packaging]: Use system-defined location for home directories#62507
Conversation
This patch removes the assumption that user home directories always live under /home. If the user has set home directories to live under a different directory by changing /etc/adduser.conf, this will honor that setting. Signed-off-by: Shawn Edwards <shedwards@nvidia.com>
|
Can one of the admins verify this patch? |
|
Tilde expansion is a POSIX feature, so any POSIX compliant shell, including Borne shell, does tilde expansion.
-Shawn
________________________________
From: Dan Mick ***@***.***>
Sent: Wednesday, March 26, 2025 8:37:41 PM
To: ceph/ceph ***@***.***>
Cc: Shawn Edwards ***@***.***>; Author ***@***.***>
Subject: Re: [ceph/ceph] [Packaging]: Use system-defined location for home directories (PR #62507)
@dmick commented on this pull request.
________________________________
In debian/cephadm.postinst<#62507 (comment)>:
@@ -42,15 +41,15 @@ case "$1" in
fi
# set up (initially empty) .ssh/authorized_keys file
- if ! test -d /home/cephadm/.ssh; then
- mkdir /home/cephadm/.ssh
- chown --reference /home/cephadm /home/cephadm/.ssh
- chmod 0700 /home/cephadm/.ssh
+ if ! test -d ~cephadm/.ssh; then
This is a /bin/sh script; is ~username interpolated in /bin/sh? (yes, on at least Ubuntu, /bin/sh is really dash which does, but I worry about how reliable this is. I don't think "real" Bourne shell does tilde interpolation.
—
Reply to this email directly, view it on GitHub<#62507 (review)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AKB6NJAU4WKLVPPKBL7AGTL2WNI6LAVCNFSM6AAAAABZYQ7AF2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDOMJZGEYDQNRZGM>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
|
It seems that the answer is that "true Bourne shell" just doesn't exist on many (any?) Linux distros; /bin/sh is usually a symlink to either dash or bash, which are both Posix-compliant and support tilde expansion. |
|
True 'Bourne Shell' hasn't been maintained for some time. The license is hilariously discussed here: https://en.wikipedia.org/wiki/Talk:Bourne_shell#License (BYO flame-retardant undies) The closest thing I can find to an 'original' Bourne shell is from Schily's tools. One can build a non-POSIX compliant shell (obosh) if one wants to. I know of no distribution or POSIX OS which would inflict this on their users. |
|
I'm sorry to have let this sit for a while. One thing that concerns me is how many different places in the Ceph codebase we might have that are assuming /home; a quick grep finds an obvious one that should be included in this PR, in doc/cephadm/install.rst, but somewhat-surprisingly, not a lot else in src. So this is probably OK if you'll add an update to doc/. |
Signed-off-by: Shawn Edwards <42198692+NVShawn@users.noreply.github.com>
|
Please let me know if there is anything further you need from me on this pull request. Thanks! |
|
@NVShawn this pr seems to be causing package installation errors against ubuntu 24.04, tracked in https://tracker.ceph.com/issues/72083. there,
from https://manpages.ubuntu.com/manpages/noble/man8/adduser.8.html:
can you help me find a better solution than #64459 which just adds back |
|
Use |
This patch removes the assumption that user home directories always live under /home. If the user has set home directories to live under a different directory by changing /etc/adduser.conf, this will honor that setting.
Signed-off-by: Shawn Edwards shedwards@nvidia.com