OpenBSD CVS

CVS log for src/usr.bin/htpasswd/htpasswd.c


[BACK] Up to [local] / src / usr.bin / htpasswd

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.18 / (download) - annotate - [select for diffs], Mon Jul 12 15:09:19 2021 UTC (2 years, 10 months ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, HEAD
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (colored)

Change the error reporting pattern throughout the tree when unveil
fails to report the path that the failure occured on. Suggested by
deraadt@ after some tech discussion.

Work done and verified by Ashton Fagg <ashton@fagg.id.au>

ok deraadt@ semarie@ claudio@

Revision 1.17 / (download) - annotate - [select for diffs], Wed Oct 31 07:39:10 2018 UTC (5 years, 6 months ago) by mestre
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.16: +10 -4 lines
Diff to previous 1.16 (colored)

htpasswd(1) when in batch mode (-I) and 1 argument is used, or when not in
batch mode and 2 arguments are used we know we have to access argv[0] with rwc
permissions and also to rwc a temporary file in /tmp so we can unveil(2) both
argv[0] and /tmp with rwc permissions. In order to avoid adding "unveil" to
pledge(2), just call it after getopt(3).

Remaining code paths already have fs access disabled via pledge(2).

OK florian@ deraadt@

Revision 1.16 / (download) - annotate - [select for diffs], Wed Jun 7 09:11:52 2017 UTC (6 years, 11 months ago) by awolk
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.15: +4 -6 lines
Diff to previous 1.15 (colored)

htpasswd: use crypt_newhash instead of the bcrypt API

man bcrypt states:
     These functions are deprecated in favor of crypt_checkpass(3) and
     crypt_newhash(3).

hence with this change we move htpasswd to the new API, while here
also change the rounds from a hardcoded 8 to automatic selection based
on system performance.

OK florian@

Revision 1.15 / (download) - annotate - [select for diffs], Thu Nov 5 20:07:15 2015 UTC (8 years, 6 months ago) by florian
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.14: +6 -1 lines
Diff to previous 1.14 (colored)

Make our initial pledge stricter once we figured out in which mode we
are running.
In batch mode we are only reading from stdin and writing to stdout.
If no file is specified we are reading from stdin, writing to stdout
and need to control the tty for readpassphrase.
OK deraadt@ on an earlier version some time ago.

Revision 1.14 / (download) - annotate - [select for diffs], Fri Oct 16 13:37:44 2015 UTC (8 years, 7 months ago) by millert
Branch: MAIN
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

Implement real "flock" request and add it to userland programs that
use pledge and file locking.  OK deraadt@

Revision 1.13 / (download) - annotate - [select for diffs], Fri Oct 9 01:37:07 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored)

Change all tame callers to namechange to pledge(2).

Revision 1.12 / (download) - annotate - [select for diffs], Wed Oct 7 06:44:01 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.11: +10 -15 lines
Diff to previous 1.11 (colored)

tame "stdio rpath wpath cpath tmppath tty".  "tty" is the important part
here, permitting use of readpassphrase()

Revision 1.11 / (download) - annotate - [select for diffs], Sun Feb 8 23:40:34 2015 UTC (9 years, 3 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

in getopt() blocks, stop incrementing flag variable which are supposed
to just be 0/1
ok miod florian

Revision 1.10 / (download) - annotate - [select for diffs], Mon Mar 24 20:33:01 2014 UTC (10 years, 1 month ago) by florian
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.9: +4 -4 lines
Diff to previous 1.9 (colored)

sf@ pointed out that the -B flag is already in use by apache's
htpasswd (since version 2.4); change it to -I. The -B flag was not in
use for a long time so this change should not cause too much trouble.
OK sf@, jmc@
no objections from sthen@
"kein problem damit" benno@

Revision 1.9 / (download) - annotate - [select for diffs], Thu Mar 20 15:04:35 2014 UTC (10 years, 2 months ago) by florian
Branch: MAIN
Changes since 1.8: +16 -15 lines
Diff to previous 1.8 (colored)

Various fixes from Tiago Cunha tcunha _AT_ gmx _DOT_ com:
- const for file and tok
- remove \n from err(3)
- typo in error message
- s/err/errx/ for functions that do not set errno
- s/fprintf(stderr,...)/warnx/

Thanks!

OK sthen, benno

Revision 1.8 / (download) - annotate - [select for diffs], Wed Mar 19 14:56:44 2014 UTC (10 years, 2 months ago) by florian
Branch: MAIN
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

missing -B in second usage line
pointed out by jmc@, thanks!

Revision 1.7 / (download) - annotate - [select for diffs], Tue Mar 18 17:47:04 2014 UTC (10 years, 2 months ago) by florian
Branch: MAIN
Changes since 1.6: +69 -28 lines
Diff to previous 1.6 (colored)

Batch mode; read exactly one line "login:unencrypted-password" from
stdin.
OK benno
man page tweak and OK sthen

Revision 1.6 / (download) - annotate - [select for diffs], Mon Mar 17 22:39:19 2014 UTC (10 years, 2 months ago) by florian
Branch: MAIN
Changes since 1.5: +13 -4 lines
Diff to previous 1.5 (colored)

Stop nagging after 5 non-bcrypt hashes
OK benno

Revision 1.5 / (download) - annotate - [select for diffs], Mon Mar 17 22:37:53 2014 UTC (10 years, 2 months ago) by florian
Branch: MAIN
Changes since 1.4: +6 -2 lines
Diff to previous 1.4 (colored)

flock password file
OK benno

Revision 1.4 / (download) - annotate - [select for diffs], Mon Mar 17 21:25:09 2014 UTC (10 years, 2 months ago) by benno
Branch: MAIN
Changes since 1.3: +5 -4 lines
Diff to previous 1.3 (colored)

move ftruncate down, lessen the chance that the file it might be left
empty. while there, fix an error msg.
ok florian

Revision 1.3 / (download) - annotate - [select for diffs], Mon Mar 17 13:54:58 2014 UTC (10 years, 2 months ago) by florian
Branch: MAIN
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

No need for \t in usage(), pointed out by sthen and should have been
in the initial commit. Sorry about that.

Revision 1.2 / (download) - annotate - [select for diffs], Mon Mar 17 12:51:58 2014 UTC (10 years, 2 months ago) by florian
Branch: MAIN
Changes since 1.1: +6 -5 lines
Diff to previous 1.1 (colored)

The correct idiom is of course the umask song and dance. Brain-fart by
me.
pointed out by deraadt
OK benno

Revision 1.1 / (download) - annotate - [select for diffs], Mon Mar 17 12:49:13 2014 UTC (10 years, 2 months ago) by florian
Branch: MAIN

Re-implement htpasswd from scratch. There is so much bad advice on the
internet that it's better to have a known tool in base.
Intentionally not switch compatible with the old htpasswd. The only
switch really needed would be for batch mode, but that was inherently
insecure in the old htpasswd. Batch mode will be coming shortly.
OK sthen, tedu, benno

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.