summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pwd_mkdb
Commit message (Collapse)AuthorAgeFilesLines
* Fix a few mandoc warnings.brueffer2015-08-121-1/+0
| | | | MFC after: 1 week
* When passwd or group information is changed (by pw, vipw, chpass, ...)garga2015-07-021-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | temporary file is created and then a rename() call move it to official file. This operation didn't have any check to make sure data was written to disk and if a power cycle happens system could end up with a 0 length passwd or group database. There is a pfSense bug with more infor about it: https://redmine.pfsense.org/issues/4523 The following changes were made to protect passwd and group operations: * lib/libutil/gr_util.c: - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file - After rename(), fsync() call on directory for faster result * lib/libutil/pw_util.c - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file * usr.sbin/pwd_mkdb/pwd_mkdb.c - Added O_SYNC flag on dbopen() calls - After rename(), fsync() call on directory for faster result * lib/libutil/pw_util.3 - pw_lock() returns a file descriptor to master password file on success Differential Revision: https://reviews.freebsd.org/D2978 Approved by: bapt Sponsored by: Netgate
* Add META_MODE support.sjg2015-06-131-0/+19
|\ | | | | | | | | | | | | | | | | | | | | 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
| * dirdeps.mk now sets DEP_RELDIRsjg2015-06-081-2/+0
| |
| * Updated dependenciessjg2014-05-161-1/+0
| |
| * Updated dependenciessjg2014-05-101-0/+2
| |
| * Merge headsjg2014-04-281-1/+7
| |\
| * | Updated dependenciessjg2013-03-111-0/+1
| | |
| * | Updated dependenciessjg2013-02-161-2/+0
| | |
| * | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.marcel2012-08-221-0/+20
| | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net>
* | | Whitespace changes for r283981. No actual code changes.delphij2015-06-041-88/+88
| | |
* | | In r113596, version 4 of entries have been added but pwd_mkdb havedelphij2015-06-042-8/+39
| |/ |/| | | | | | | | | | | | | | | | | | | | | been generating both new (machine independent) and legacy version entries (endianness sensitive). The base system have been using the new format for quite some time, so disable the generation by default. An interim option, -l, have been added to re-enable old behavior. The -l, -B and -L options are considered deprecated and will be removed in FreeBSD 12.0 release.
* | Add -p to the example (why isn't this the default?)des2014-02-061-1/+1
| | | | | | | | MFC after: 1 week
* | Add an example of the most common use case.des2014-02-051-1/+7
|/ | | | MFC after: 1 week
* Mark global functions and/or variables in pwd_mkdb(8) static where possible.ed2011-11-061-1/+1
| | | | This allows compilers and static analyzers to do more thorough analysis.
* Only increment the ypcnt once per data record. The old implementationgordon2011-07-061-4/+4
| | | | | | | was incrementing it twice making it impossible to iterate the table since the records were 1, 3, 5, 7 (or 2, 4, 6, 8 for the v3 records). MFC after: 10 days
* The last big commit: let usr.sbin/ use WARNS=6 by default.ed2010-01-021-1/+0
|
* Verify that the username length is smaller than MAXLOGNAME whenbrian2009-05-201-1/+5
| | | | | | | | | | | | | | | | asked to verify a passwd file (pwd_mkdb -C). Entries with oversized usernames are still permitted when building the passwd database. When entries are >= MAXLOGNAME in length, they are correctly stored in passwd, pwd.db and spwd.db but are only correctly retrieved by getpwent*() and getpwuid*(). getpwnam*() truncates to MAXLOGNAME - 1 when reading from a file (breaking at least sh, tcsh and bash) and utilities such as su(1) check, complain and fail if the passed name is >= MAXLOGNAME in length. MFC after: 3 weeks
* Correctly handle an input file without a newline on the last line (anddd2005-06-151-9/+9
| | | | | | | | | avoid the confusing error message about the line being too long). This change uses fgetln to detect the right conditions, but the fixed-width line buffer is kept because too many other places in the program make assumptions about its maximum width. Approved by: re (scottl)
* Even if variable is never used uninitialized by the semantic, reduce compilercharnier2005-05-291-0/+2
| | | | warning by giving an initial value in all cases.
* Add endianness support.ru2005-02-282-41/+47
| | | | | | | | | | | While version 4 entries are architecture-independent, we also store old (version 3) entries in native byte order. Also, the hash itself is created in a native byte order. With this change, pwd_mkdb(8) can be used to cross-build *pwd.db files for another architecture. Tested on: i386, amd64, alpha, sparc64
* Turn K&R functions into prototypes.stefanf2005-02-101-12/+6
|
* Sort sections.ru2005-01-181-17/+17
|
* Per letter dated July 22, 1999 remove 3rd clause of Berkeley derived softwareimp2004-08-072-8/+0
| | | | (with permission of addtional copyright holders where appropriate)
* Add 'i' to the getopt string.imp2004-08-051-1/+1
| | | | Noticed by: jhein
* Add support for ignoring locking failures. This is only enabled whenimp2004-07-212-4/+19
| | | | | | | | | | you've specified a directory. It is intended to be used in building custom releases over NFS where locking may be unreliable at best and there is no contention that the locking is designed to arbitrate. Other uses of this flag are discouraged. Document same in usage and man page (including the warning about unwise). Sponsored by: Timing Solutions
* Two style related changes:imp2004-07-211-5/+5
| | | | | | | (1) use strlcpy instead of strncpy since the use here of the latter was incorrect. (2) Move 'N' case into proper sorted order (sorted the same way that ls sorts its args).
* Mechanically kill hard sentence breaks.ru2004-07-021-5/+10
|
* Use __FBSDID over rcsid[]. Protect copyright[] where needed.obrien2003-05-031-4/+4
|
* When updating a single entry (i.e. when the `-u' option is given),nectar2003-04-281-13/+29
| | | | | | | | | | | | | | | do not add the "\xFF" "VERSION" key --- it should only be added once ALL entries have been updated. While I'm here, correct the logic that detects whether or not the user-ID has changed so that it works even if all entries have not yet been updated to the new format. Users missing-in-action were Reported by: tjr, Vallo Kallaste <vallo@estcard.ee>, leafy <leafy@leafy.idv.tw> Sponsored by: DARPA, Network Associates Laboratories
* Revert the definitions of _PW_KEY* to their previous values. There isnectar2003-04-181-19/+25
| | | | | | | | | | at least one consumer outside of libc and pwd_mkdb. Adjust the versioning in libc and pwd_mkdb accordingly. named was the application affected, and that fact was first Reported by: Zherdev Anatoly <tolyar@mx.ru> Sponsored by: DARPA, Network Associates Laboratories
* = Implement thread-safe versions of the getpwent(3) and getgrent(3)nectar2003-04-171-11/+124
| | | | | | | | | | | | | | | | | | | | | | family of functions using the new nsdispatch(3) core. Remove arbitrary size limits when using the thread-safe versions. = Re-implement the traditional getpwent(3)/getgrent(3) functions on top of the thread-safe versions. = Update the on-disk format of the hashed version of the passwd(5) databases to allow for versioned entries. The legacy version is `3'. (Don't ask.) = Add support for version `4' entries in the passwd(5) database. Entries in this format are identical to version 3 entries except that all integers are stored as 32-bit integers in network byte order (big endian). = pwd_mkdb is updated to generate both version 3 and version 4 entries. Sponsored by: DARPA, Network Associates Laboratories
* style.Makefile(5)obrien2003-04-041-2/+1
|
* Uniformly refer to a file system as "file system".ru2002-12-121-1/+1
| | | | Approved by: re
* The .Nm utilitycharnier2002-07-141-4/+6
|
* WARNS=4 cleanup, de-__P()alfred2002-07-112-12/+14
|
* Consistancy check: s/file system/filesystem/gtrhodes2002-05-161-1/+1
|
* When reporting that a line is too long, include the line number in thedd2002-03-091-1/+5
| | | | | | | | error message. While I'm here, add a note that the "line too long" message isn't always accurate. PR: 35395 Submitted by: andrew@ugh.net.au
* Explicitly use int32_t for on-disk records for pw_change and pw_expire,peter2001-10-271-8/+11
| | | | | | since that is what we use now and this insulates us from any time_t tweaks here. We can define a record format that uses 64 bit times if/when we need to.
* It's bad enough to capitalize the name of the executable at thedd2001-08-041-1/+1
| | | | | beginning of the sentence, but at the very least it shouldn't be done in the middle of a sentence!
* Perform a major cleanup of the usr.sbin Makefiles.obrien2001-07-201-4/+5
| | | | | These are not perfectly in agreement with each other style-wise, but they are orders of orders of magnitude more consistent style-wise than before.
* Remove whitespace at EOL.dd2001-07-151-2/+2
|
* - Backout botched attempt to introduce MANSECT feature.ru2001-03-261-0/+1
| | | | - MAN[1-9] -> MAN.
* Set the default manual section for usr.sbin/ to 8.ru2001-03-201-1/+0
|
* mdoc(7) police: use the new features of the Nm macro.ru2000-11-201-4/+4
|
* Add nsswitch support. By creating an /etc/nsswitch.conf file, you cannectar2000-09-064-215/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | configure FreeBSD so that various databases such as passwd and group can be looked up using flat files, NIS, or Hesiod. = Hesiod has been added to libc (see hesiod(3)). = A library routine for parsing nsswitch.conf and invoking callback functions as specified has been added to libc (see nsdispatch(3)). = The following C library functions have been modified to use nsdispatch: . getgrent, getgrnam, getgrgid . getpwent, getpwnam, getpwuid . getusershell . getaddrinfo . gethostbyname, gethostbyname2, gethostbyaddr . getnetbyname, getnetbyaddr . getipnodebyname, getipnodebyaddr, getnodebyname, getnodebyaddr = host.conf has been removed from src/etc. rc.network has been modified to warn that host.conf is no longer used at boot time. In addition, if there is a host.conf but no nsswitch.conf, the latter is created at boot time from the former. Obtained from: NetBSD
* Fix various unsigned vs signed errors that caused problems with uidspaul2000-03-092-11/+20
| | | | | | | and gids bigger than 16 bits. Added checks for uids and gids that are bigger than 32 bits. Approved by: jkh (partly, this fix is bigger than I first intended)
* Remove single-space hard sentence breaks. These degrade the qualitysheldonh2000-03-011-1/+2
| | | | | of the typeset output, tend to make diffs harder to read and provide bad examples for new-comers to mdoc.
* Replace the -q option to pwd_mkdb with a test for PW_SCAN_BIG_IDS insheldonh1999-12-023-12/+18
| | | | | | | | | | | the environment. This allows big ID warnings to be suppressed for vipw and chpass as well. Since the environment variable test is only performed for callers of pw_scan() that do not set pw_big_ids_warning, the test can still be overriden. Currently, chpass and pwd_mkdb are the only users of pw_scan() and neither of them overrides the environment variable test.
* Allow empty UIDs if we are processing NIS records. I am not entirelyeivind1999-11-221-2/+4
| | | | | | | | happy with how this end up and will re-visit the entire empty field problem, but this patch solves the NIS problem for now. Submitted by: Dan Nelson <dan@emsphone.com> PR: 14865,14984
OpenPOWER on IntegriCloud