summaryrefslogtreecommitdiff
path: root/lib/libutil/pw_init.3
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libutil/pw_init.3')
-rw-r--r--lib/libutil/pw_init.320
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/libutil/pw_init.3 b/lib/libutil/pw_init.3
index 0de0b1a16c2..6d0ac205ea3 100644
--- a/lib/libutil/pw_init.3
+++ b/lib/libutil/pw_init.3
@@ -38,6 +38,8 @@
.Os
.Sh NAME
.Nm pw_init ,
+.Nm pw_setdir ,
+.Nm pw_file ,
.Nm pw_edit ,
.Nm pw_prompt ,
.Nm pw_copy ,
@@ -50,6 +52,10 @@
.Ft void
.Fn pw_init
.Ft void
+.Fn pw_setdir "const char *directory"
+.Ft char *
+.Fn pw_file "const char *filename"
+.Ft void
.Fn pw_edit "int notsetuid" "const char *filename"
.Ft void
.Fn pw_prompt
@@ -73,6 +79,20 @@ contents of the passwd database into a world-readable file), and
disabling most signals.
.Pp
The
+.Fn pw_setdir
+function sets an alternative directory where the rest of the functions looks
+for password-related files. Use this if you are writing utilities that should
+be able to handle password files outside of /etc.
+.Pp
+The
+.Fn pw_file
+function transforms filenames so that they end up in the directory specified
+to the latest
+.Fn pw_setdir
+call. The rule is that all directories are stripped off the given name and
+only the filename is appended to the directory.
+.Pp
+The
.Fn pw_edit
function runs an editor (named by the environment variable EDITOR, or
.Pa /usr/bin/vi