]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/third_party/prometheus-cpp/3rdparty/civetweb/docs/api/mg_modify_passwords_file_ha1.md
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / third_party / prometheus-cpp / 3rdparty / civetweb / docs / api / mg_modify_passwords_file_ha1.md
1 # Civetweb API Reference
2
3 ### `mg_modify_passwords_file_ha1( passwords_file_name, domain, user, ha1 );`
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 |**`ha1`**|`const char *`|HA1 hash of "user:realm:password"|
13
14 ### Return Value
15
16 | Type | Description |
17 | :--- | :--- |
18 |`int`|Success or error code|
19
20 ### Description
21
22 The function `mg_modify_passwords_file_ha1()` is similar to `mg_modify_passwords_file()`, but the password is not specified in plain text and thus is not revealed to the civetweb library. Instead of the password, a hash ("HA1") is specified which is constructed by the caller as the MD5 checksum (in lower-case hex digits) of the string `user:realm:password`.
23
24 For example, if the user name is `myuser`, the realm is `myrealm`, and the password is `secret`, then the HA1 is `e67fd3248b58975c3e89ff18ecb75e2f`:
25
26 ```
27 $ echo -n "myuser:myrealm:secret" | md5sum
28 e67fd3248b58975c3e89ff18ecb75e2f -
29 ```
30
31 The function returns 1 when successful and 0 if an error occurs.
32
33 ### See Also
34
35 * [`mg_modify_passwords_file();`](mg_modify_passwords_file.md)
36
37