]> git.proxmox.com Git - ceph.git/blame - ceph/src/civetweb/docs/api/mg_modify_passwords_file.md
buildsys: switch source download to quincy
[ceph.git] / ceph / src / civetweb / docs / api / mg_modify_passwords_file.md
CommitLineData
11fdf7f2
TL
1# Civetweb API Reference
2
3### `mg_modify_passwords_file( passwords_file_name, domain, user, password );`
4
5### Parameters
6
7| Parameter | Type | Description |
8| :--- | :--- | :--- |
9|**`passwords_file_name`**|`const char *`|The path to the passwords file|
10|**`realm`**|`const char *`|The authentication realm (domain) of the user record|
11|**`user`**|`const char *`|Username of the record to be added, changed or deleted|
12|**`password`**|`const char *`|Password associated with the user or NULL if the record must be deleted|
13
14### Return Value
15
16| Type | Description |
17| :--- | :--- |
18|`int`|Success or error code|
19
20### Description
21
22The function `mg_modify_passwords_file()` allows an application to manipulate .htpasswd files on the fly by adding, deleting and changing user records. This is one of the several ways to implement authentication on the server side.
23
24If the password parameter is not `NULL` an entry is added to the password file. An existing records is modified in that case. If `NULL` is used as the password the enrty is removed from the file.
25
26The function returns 1 when successful and 0 if an error occurs.
27
28### See Also
29
30* [`mg_check_digest_access_authentication();`](mg_check_digest_access_authentication.md)
31* [`mg_send_digest_access_authentication_request();`](mg_send_digest_access_authentication_request.md)
32
33