From owner-freebsd-arm@freebsd.org Wed Jul 20 19:56:53 2016 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEA79B9EDF5 for ; Wed, 20 Jul 2016 19:56:53 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 9311F1202; Wed, 20 Jul 2016 19:56:53 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id 50603177D; Wed, 20 Jul 2016 19:56:53 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Wed, 20 Jul 2016 19:56:52 +0000 From: Glen Barber To: Russell Haley Cc: freebsd-arm Subject: Re: FreeBSD user home directory Message-ID: <20160720195652.GE65494@FreeBSD.org> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Y46ssxGX9/CNNfN6" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2016 19:56:53 -0000 --Y46ssxGX9/CNNfN6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 20, 2016 at 01:45:47PM -0600, Russell Haley wrote: > Hi guys, >=20 > Note: auto-correct on this computer is setting freebsd to FreeBSD. > Please assume lowercase where appropriate if I don't catch them all. >=20 > I've decided to be lazy and just use the default freebsd user with the > stuff I'm doing right now. I have two separate instances running: > 10.2 in a Digital Ocean instance and arm 11-ALPHA-6 on my > Hummingboard. >=20 > The home directory for the FreeBSD user on the 10.2 cloud instance is > in the expected location of /usr/home/freebsd. >=20 > freebsd@do:~ % pwd > /usr/home/freebsd >=20 > However, the arm build puts the freebsd home directory is under /home/fre= ebsd >=20 > freebsd@imx6:~ % pwd > /home/freebsd >=20 > Thanks to a previous conversation with Mikael I have found that the > script /usr/src/release/tools/arm.subr calls function > arm_create_user() which places the user under /home (like debian). > Can someone indicate if this is a mistake (which I think it is) or on > purpose. > From http://svnweb.freebsd.org/base/stable/11/release/tools/arm.subr?vi= ew=3Dmarkup: >=20 No, this was not a mistake. This is from the pw(8) manual: -d dir This option sets the account's home directory. Normally, this is only used if the home directory is to be different from the default determined from /etc/pw.conf - normally /home with the account name as a subdirectory. =20 It's a matter of preference. Some installs will create /home as a symlink to /usr/home, some with /usr/home as a symlink to /home. > 79 arm_create_user() { > 80 # Create a default user account 'freebsd' with the password 'freebsd', > 81 # and set the default password for the 'root' user to 'root'. > 82 chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \ > 83 groupadd freebsd -g 1001 > 84 chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/home/freebsd > 85 chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \ > 86 useradd freebsd \ > 87 -m -M 0755 -w yes -n freebsd -u 1001 -g 1001 -G 0 \ > 88 -c 'FreeBSD User' -d '/home/freebsd' -s '/bin/csh' > 89 chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \ > 90 usermod root -w yes > 91 > 92 return 0 > 93} >=20 > Incidentally, I tried to look up the "correct location" by using man > hier and neither instance indicates that a home folder even exists! I > also believe this to be an oversight. Again, if it is, please let me > know and I will attempt to create the correct problem report and > hopefully at some point some patches (i'm not in my usual environment > so doing stuff with src isn't convenient right now). >=20 With the manual page quote above, I don't think there is any "wrong" behavior here. On your DigitalOcean machine, does /home exist? If so, I suspect it is a symlink. Glen --Y46ssxGX9/CNNfN6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXj9eEAAoJEAMUWKVHj+KTVUsP/iujf9f/9pfayBLThh7ujl2G 1UjuTOIS3aiu4pzvJL7hCLq2dHfa0gJh81FnYBYFVm2Nzlow4qhh8he0IjRH1OTR 6VAV5cjqLprG4RbEAXBeSH+7tOY/vPIohWtzAAjwZhNlq+4K/eR8Yvgq/bC74xbS Lh1G+sYqk99Hx7FRs7GymEhRr0756U1hcmtreb5GR7a58R4FdXwiyise4LsavDF6 SA6vzawIp0GgAVM3XwqE7Z+j13cW71iGKQA36Xc9gC61MEL52r3G/fK7P9x+A90A Wd3P/RLuInU7SoB5PDnvtkNgHdP87YyYYIoqTncPehEaUf5RFJ/a6wqzR1HazbXU s7njypIYL315YBDoG7/tOU6fBJkrp9+CV8aBKDNhaezdT8DF2Nt1rgN3zQi3ZQN6 Yc1I8i6W4rX1JadRW2MWI3P2OWyGBFoRnPMrF2OvoLvBUhh3xEZoMERRjj9SO36+ 59f9ST69Lp6xD7wNkTDgj0lq4zH1NzqJit57b0QlC4q1/D553DMiicKvBYjTj0Dy QYKzVmCF/ylOqbd1GGwDz0ZUxmSXo8oXLNrXUoI4gm1jBvB9l0llWoA307Oxiqlr csSeATO0+dtK3HWKUrmLXVrruApvrF764rOMnEAPouimQekfofvNf/UAhcWazDui BnPk1mX1+l+r1iBF4rwu =Gjw/ -----END PGP SIGNATURE----- --Y46ssxGX9/CNNfN6--