History log of /freebsd-11-stable/usr.sbin/adduser/adduser.sh
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 360390 27-Apr-2020 kevans

MFC r359642: adduser: allow standard IFS characters in passwords

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


# 330449 05-Mar-2018 eadler

MFC r326276:

various: general adoption of SPDX licensing ID tags.

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.


# 302408 07-Jul-2016 gjb

Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/cddl
/freebsd-11-stable/cddl/contrib/opensolaris
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/zfs
/freebsd-11-stable/cddl/contrib/opensolaris/lib/libzfs
/freebsd-11-stable/contrib/amd
/freebsd-11-stable/contrib/apr
/freebsd-11-stable/contrib/apr-util
/freebsd-11-stable/contrib/atf
/freebsd-11-stable/contrib/binutils
/freebsd-11-stable/contrib/bmake
/freebsd-11-stable/contrib/byacc
/freebsd-11-stable/contrib/bzip2
/freebsd-11-stable/contrib/com_err
/freebsd-11-stable/contrib/compiler-rt
/freebsd-11-stable/contrib/dialog
/freebsd-11-stable/contrib/dma
/freebsd-11-stable/contrib/dtc
/freebsd-11-stable/contrib/ee
/freebsd-11-stable/contrib/elftoolchain
/freebsd-11-stable/contrib/elftoolchain/ar
/freebsd-11-stable/contrib/elftoolchain/brandelf
/freebsd-11-stable/contrib/elftoolchain/elfdump
/freebsd-11-stable/contrib/expat
/freebsd-11-stable/contrib/file
/freebsd-11-stable/contrib/gcc
/freebsd-11-stable/contrib/gcclibs/libgomp
/freebsd-11-stable/contrib/gdb
/freebsd-11-stable/contrib/gdtoa
/freebsd-11-stable/contrib/groff
/freebsd-11-stable/contrib/ipfilter
/freebsd-11-stable/contrib/ldns
/freebsd-11-stable/contrib/ldns-host
/freebsd-11-stable/contrib/less
/freebsd-11-stable/contrib/libarchive
/freebsd-11-stable/contrib/libarchive/cpio
/freebsd-11-stable/contrib/libarchive/libarchive
/freebsd-11-stable/contrib/libarchive/libarchive_fe
/freebsd-11-stable/contrib/libarchive/tar
/freebsd-11-stable/contrib/libc++
/freebsd-11-stable/contrib/libc-vis
/freebsd-11-stable/contrib/libcxxrt
/freebsd-11-stable/contrib/libexecinfo
/freebsd-11-stable/contrib/libpcap
/freebsd-11-stable/contrib/libstdc++
/freebsd-11-stable/contrib/libucl
/freebsd-11-stable/contrib/libxo
/freebsd-11-stable/contrib/llvm
/freebsd-11-stable/contrib/llvm/projects/libunwind
/freebsd-11-stable/contrib/llvm/tools/clang
/freebsd-11-stable/contrib/llvm/tools/lldb
/freebsd-11-stable/contrib/llvm/tools/llvm-dwarfdump
/freebsd-11-stable/contrib/llvm/tools/llvm-lto
/freebsd-11-stable/contrib/mdocml
/freebsd-11-stable/contrib/mtree
/freebsd-11-stable/contrib/ncurses
/freebsd-11-stable/contrib/netcat
/freebsd-11-stable/contrib/ntp
/freebsd-11-stable/contrib/nvi
/freebsd-11-stable/contrib/one-true-awk
/freebsd-11-stable/contrib/openbsm
/freebsd-11-stable/contrib/openpam
/freebsd-11-stable/contrib/openresolv
/freebsd-11-stable/contrib/pf
/freebsd-11-stable/contrib/sendmail
/freebsd-11-stable/contrib/serf
/freebsd-11-stable/contrib/sqlite3
/freebsd-11-stable/contrib/subversion
/freebsd-11-stable/contrib/tcpdump
/freebsd-11-stable/contrib/tcsh
/freebsd-11-stable/contrib/tnftp
/freebsd-11-stable/contrib/top
/freebsd-11-stable/contrib/top/install-sh
/freebsd-11-stable/contrib/tzcode/stdtime
/freebsd-11-stable/contrib/tzcode/zic
/freebsd-11-stable/contrib/tzdata
/freebsd-11-stable/contrib/unbound
/freebsd-11-stable/contrib/vis
/freebsd-11-stable/contrib/wpa
/freebsd-11-stable/contrib/xz
/freebsd-11-stable/crypto/heimdal
/freebsd-11-stable/crypto/openssh
/freebsd-11-stable/crypto/openssl
/freebsd-11-stable/gnu/lib
/freebsd-11-stable/gnu/usr.bin/binutils
/freebsd-11-stable/gnu/usr.bin/cc/cc_tools
/freebsd-11-stable/gnu/usr.bin/gdb
/freebsd-11-stable/lib/libc/locale/ascii.c
/freebsd-11-stable/sys/cddl/contrib/opensolaris
/freebsd-11-stable/sys/contrib/dev/acpica
/freebsd-11-stable/sys/contrib/ipfilter
/freebsd-11-stable/sys/contrib/libfdt
/freebsd-11-stable/sys/contrib/octeon-sdk
/freebsd-11-stable/sys/contrib/x86emu
/freebsd-11-stable/sys/contrib/xz-embedded
/freebsd-11-stable/usr.sbin/bhyve/atkbdc.h
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.c
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.h
/freebsd-11-stable/usr.sbin/bhyve/console.c
/freebsd-11-stable/usr.sbin/bhyve/console.h
/freebsd-11-stable/usr.sbin/bhyve/pci_fbuf.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.h
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.c
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.h
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.c
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.h
/freebsd-11-stable/usr.sbin/bhyve/rfb.c
/freebsd-11-stable/usr.sbin/bhyve/rfb.h
/freebsd-11-stable/usr.sbin/bhyve/sockstream.c
/freebsd-11-stable/usr.sbin/bhyve/sockstream.h
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.c
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.h
/freebsd-11-stable/usr.sbin/bhyve/usb_mouse.c
/freebsd-11-stable/usr.sbin/bhyve/vga.c
/freebsd-11-stable/usr.sbin/bhyve/vga.h
# 232146 25-Feb-2012 deischen

