aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/adduser
Commit message (Collapse)AuthorAgeFilesLines
* adduser: Normalize supplemental groupsDag-Erling Smørgrav2026-06-251-2/+2
| | | | | | | | Rather than insist on a space-separated list, normalize the input so that any number of spaces, commas, colons, or semicolons are accepted. Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D57774
* adduser.sh: Add info which separator to use in the question itselfBenedict Reuschling2026-06-231-2/+2
| | | | | | | | | | | | | | | | During the non-root user setup (adduser.sh), people are often confused what the separator is when they are asked which groups to join the new user into. For example, wheel and operator: users often assume that the two groups are separated by a comma (and maybe even a space after it), but the script will check for that and refuses such entries. Help the users by mentioning that the groups need to be space separated in the question itself. That way, it does not take up extra space and avoids confusion about what the separator is. Reviewed by: jrm Event: Halifax Hackathon 202626 Differential Revision: https://reviews.freebsd.org/D57768
* groups.7: New manual page of standard group namesArtem Bunichev2026-04-281-1/+2
| | | | | | | | | | | | | | Import groups(7) from NetBSD, with tweaks for our system. The group list is sorted by GID. All the group names from /usr/src/etc/group are described, except "uucp". The FILES section was added on top of the original manual page. PR: 264966 Relnotes: yes MFC after: 3 days Obtained from: NetBSD Reviewed by: des, ziaee Differential Revision: https://reviews.freebsd.org/D54114
* Bourne shell -> POSIX shellAlexander Ziaee2026-04-141-1/+1
| | | | | | | | | | | | | | | The FreeBSD shell is a POSIX compatible shell. It evolved over several decades from the Almquist shell, which was preceeded a decade before that by the Bourne shell. Most readers today have never seen a Bourne shell. If someone wants to learn to use our shell, they need to look for tutorials on the POSIX shell. Align descriptions through out the tree with this reality, consistent with it's manual and common parlance. We made a similar change to the doc tree in b4d6eb01540fe. MFC after: 3 days Reviewed by: carlavilla Differential Revision: https://reviews.freebsd.org/D56382
* rmuser.sh: Improve prompt consistency with adduserAlexander Ziaee2025-09-111-3/+3
| | | | | | | | | | | While here, improve userlist error message. PR: 289399 MFC after: 3 days Reviewed by: kbowling, rgrimes Approved by: kbowling, rgrimes (src) Reported by: michaeldexter, rgrimes Differential Revision: https://reviews.freebsd.org/D52464
* pw: set the user's home directory mode if it existedKyle Evans2024-12-011-2/+4
| | | | | | | | | | | | | The adduser(8) prompt allows one to set the mode of a new home directory, but pw(8) doesn't honor the -M mode if the home directory already exists at creation time. It doesn't seem to make sense to ignore the mode (which may lead to a security issue on the system being configured) when we'll happily chown an existing directory, so fix the inconsistency. PR: 280099 Reviewed by: des, jlduran (previous version) Differential Revision: https://reviews.freebsd.org/D46443
* adduser.8: update log location + spdxAlexander Ziaee2024-09-061-1/+4
| | | | | | | | | | Closes: 280538 Fixes: cf8a18 (back out logging to /var/log/adduser) MFC after: 3 days Reported by: Herbert Baerschneider <herbert.baerschneider@protonmail.com> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1354
* adduser: Better document ZFS dataset creation.Dag-Erling Smørgrav2024-08-191-3/+7
| | | | | | | MFC after: 3 days PR: 280873 Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D46316
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* adduser: create dataset only if home is directly within datasetMike Karels2024-05-201-1/+8
| | | | | | | | | | | | | Currently, if the prefix of the new home directory is a subdirectory of a ZFS dataset, adduser will create a new dataset up one or more levels from the intended destination. "pw useradd" will then create a normal directory in the desired location, leaving an unused dataset. Check for this situation when determining whether to create a dataset, and let pw create the directory. Reviewed by: des Differential Revision: https://reviews.freebsd.org/D45229 MFC after: 3 days
* adduser: Additional variable fixes.Dag-Erling Smørgrav2024-05-151-20/+21
| | | | | | | | | | | One function used `_input` without making it local, causing its value to leak into other functions. This broke the `-f` case. Fix that instance and initialize all local variables that weren't already initialized. Fixes: 170d0882903e MFC after: 3 days Reviewed by: karels Differential Revision: https://reviews.freebsd.org/D45204
* adduser: Fix confusion between `uclass` and `_class`.Dag-Erling Smørgrav2024-05-061-3/+3
| | | | | | | | | | | | | This caused adduser to produce an invalid `pw(8)` command line. Due to bugs in `pw(8)`, the command line was silently accepted and led to the user being created, but locked out and with no home directory. Also fix the default value for the “Another user?” prompt. Fixes: 170d0882903e MFC after: 3 days Reviewed by: karels, allanjude Differential Revision: https://reviews.freebsd.org/D45098
* adduser: Really fix a syntax errorDag-Erling Smørgrav2024-04-291-1/+2
| | | | | Fixes: 5cafc38f1129 Differential Revision: https://reviews.freebsd.org/D44871
* adduser: Fix a syntax errorJoseph Mingrone2024-04-221-2/+1
| | | | | | | | Reported by: Jose Luis Duran <jlduran@gmail.com> Fixes: b37333899bd2 MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D44871
* adduser: A few more improvements.Dag-Erling Smørgrav2024-04-201-13/+11
| | | | | | MFC after: 1 week Reviewed by: jrm Differential Revision: https://reviews.freebsd.org/D44871
* adduser: Overhaul.Dag-Erling Smørgrav2024-04-191-132/+93
| | | | | | | | | | | | | Most importantly: * Make local variables local. * Use `$()` instead of backticks. * Avoid unsafe use of `-a` and `-o` operators in `test` expressions. * Remove a hack intended to ease the transition from Perl 22 years ago. MFC after: 1 week Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D44863
* adduser(8): support creation of ZFS datasetJohn Grafton2024-04-113-14/+159
| | | | | | | | | | | | | | | | | On systems utilizing ZFS, default to creating a ZFS dataset for a new user's home directory if the parent directory resides on a ZFS dataset. Add a flag that disables this behavior if the administrator explicitly does not want it. If run during installation from within a chroot, set mountpoint to legacy after dataset creation and mount directly into the chroot. Then umount and reset the mountpoint to inherit from parent. Also support ZFS default encryption on user's home directory. Feedback by: delphij Reviewed by: imp, kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/881
* Remove $FreeBSD$: two-line nroff patternWarner Losh2023-08-163-6/+0
| | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-164-4/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* add defaults for adduser.sh (OK? [yes] & additional user [no])Sven Ruediger2023-07-181-3/+11
| | | | | Event: Kitchener-Waterloo Hackathon 202305 Differential Revision: https://reviews.freebsd.org/D40157
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-122-2/+2
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* adduser: allow standard IFS characters in passwordsKyle Evans2020-04-051-2/+2
| | | | | | | | | | | | | | | | | | Notably, the default IFS contains space/tab, thus any leading/trailing whitespace characters tend to be removed. Set IFS= for just the read lines to mitigate this, allowing the user to be less surprised when their leading/trailing spaces weren't actually captured in the password as they are with other means of setting a user's password. PR: 245342 Submitted by: dereks_lifeofadishwasher.com Reviewed by: jilles MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24292 Notes: svn path=/head/; revision=359642
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-272-0/+4
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* Remove 'adding_user.7'Eitan Adler2017-11-011-1/+0
| | | | | | | | | | Not to be confused with adduser. Not to be confused with useful information. Differential Revision: https://reviews.freebsd.org/D12848 Notes: svn path=/head/; revision=325257
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge head from 7/28Simon J. Gerraty2014-08-192-3/+3
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=270164
| * Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * Sync from headSimon J. Gerraty2012-11-042-5/+4
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=242545
| * | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+14
| | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | use .Mt to mark up email addresses consistently (part2)Baptiste Daroussin2014-06-202-3/+3
| |/ |/| | | | | | | | | | | | | PR: 191174 Submitted by: Franco Fichtner <franco@lastsummer.de> Notes: svn path=/head/; revision=267668
* | Remove a reference to CVS and to freefall from a user-facing man page.Isabell Long2012-09-151-4/+3
| | | | | | | | | | | | | | | | | | | | PR: docs/171658 Reported by: Chris Petrik (c dot petrik dot sosa at gmail dot com) Approved by: gabor (mentor) MFC after: 5 days Notes: svn path=/head/; revision=240530
* | mdoc: add missing width argument to Bl -tag.Joel Dahl2012-06-031-1/+1
|/ | | | Notes: svn path=/head/; revision=236500
* Remove trailing whitespace per mdoc lint warningEitan Adler2012-03-291-1/+1
| | | | | | | | | | Disussed with: gavin No objection from: doc Approved by: joel MFC after: 3 days Notes: svn path=/head/; revision=233648
* When using uidstart in /etc/adduser.conf, get the nextDaniel Eischen2012-02-251-0/+1
| | | | | | | | | | | available user id and show it in the "Uid [xxx]" prompt. PR: 163863 Submitted by: Moritz Wilhelmy (mw at wzff dot de) MFC after: 2 weeks Notes: svn path=/head/; revision=232146
* Spelling fixes for usr.sbin/Ulrich Spörlein2011-12-301-2/+2
| | | | Notes: svn path=/head/; revision=228990
* mdoc: move CAVEATS, BUGS and SECURITY CONSIDERATIONS sections to theUlrich Spörlein2010-05-131-3/+3
| | | | | | | | | | | | | | bottom of the manpages and order them consistently. GNU groff doesn't care about the ordering, and doesn't even mention CAVEATS and SECURITY CONSIDERATIONS as common sections and where to put them. Found by: mdocml lint run Reviewed by: ru Notes: svn path=/head/; revision=208027
* Fix a few whitespace issues and comment typos that I found while readingJoel Dahl2010-01-141-11/+9
| | | | | | | through this file. Notes: svn path=/head/; revision=202312
* The original adduser/rmuser scripts in Perl used to modify the PATHJohn Baldwin2008-07-301-2/+3
| | | | | | | | | | | | | | setting. When the scripts were converted to Bourne shell, this was removed. The adduser script was changed to use an explicit path for the pw(8) command so that /usr/sbin did not have to be in the user's PATH. The rmuser script continued to assume that /usr/sbin was in the user's path, however. This fixes the rmuser script to use an explicit path for pw(8) similar to adduser. MFC after: 2 weeks Notes: svn path=/head/; revision=181006
* In the description of the password field, -w was meant, not theChristian Brueffer2008-03-161-2/+2
| | | | | | | | | | | nonexistant -p flag. PR: 120122 Submitted by: Andy Kosela <andy.kosela@gmail.com> MFC after: 3 days Notes: svn path=/head/; revision=177280
* Add the -M command-line option, which will set home directory permissions.Mike Makonnen2008-01-272-1/+44
| | | | | | | | | | | Works both in interactive or batch mode. This is a heavily modified version of the patch submitted in the PR. PR: bin/105060 MFC after: 1 week Notes: svn path=/head/; revision=175719
* Allow adding a user(s) to additional groups in batch mode as well.Mike Makonnen2007-10-202-1/+2
| | | | | | | | Submitted by: Eygene Ryabinkin <rea-fbsd@codelabs.ru> (modulo minor changes) MFC after: 2 weeks Notes: svn path=/head/; revision=172823
* The POP daemon's temporary mail file has a leading dot ('.'). This wasMike Makonnen2007-10-191-3/+3
| | | | | | | | | lost in the shell script rewrite of the rmuser command. Submitted by: Ian Smith <smithi@nimnet.asn.au> Notes: svn path=/head/; revision=172791
* Bump .Dd for r1.5; fix grammatical problem.Ceri Davies2007-04-121-2/+2
| | | | Notes: svn path=/head/; revision=168659
* Specify the correct way to modify this file, and warn that theMike Makonnen2007-04-121-1/+18
| | | | | | | | | | user should not depend on the internal variables documented in this man page. MFC After: 2 weeks Notes: svn path=/head/; revision=168658
* There are a couple of bugs in rev. 1.27:Mike Makonnen2007-04-121-7/+2
| | | | | | | | | | | | | | | | | | | | | | 1) The man page should describe the code, not the other way around. 2) Internal variables should not be documented or exposed, except in controlled circumstances (i.e. - That's what the -C flag is for). The variable should have been saved to the config file in save_config(). 3) The next available userid doesn't get automatically updated. The end-result is the same (user gets added with the correct uid), but in an interactive session the default uid doesn't get updated in the display. So, o Use the uidstart variable instead of uuid (bug #3) o Actually save the variable to adduser.conf (bug #2) o (bug #1 to be fixed in an upcomming commit to adduser.conf.5) MFC After: 2 weeks Notes: svn path=/head/; revision=168656
* Errm... I don't see how rev. 1.26 could have possibly worked or been tested.Mike Makonnen2007-04-121-12/+13
| | | | | | | | | | Fix it for real. Submitted by: Johnny Lee <johnny@bmtk.com> MFC After: 2 weeks Notes: svn path=/head/; revision=168651
* Check if the new user already exists right after entering theLukas Ertl2007-03-261-2/+8
| | | | | | | username instead of watching the final call to pw(8) fail. Notes: svn path=/head/; revision=167917
* Flush my typo fix queue for this directory.Ceri Davies2006-12-052-2/+2
| | | | Notes: svn path=/head/; revision=164926
* Fix typos.Ceri Davies2006-12-052-3/+3
| | | | Notes: svn path=/head/; revision=164925