1docs::api::APR::Util(3)User Contributed Perl Documentatiodnocs::api::APR::Util(3)
2
3
4

NAME

6       APR::Util - Perl API for Various APR Utilities
7

Synopsis

9         use APR::Util ();
10
11         $ok = password_validate($passwd, $hash);
12

Description

14       Various APR utilities that don't fit into any other group.
15

API

17       "APR::Util" provides the following functions and/or methods:
18
19   "password_validate"
20       Validate an encrypted password hash against a plain text password (with
21       lots of restrictions and peculiarities).
22
23         $ok = password_validate($passwd, $hash);
24
25       arg1: $passwd ( string )
26           Plain text password string
27
28       arg2: $hash ( string )
29           Encrypted or encoded hash. See below for supported hash formats.
30
31       ret: $ok ( boolean )
32           The password either matches or not.
33
34       since: 2.0.00
35
36       The function handles the output of the following functions (it knows to
37       tell md5 and sha1 from the others, since they are have a special
38       pattern recognized by apr):
39
40       •   md5
41
42           generated by apr_md5_encode() (for which at the moment we have no
43           perl glue, ask if you need it).
44
45       •   sha1
46
47           generated by apr_sha1_base64() (for which at the moment we have no
48           perl glue, ask if you need it).
49
50           and it's available only since Apache 2.0.50
51
52       •   crypt
53
54           On all but the following platforms: MSWin32, beos and NetWare.
55           Therefore you probably don't want to use that feature, unless you
56           know that your code will never end up running on those listed
57           platforms.
58
59           Moreover on these three platforms if that function sees that the
60           hash is not of md5 and sha1 formats, it'll do a clear to clear text
61           matching, always returning success, no matter what the hashed value
62           is.
63
64       Warning: double check that you understand what this function does and
65       does not before using it.
66

Unsupported API

68       "APR::Socket" also provides auto-generated Perl interface for a few
69       other methods which aren't tested at the moment and therefore their API
70       is a subject to change. These methods will be finalized later as a need
71       arises. If you want to rely on any of the following methods please
72       contact the the mod_perl development mailing list so we can help each
73       other take the steps necessary to shift the method to an officially
74       supported API.
75
76   "filepath_name_get"
77       META: Autogenerated - needs to be reviewed/completed
78
79       [We have File::Spec and File::Basename for this purpose, I can't see
80       why this api is needed]
81
82       return the final element of the pathname
83
84         $ret = filepath_name_get($pathname);
85
86       arg1: $pathname ( string )
87           The path to get the final element of
88
89       ret: $ret ( string )
90