When using uidstart in /etc/adduser.conf, get the next
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


# 228990 30-Dec-2011 uqs

Spelling fixes for usr.sbin/


# 202312 14-Jan-2010 joel

Fix a few whitespace issues and comment typos that I found while reading
through this file.


# 175719 27-Jan-2008 mtm

Add the -M command-line option, which will set home directory permissions.
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


# 172823 19-Oct-2007 mtm

Allow adding a user(s) to additional groups in batch mode as well.

Submitted by: Eygene Ryabinkin <rea-fbsd@codelabs.ru> (modulo minor changes)
MFC after: 2 weeks


# 168656 12-Apr-2007 mtm

There are a couple of bugs in rev. 1.27:
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


# 168651 12-Apr-2007 mtm

Errm... I don't see how rev. 1.26 could have possibly worked or been tested.
Fix it for real.

Submitted by: Johnny Lee <johnny@bmtk.com>
MFC After: 2 weeks


# 167917 26-Mar-2007 le

Check if the new user already exists right after entering the
username instead of watching the final call to pw(8) fail.


# 154688 22-Jan-2006 matteo

Honour the "uuid" directive in adduser.conf

PR: conf/87914
Approved by: philip (mentor)
MFC after: 3 days


# 145618 28-Apr-2005 robert

- Act according to the documentation (man page):
When adding users from a preformatted file, do not exit
silently when empty lines or lines starting with a '#'
are encountered - ignore them instead.
- Fix a spelling error in a comment.

PR: bin/80058


# 135616 23-Sep-2004 roam

In fullpath_from_shell(), move the nologin detection before the cat | while
loop to avoid an incorrect display of the nologin path twice.

PR: 71786
Submitted by: Andrew Hayden <andrew.hayden@gmail.com>
Reviewed by: mtm
MFC after: 3 days


# 134440 28-Aug-2004 mtm

Also, match the full path to the special nologin shell.
Previously, it would recognize it as a valid shell only
if the basename (nologin) was specified. Now, it will
recognize both the basename and the full path.

NOTE: The full path as adduser(8) understands it is /usr/sbin/nologin.
There is a symlink, /sbin/nologin, but that's deprecated and
only there for backwards compatibility.


# 130160 06-Jun-2004 mtm

Accept full path names in addition to base names for shells.

Make explicit in the documentation that valid shells need to be
supplied only if the -S option is not given.


# 127635 30-Mar-2004 cperciva

Sychronize with reality: nologin(8) is now in /usr/sbin

Reminded by: trhodes


# 127076 16-Mar-2004 mtm

o Add an -S option to not attempt to ascertain the validity of a shell.
o Add a -D option to not attempt to create the home directory.
o Treat the /nonexistent home directory specially. It means the user has
no home directory and it should not be created.
o Update Copyright year and my email.


# 116784 24-Jun-2003 mtm

Typo.
This has worked so far because the variable was empty by default.

Submitted by: Kostyuk Oleg <cub@cub.org.ua>


# 116628 20-Jun-2003 mtm

s/warn/info/


# 116627 20-Jun-2003 mtm

Add support for the special shell nologin.

Prodded by: mikeh


# 116624 20-Jun-2003 mtm

Update my email address.


# 116623 20-Jun-2003 mtm

Don't forget the -r on the second password prompt.

PR: bin/53550


# 112519 23-Mar-2003 mtm

Document the -g option in the usage message.

Approved by: markm (mentor)(implicit)


# 112433 20-Mar-2003 mtm

Add a -g option to specify a default login group.

Approved by: markm (mentor)(implicit)


# 112401 19-Mar-2003 mtm

o initialize a couple of local flags so the user can re-edit groups
next time the subroutine is re-entered
o s/configrun/configflag/
o Make the prompt make sense if the user was creating a configuration file

Approved by: markm (mentor)(implicit)


# 111015 16-Feb-2003 mtm

Update copyright.


# 110595 09-Feb-2003 mtm

Revisit the shell special characters issue and settle it once-and-forall.
All characters will be accepted, and pw(8) can sort out which ones it
will allow and which ones it won't.

Approved by: markm (mentor)
Prodded by: Philippe Bourcier <philippe@cyberabuse.org>


# 110537 08-Feb-2003 adrian

Change the behaviour of adduser to match the previous incarnation a little more.

If any of the given groups do not exist complain and let the user try again.
This saves the user from discovering at the end of the process that they've
forgotten to add a group or they've typoed.

Thanks to cmc/dougb for pointing out how bad my sh fu actually is.

Original code by: me
Scary sh rewrite by: dougb

Reviewed by: dougb


# 109775 24-Jan-2003 fjoe

back out logging to /var/log/adduser
(/usr/sbin/pw already logs to /var/log/userlog)


# 109768 23-Jan-2003 mtm

In interactive mode, ask the user if he/she wants to add another
user and re-run interactive questions or quit depending on the
answer.

Submitted by: Scot Hetzel <hetzels@westbend.net>
Approved by: markm (mentor)


# 109751 23-Jan-2003 fjoe

- restore an ability to write log of added users (default to
/var/log/adduser, disabled if empty or adduserlog="no")
- do not ask for password in configure mode
- print $passwdtype instead of password in configure mode
- add DATECMD, GREPCMD (not overridable but with full path)


# 109720 22-Jan-2003 mtm

*blush*
While I'm here properly quote all the other input I neglected
to quote.

Approved by: markm (mentor)(implicit)


# 109635 21-Jan-2003 mtm

Don't forget to properly quote input.

Approved by: markm (mentor)(implicit)
Submitted by: Robin Breathe <robin@isometry.net>


# 109573 20-Jan-2003 fjoe

do not loose trailing space when asking uid


# 107543 03-Dec-2002 scottl

Replace the perl versions of adduser and rmuser with shell script versions.

Submitted by: Mike Makonnen <mtm@identd.net>
Approved by: re