Codebase list libpam-mount / e713112
Import Upstream version 0.20 Mattia Rizzolo 7 years ago
79 changed file(s) with 11133 addition(s) and 10823 deletion(s). Raw diff Collapse all Expand all
+0
-1
COPYING less more
0 Please see the files LICENSE.GPL2 and LICENSE.LGPL2 for details.
+0
-0
ChangeLog less more
(Empty file)
+12
-11
FAQ less more
33
44 A. You need to provide us the following:
55
6 * A full log of a failed session with debugging on in pam_mount.conf
6 * A full log of a failed session with debugging on in
7 pam_mount.conf.xml
78 * The version of pam_mount that you are using
89 * /etc/pam.d/* as relevant
9 * pam_mount.conf as relevant, preferably completely
10 * pam_mount.conf.xml as relevant, preferably completely
1011
1112 =======================================================================
1213
6970 Q. Why are my volumes not being unmounted when I log out?
7071
7172 A. Often this is because processes remaining after logging out are
72 holding open files in your home directory. For example, some
73 versions of gconf do this. The best way to figure out what programs
74 are guilty is to enable debugging in your pam_mount.conf, configure
75 lsof and watch for lsof's output in your logs.
73 holding open files in your home directory. For example, some versions
74 of gconf do this. The best way to figure out what programs are guilty
75 is to enable debugging in your pam_mount.conf.xml, configure lsof and
76 watch for lsof's output in your logs.
7677
7778 =======================================================================
7879
8687 export LD_ASSUME_KERNEL=2.4.1
8788 exec smbmount "$@"
8889
89 Then configure pam_mount with the following in pam_mount.conf:
90
91 smbmount /bin/mount -t smbfs_no_nptl
90 Then configure pam_mount with the following in pam_mount.conf.xml:
91
92 <smbmount>/bin/mount -t smbfs_no_nptl</smbmount>
9293
9394 =======================================================================
9495
120121 unmount them using the user option may help pam_mount to perform
121122 without root privileges:
122123
123 # /etc/security/pam_mount.conf:
124 volume user auto - /home/user.img - - - -
124 # /etc/security/pam_mount.conf.xml:
125 <volume user="xyz" path="/home/user.img" />
125126
126127 # /etc/fstab:
127128 /home/user.img /home/user ext2 user,loop,encryption=aes,keybits=256,noauto 0 0
+0
-236
INSTALL less more
0 Installation Instructions
1 *************************
2
3 Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
4 Software Foundation, Inc.
5
6 This file is free documentation; the Free Software Foundation gives
7 unlimited permission to copy, distribute and modify it.
8
9 Basic Installation
10 ==================
11
12 These are generic installation instructions.
13
14 The `configure' shell script attempts to guess correct values for
15 various system-dependent variables used during compilation. It uses
16 those values to create a `Makefile' in each directory of the package.
17 It may also create one or more `.h' files containing system-dependent
18 definitions. Finally, it creates a shell script `config.status' that
19 you can run in the future to recreate the current configuration, and a
20 file `config.log' containing compiler output (useful mainly for
21 debugging `configure').
22
23 It can also use an optional file (typically called `config.cache'
24 and enabled with `--cache-file=config.cache' or simply `-C') that saves
25 the results of its tests to speed up reconfiguring. (Caching is
26 disabled by default to prevent problems with accidental use of stale
27 cache files.)
28
29 If you need to do unusual things to compile the package, please try
30 to figure out how `configure' could check whether to do them, and mail
31 diffs or instructions to the address given in the `README' so they can
32 be considered for the next release. If you are using the cache, and at
33 some point `config.cache' contains results you don't want to keep, you
34 may remove or edit it.
35
36 The file `configure.ac' (or `configure.in') is used to create
37 `configure' by a program called `autoconf'. You only need
38 `configure.ac' if you want to change it or regenerate `configure' using
39 a newer version of `autoconf'.
40
41 The simplest way to compile this package is:
42
43 1. `cd' to the directory containing the package's source code and type
44 `./configure' to configure the package for your system. If you're
45 using `csh' on an old version of System V, you might need to type
46 `sh ./configure' instead to prevent `csh' from trying to execute
47 `configure' itself.
48
49 Running `configure' takes awhile. While running, it prints some
50 messages telling which features it is checking for.
51
52 2. Type `make' to compile the package.
53
54 3. Optionally, type `make check' to run any self-tests that come with
55 the package.
56
57 4. Type `make install' to install the programs and any data files and
58 documentation.
59
60 5. You can remove the program binaries and object files from the
61 source code directory by typing `make clean'. To also remove the
62 files that `configure' created (so you can compile the package for
63 a different kind of computer), type `make distclean'. There is
64 also a `make maintainer-clean' target, but that is intended mainly
65 for the package's developers. If you use it, you may have to get
66 all sorts of other programs in order to regenerate files that came
67 with the distribution.
68
69 Compilers and Options
70 =====================
71
72 Some systems require unusual options for compilation or linking that the
73 `configure' script does not know about. Run `./configure --help' for
74 details on some of the pertinent environment variables.
75
76 You can give `configure' initial values for configuration parameters
77 by setting variables in the command line or in the environment. Here
78 is an example:
79
80 ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
81
82 *Note Defining Variables::, for more details.
83
84 Compiling For Multiple Architectures
85 ====================================
86
87 You can compile the package for more than one kind of computer at the
88 same time, by placing the object files for each architecture in their
89 own directory. To do this, you must use a version of `make' that
90 supports the `VPATH' variable, such as GNU `make'. `cd' to the
91 directory where you want the object files and executables to go and run
92 the `configure' script. `configure' automatically checks for the
93 source code in the directory that `configure' is in and in `..'.
94
95 If you have to use a `make' that does not support the `VPATH'
96 variable, you have to compile the package for one architecture at a
97 time in the source code directory. After you have installed the
98 package for one architecture, use `make distclean' before reconfiguring
99 for another architecture.
100
101 Installation Names
102 ==================
103
104 By default, `make install' installs the package's commands under
105 `/usr/local/bin', include files under `/usr/local/include', etc. You
106 can specify an installation prefix other than `/usr/local' by giving
107 `configure' the option `--prefix=PREFIX'.
108
109 You can specify separate installation prefixes for
110 architecture-specific files and architecture-independent files. If you
111 pass the option `--exec-prefix=PREFIX' to `configure', the package uses
112 PREFIX as the prefix for installing programs and libraries.
113 Documentation and other data files still use the regular prefix.
114
115 In addition, if you use an unusual directory layout you can give
116 options like `--bindir=DIR' to specify different values for particular
117 kinds of files. Run `configure --help' for a list of the directories
118 you can set and what kinds of files go in them.
119
120 If the package supports it, you can cause programs to be installed
121 with an extra prefix or suffix on their names by giving `configure' the
122 option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
123
124 Optional Features
125 =================
126
127 Some packages pay attention to `--enable-FEATURE' options to
128 `configure', where FEATURE indicates an optional part of the package.
129 They may also pay attention to `--with-PACKAGE' options, where PACKAGE
130 is something like `gnu-as' or `x' (for the X Window System). The
131 `README' should mention any `--enable-' and `--with-' options that the
132 package recognizes.
133
134 For packages that use the X Window System, `configure' can usually
135 find the X include and library files automatically, but if it doesn't,
136 you can use the `configure' options `--x-includes=DIR' and
137 `--x-libraries=DIR' to specify their locations.
138
139 Specifying the System Type
140 ==========================
141
142 There may be some features `configure' cannot figure out automatically,
143 but needs to determine by the type of machine the package will run on.
144 Usually, assuming the package is built to be run on the _same_
145 architectures, `configure' can figure that out, but if it prints a
146 message saying it cannot guess the machine type, give it the
147 `--build=TYPE' option. TYPE can either be a short name for the system
148 type, such as `sun4', or a canonical name which has the form:
149
150 CPU-COMPANY-SYSTEM
151
152 where SYSTEM can have one of these forms:
153
154 OS KERNEL-OS
155
156 See the file `config.sub' for the possible values of each field. If
157 `config.sub' isn't included in this package, then this package doesn't
158 need to know the machine type.
159
160 If you are _building_ compiler tools for cross-compiling, you should
161 use the option `--target=TYPE' to select the type of system they will
162 produce code for.
163
164 If you want to _use_ a cross compiler, that generates code for a
165 platform different from the build platform, you should specify the
166 "host" platform (i.e., that on which the generated programs will
167 eventually be run) with `--host=TYPE'.
168
169 Sharing Defaults
170 ================
171
172 If you want to set default values for `configure' scripts to share, you
173 can create a site shell script called `config.site' that gives default
174 values for variables like `CC', `cache_file', and `prefix'.
175 `configure' looks for `PREFIX/share/config.site' if it exists, then
176 `PREFIX/etc/config.site' if it exists. Or, you can set the
177 `CONFIG_SITE' environment variable to the location of the site script.
178 A warning: not all `configure' scripts look for a site script.
179
180 Defining Variables
181 ==================
182
183 Variables not defined in a site shell script can be set in the
184 environment passed to `configure'. However, some packages may run
185 configure again during the build, and the customized values of these
186 variables may be lost. In order to avoid this problem, you should set
187 them in the `configure' command line, using `VAR=value'. For example:
188
189 ./configure CC=/usr/local2/bin/gcc
190
191 causes the specified `gcc' to be used as the C compiler (unless it is
192 overridden in the site shell script). Here is a another example:
193
194 /bin/bash ./configure CONFIG_SHELL=/bin/bash
195
196 Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
197 configuration-related scripts to be executed by `/bin/bash'.
198
199 `configure' Invocation
200 ======================
201
202 `configure' recognizes the following options to control how it operates.
203
204 `--help'
205 `-h'
206 Print a summary of the options to `configure', and exit.
207
208 `--version'
209 `-V'
210 Print the version of Autoconf used to generate the `configure'
211 script, and exit.
212
213 `--cache-file=FILE'
214 Enable the cache: use and save the results of the tests in FILE,
215 traditionally `config.cache'. FILE defaults to `/dev/null' to
216 disable caching.
217
218 `--config-cache'
219 `-C'
220 Alias for `--cache-file=config.cache'.
221
222 `--quiet'
223 `--silent'
224 `-q'
225 Do not print messages saying which checks are being made. To
226 suppress all normal output, redirect it to `/dev/null' (any error
227 messages will still be shown).
228
229 `--srcdir=DIR'
230 Look for the package's source code in directory DIR. Usually
231 `configure' can determine that directory automatically.
232
233 `configure' also accepts some other, not widely useful, options. Run
234 `configure --help' for more details.
235
00 GNU GENERAL PUBLIC LICENSE
11 Version 2, June 1991
22
3 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
4 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
3 Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
4 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
55 Everyone is permitted to copy and distribute verbatim copies
66 of this license document, but changing it is not allowed.
77
1414 General Public License applies to most of the Free Software
1515 Foundation's software and to any other program whose authors commit to
1616 using it. (Some other Free Software Foundation software is covered by
17 the GNU Library General Public License instead.) You can apply it to
17 the GNU Lesser General Public License instead.) You can apply it to
1818 your programs, too.
1919
2020 When we speak of free software, we are referring to freedom, not
5454
5555 The precise terms and conditions for copying, distribution and
5656 modification follow.
57
57
5858 GNU GENERAL PUBLIC LICENSE
5959 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
6060
109109 License. (Exception: if the Program itself is interactive but
110110 does not normally print such an announcement, your work based on
111111 the Program is not required to print an announcement.)
112
112
113113 These requirements apply to the modified work as a whole. If
114114 identifiable sections of that work are not derived from the Program,
115115 and can be reasonably considered independent and separate works in
167167 access to copy the source code from the same place counts as
168168 distribution of the source code, even though third parties are not
169169 compelled to copy the source along with the object code.
170
170
171171 4. You may not copy, modify, sublicense, or distribute the Program
172172 except as expressly provided under this License. Any attempt
173173 otherwise to copy, modify, sublicense or distribute the Program is
224224
225225 This section is intended to make thoroughly clear what is believed to
226226 be a consequence of the rest of this License.
227
227
228228 8. If the distribution and/or use of the Program is restricted in
229229 certain countries either by patents or by copyrighted interfaces, the
230230 original copyright holder who places the Program under this License
277277 POSSIBILITY OF SUCH DAMAGES.
278278
279279 END OF TERMS AND CONDITIONS
280
280
281281 How to Apply These Terms to Your New Programs
282282
283283 If you develop a new program, and you want it to be of the greatest
302302 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
303303 GNU General Public License for more details.
304304
305 You should have received a copy of the GNU General Public License
306 along with this program; if not, write to the Free Software
307 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
308
305 You should have received a copy of the GNU General Public License along
306 with this program; if not, write to the Free Software Foundation, Inc.,
307 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309308
310309 Also add information on how to contact you by electronic and paper mail.
311310
335334 This General Public License does not permit incorporating your program into
336335 proprietary programs. If your program is a subroutine library, you may
337336 consider it more useful to permit linking proprietary applications with the
338 library. If this is what you want to do, use the GNU Library General
337 library. If this is what you want to do, use the GNU Lesser General
339338 Public License instead of this License.
0
1 GNU GENERAL PUBLIC LICENSE
2 Version 3, 29 June 2007
3
4 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5 Everyone is permitted to copy and distribute verbatim copies
6 of this license document, but changing it is not allowed.
7
8 Preamble
9
10 The GNU General Public License is a free, copyleft license for
11 software and other kinds of works.
12
13 The licenses for most software and other practical works are designed
14 to take away your freedom to share and change the works. By contrast,
15 the GNU General Public License is intended to guarantee your freedom to
16 share and change all versions of a program--to make sure it remains free
17 software for all its users. We, the Free Software Foundation, use the
18 GNU General Public License for most of our software; it applies also to
19 any other work released this way by its authors. You can apply it to
20 your programs, too.
21
22 When we speak of free software, we are referring to freedom, not
23 price. Our General Public Licenses are designed to make sure that you
24 have the freedom to distribute copies of free software (and charge for
25 them if you wish), that you receive source code or can get it if you
26 want it, that you can change the software or use pieces of it in new
27 free programs, and that you know you can do these things.
28
29 To protect your rights, we need to prevent others from denying you
30 these rights or asking you to surrender the rights. Therefore, you have
31 certain responsibilities if you distribute copies of the software, or if
32 you modify it: responsibilities to respect the freedom of others.
33
34 For example, if you distribute copies of such a program, whether
35 gratis or for a fee, you must pass on to the recipients the same
36 freedoms that you received. You must make sure that they, too, receive
37 or can get the source code. And you must show them these terms so they
38 know their rights.
39
40 Developers that use the GNU GPL protect your rights with two steps:
41 (1) assert copyright on the software, and (2) offer you this License
42 giving you legal permission to copy, distribute and/or modify it.
43
44 For the developers' and authors' protection, the GPL clearly explains
45 that there is no warranty for this free software. For both users' and
46 authors' sake, the GPL requires that modified versions be marked as
47 changed, so that their problems will not be attributed erroneously to
48 authors of previous versions.
49
50 Some devices are designed to deny users access to install or run
51 modified versions of the software inside them, although the manufacturer
52 can do so. This is fundamentally incompatible with the aim of
53 protecting users' freedom to change the software. The systematic
54 pattern of such abuse occurs in the area of products for individuals to
55 use, which is precisely where it is most unacceptable. Therefore, we
56 have designed this version of the GPL to prohibit the practice for those
57 products. If such problems arise substantially in other domains, we
58 stand ready to extend this provision to those domains in future versions
59 of the GPL, as needed to protect the freedom of users.
60
61 Finally, every program is threatened constantly by software patents.
62 States should not allow patents to restrict development and use of
63 software on general-purpose computers, but in those that do, we wish to
64 avoid the special danger that patents applied to a free program could
65 make it effectively proprietary. To prevent this, the GPL assures that
66 patents cannot be used to render the program non-free.
67
68 The precise terms and conditions for copying, distribution and
69 modification follow.
70
71 TERMS AND CONDITIONS
72
73 0. Definitions.
74
75 "This License" refers to version 3 of the GNU General Public License.
76
77 "Copyright" also means copyright-like laws that apply to other kinds of
78 works, such as semiconductor masks.
79
80 "The Program" refers to any copyrightable work licensed under this
81 License. Each licensee is addressed as "you". "Licensees" and
82 "recipients" may be individuals or organizations.
83
84 To "modify" a work means to copy from or adapt all or part of the work
85 in a fashion requiring copyright permission, other than the making of an
86 exact copy. The resulting work is called a "modified version" of the
87 earlier work or a work "based on" the earlier work.
88
89 A "covered work" means either the unmodified Program or a work based
90 on the Program.
91
92 To "propagate" a work means to do anything with it that, without
93 permission, would make you directly or secondarily liable for
94 infringement under applicable copyright law, except executing it on a
95 computer or modifying a private copy. Propagation includes copying,
96 distribution (with or without modification), making available to the
97 public, and in some countries other activities as well.
98
99 To "convey" a work means any kind of propagation that enables other
100 parties to make or receive copies. Mere interaction with a user through
101 a computer network, with no transfer of a copy, is not conveying.
102
103 An interactive user interface displays "Appropriate Legal Notices"
104 to the extent that it includes a convenient and prominently visible
105 feature that (1) displays an appropriate copyright notice, and (2)
106 tells the user that there is no warranty for the work (except to the
107 extent that warranties are provided), that licensees may convey the
108 work under this License, and how to view a copy of this License. If
109 the interface presents a list of user commands or options, such as a
110 menu, a prominent item in the list meets this criterion.
111
112 1. Source Code.
113
114 The "source code" for a work means the preferred form of the work
115 for making modifications to it. "Object code" means any non-source
116 form of a work.
117
118 A "Standard Interface" means an interface that either is an official
119 standard defined by a recognized standards body, or, in the case of
120 interfaces specified for a particular programming language, one that
121 is widely used among developers working in that language.
122
123 The "System Libraries" of an executable work include anything, other
124 than the work as a whole, that (a) is included in the normal form of
125 packaging a Major Component, but which is not part of that Major
126 Component, and (b) serves only to enable use of the work with that
127 Major Component, or to implement a Standard Interface for which an
128 implementation is available to the public in source code form. A
129 "Major Component", in this context, means a major essential component
130 (kernel, window system, and so on) of the specific operating system
131 (if any) on which the executable work runs, or a compiler used to
132 produce the work, or an object code interpreter used to run it.
133
134 The "Corresponding Source" for a work in object code form means all
135 the source code needed to generate, install, and (for an executable
136 work) run the object code and to modify the work, including scripts to
137 control those activities. However, it does not include the work's
138 System Libraries, or general-purpose tools or generally available free
139 programs which are used unmodified in performing those activities but
140 which are not part of the work. For example, Corresponding Source
141 includes interface definition files associated with source files for
142 the work, and the source code for shared libraries and dynamically
143 linked subprograms that the work is specifically designed to require,
144 such as by intimate data communication or control flow between those
145 subprograms and other parts of the work.
146
147 The Corresponding Source need not include anything that users
148 can regenerate automatically from other parts of the Corresponding
149 Source.
150
151 The Corresponding Source for a work in source code form is that
152 same work.
153
154 2. Basic Permissions.
155
156 All rights granted under this License are granted for the term of
157 copyright on the Program, and are irrevocable provided the stated
158 conditions are met. This License explicitly affirms your unlimited
159 permission to run the unmodified Program. The output from running a
160 covered work is covered by this License only if the output, given its
161 content, constitutes a covered work. This License acknowledges your
162 rights of fair use or other equivalent, as provided by copyright law.
163
164 You may make, run and propagate covered works that you do not
165 convey, without conditions so long as your license otherwise remains
166 in force. You may convey covered works to others for the sole purpose
167 of having them make modifications exclusively for you, or provide you
168 with facilities for running those works, provided that you comply with
169 the terms of this License in conveying all material for which you do
170 not control copyright. Those thus making or running the covered works
171 for you must do so exclusively on your behalf, under your direction
172 and control, on terms that prohibit them from making any copies of
173 your copyrighted material outside their relationship with you.
174
175 Conveying under any other circumstances is permitted solely under
176 the conditions stated below. Sublicensing is not allowed; section 10
177 makes it unnecessary.
178
179 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
181 No covered work shall be deemed part of an effective technological
182 measure under any applicable law fulfilling obligations under article
183 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 similar laws prohibiting or restricting circumvention of such
185 measures.
186
187 When you convey a covered work, you waive any legal power to forbid
188 circumvention of technological measures to the extent such circumvention
189 is effected by exercising rights under this License with respect to
190 the covered work, and you disclaim any intention to limit operation or
191 modification of the work as a means of enforcing, against the work's
192 users, your or third parties' legal rights to forbid circumvention of
193 technological measures.
194
195 4. Conveying Verbatim Copies.
196
197 You may convey verbatim copies of the Program's source code as you
198 receive it, in any medium, provided that you conspicuously and
199 appropriately publish on each copy an appropriate copyright notice;
200 keep intact all notices stating that this License and any
201 non-permissive terms added in accord with section 7 apply to the code;
202 keep intact all notices of the absence of any warranty; and give all
203 recipients a copy of this License along with the Program.
204
205 You may charge any price or no price for each copy that you convey,
206 and you may offer support or warranty protection for a fee.
207
208 5. Conveying Modified Source Versions.
209
210 You may convey a work based on the Program, or the modifications to
211 produce it from the Program, in the form of source code under the
212 terms of section 4, provided that you also meet all of these conditions:
213
214 a) The work must carry prominent notices stating that you modified
215 it, and giving a relevant date.
216
217 b) The work must carry prominent notices stating that it is
218 released under this License and any conditions added under section
219 7. This requirement modifies the requirement in section 4 to
220 "keep intact all notices".
221
222 c) You must license the entire work, as a whole, under this
223 License to anyone who comes into possession of a copy. This
224 License will therefore apply, along with any applicable section 7
225 additional terms, to the whole of the work, and all its parts,
226 regardless of how they are packaged. This License gives no
227 permission to license the work in any other way, but it does not
228 invalidate such permission if you have separately received it.
229
230 d) If the work has interactive user interfaces, each must display
231 Appropriate Legal Notices; however, if the Program has interactive
232 interfaces that do not display Appropriate Legal Notices, your
233 work need not make them do so.
234
235 A compilation of a covered work with other separate and independent
236 works, which are not by their nature extensions of the covered work,
237 and which are not combined with it such as to form a larger program,
238 in or on a volume of a storage or distribution medium, is called an
239 "aggregate" if the compilation and its resulting copyright are not
240 used to limit the access or legal rights of the compilation's users
241 beyond what the individual works permit. Inclusion of a covered work
242 in an aggregate does not cause this License to apply to the other
243 parts of the aggregate.
244
245 6. Conveying Non-Source Forms.
246
247 You may convey a covered work in object code form under the terms
248 of sections 4 and 5, provided that you also convey the
249 machine-readable Corresponding Source under the terms of this License,
250 in one of these ways:
251
252 a) Convey the object code in, or embodied in, a physical product
253 (including a physical distribution medium), accompanied by the
254 Corresponding Source fixed on a durable physical medium
255 customarily used for software interchange.
256
257 b) Convey the object code in, or embodied in, a physical product
258 (including a physical distribution medium), accompanied by a
259 written offer, valid for at least three years and valid for as
260 long as you offer spare parts or customer support for that product
261 model, to give anyone who possesses the object code either (1) a
262 copy of the Corresponding Source for all the software in the
263 product that is covered by this License, on a durable physical
264 medium customarily used for software interchange, for a price no
265 more than your reasonable cost of physically performing this
266 conveying of source, or (2) access to copy the
267 Corresponding Source from a network server at no charge.
268
269 c) Convey individual copies of the object code with a copy of the
270 written offer to provide the Corresponding Source. This
271 alternative is allowed only occasionally and noncommercially, and
272 only if you received the object code with such an offer, in accord
273 with subsection 6b.
274
275 d) Convey the object code by offering access from a designated
276 place (gratis or for a charge), and offer equivalent access to the
277 Corresponding Source in the same way through the same place at no
278 further charge. You need not require recipients to copy the
279 Corresponding Source along with the object code. If the place to
280 copy the object code is a network server, the Corresponding Source
281 may be on a different server (operated by you or a third party)
282 that supports equivalent copying facilities, provided you maintain
283 clear directions next to the object code saying where to find the
284 Corresponding Source. Regardless of what server hosts the
285 Corresponding Source, you remain obligated to ensure that it is
286 available for as long as needed to satisfy these requirements.
287
288 e) Convey the object code using peer-to-peer transmission, provided
289 you inform other peers where the object code and Corresponding
290 Source of the work are being offered to the general public at no
291 charge under subsection 6d.
292
293 A separable portion of the object code, whose source code is excluded
294 from the Corresponding Source as a System Library, need not be
295 included in conveying the object code work.
296
297 A "User Product" is either (1) a "consumer product", which means any
298 tangible personal property which is normally used for personal, family,
299 or household purposes, or (2) anything designed or sold for incorporation
300 into a dwelling. In determining whether a product is a consumer product,
301 doubtful cases shall be resolved in favor of coverage. For a particular
302 product received by a particular user, "normally used" refers to a
303 typical or common use of that class of product, regardless of the status
304 of the particular user or of the way in which the particular user
305 actually uses, or expects or is expected to use, the product. A product
306 is a consumer product regardless of whether the product has substantial
307 commercial, industrial or non-consumer uses, unless such uses represent
308 the only significant mode of use of the product.
309
310 "Installation Information" for a User Product means any methods,
311 procedures, authorization keys, or other information required to install
312 and execute modified versions of a covered work in that User Product from
313 a modified version of its Corresponding Source. The information must
314 suffice to ensure that the continued functioning of the modified object
315 code is in no case prevented or interfered with solely because
316 modification has been made.
317
318 If you convey an object code work under this section in, or with, or
319 specifically for use in, a User Product, and the conveying occurs as
320 part of a transaction in which the right of possession and use of the
321 User Product is transferred to the recipient in perpetuity or for a
322 fixed term (regardless of how the transaction is characterized), the
323 Corresponding Source conveyed under this section must be accompanied
324 by the Installation Information. But this requirement does not apply
325 if neither you nor any third party retains the ability to install
326 modified object code on the User Product (for example, the work has
327 been installed in ROM).
328
329 The requirement to provide Installation Information does not include a
330 requirement to continue to provide support service, warranty, or updates
331 for a work that has been modified or installed by the recipient, or for
332 the User Product in which it has been modified or installed. Access to a
333 network may be denied when the modification itself materially and
334 adversely affects the operation of the network or violates the rules and
335 protocols for communication across the network.
336
337 Corresponding Source conveyed, and Installation Information provided,
338 in accord with this section must be in a format that is publicly
339 documented (and with an implementation available to the public in
340 source code form), and must require no special password or key for
341 unpacking, reading or copying.
342
343 7. Additional Terms.
344
345 "Additional permissions" are terms that supplement the terms of this
346 License by making exceptions from one or more of its conditions.
347 Additional permissions that are applicable to the entire Program shall
348 be treated as though they were included in this License, to the extent
349 that they are valid under applicable law. If additional permissions
350 apply only to part of the Program, that part may be used separately
351 under those permissions, but the entire Program remains governed by
352 this License without regard to the additional permissions.
353
354 When you convey a copy of a covered work, you may at your option
355 remove any additional permissions from that copy, or from any part of
356 it. (Additional permissions may be written to require their own
357 removal in certain cases when you modify the work.) You may place
358 additional permissions on material, added by you to a covered work,
359 for which you have or can give appropriate copyright permission.
360
361 Notwithstanding any other provision of this License, for material you
362 add to a covered work, you may (if authorized by the copyright holders of
363 that material) supplement the terms of this License with terms:
364
365 a) Disclaiming warranty or limiting liability differently from the
366 terms of sections 15 and 16 of this License; or
367
368 b) Requiring preservation of specified reasonable legal notices or
369 author attributions in that material or in the Appropriate Legal
370 Notices displayed by works containing it; or
371
372 c) Prohibiting misrepresentation of the origin of that material, or
373 requiring that modified versions of such material be marked in
374 reasonable ways as different from the original version; or
375
376 d) Limiting the use for publicity purposes of names of licensors or
377 authors of the material; or
378
379 e) Declining to grant rights under trademark law for use of some
380 trade names, trademarks, or service marks; or
381
382 f) Requiring indemnification of licensors and authors of that
383 material by anyone who conveys the material (or modified versions of
384 it) with contractual assumptions of liability to the recipient, for
385 any liability that these contractual assumptions directly impose on
386 those licensors and authors.
387
388 All other non-permissive additional terms are considered "further
389 restrictions" within the meaning of section 10. If the Program as you
390 received it, or any part of it, contains a notice stating that it is
391 governed by this License along with a term that is a further
392 restriction, you may remove that term. If a license document contains
393 a further restriction but permits relicensing or conveying under this
394 License, you may add to a covered work material governed by the terms
395 of that license document, provided that the further restriction does
396 not survive such relicensing or conveying.
397
398 If you add terms to a covered work in accord with this section, you
399 must place, in the relevant source files, a statement of the
400 additional terms that apply to those files, or a notice indicating
401 where to find the applicable terms.
402
403 Additional terms, permissive or non-permissive, may be stated in the
404 form of a separately written license, or stated as exceptions;
405 the above requirements apply either way.
406
407 8. Termination.
408
409 You may not propagate or modify a covered work except as expressly
410 provided under this License. Any attempt otherwise to propagate or
411 modify it is void, and will automatically terminate your rights under
412 this License (including any patent licenses granted under the third
413 paragraph of section 11).
414
415 However, if you cease all violation of this License, then your
416 license from a particular copyright holder is reinstated (a)
417 provisionally, unless and until the copyright holder explicitly and
418 finally terminates your license, and (b) permanently, if the copyright
419 holder fails to notify you of the violation by some reasonable means
420 prior to 60 days after the cessation.
421
422 Moreover, your license from a particular copyright holder is
423 reinstated permanently if the copyright holder notifies you of the
424 violation by some reasonable means, this is the first time you have
425 received notice of violation of this License (for any work) from that
426 copyright holder, and you cure the violation prior to 30 days after
427 your receipt of the notice.
428
429 Termination of your rights under this section does not terminate the
430 licenses of parties who have received copies or rights from you under
431 this License. If your rights have been terminated and not permanently
432 reinstated, you do not qualify to receive new licenses for the same
433 material under section 10.
434
435 9. Acceptance Not Required for Having Copies.
436
437 You are not required to accept this License in order to receive or
438 run a copy of the Program. Ancillary propagation of a covered work
439 occurring solely as a consequence of using peer-to-peer transmission
440 to receive a copy likewise does not require acceptance. However,
441 nothing other than this License grants you permission to propagate or
442 modify any covered work. These actions infringe copyright if you do
443 not accept this License. Therefore, by modifying or propagating a
444 covered work, you indicate your acceptance of this License to do so.
445
446 10. Automatic Licensing of Downstream Recipients.
447
448 Each time you convey a covered work, the recipient automatically
449 receives a license from the original licensors, to run, modify and
450 propagate that work, subject to this License. You are not responsible
451 for enforcing compliance by third parties with this License.
452
453 An "entity transaction" is a transaction transferring control of an
454 organization, or substantially all assets of one, or subdividing an
455 organization, or merging organizations. If propagation of a covered
456 work results from an entity transaction, each party to that
457 transaction who receives a copy of the work also receives whatever
458 licenses to the work the party's predecessor in interest had or could
459 give under the previous paragraph, plus a right to possession of the
460 Corresponding Source of the work from the predecessor in interest, if
461 the predecessor has it or can get it with reasonable efforts.
462
463 You may not impose any further restrictions on the exercise of the
464 rights granted or affirmed under this License. For example, you may
465 not impose a license fee, royalty, or other charge for exercise of
466 rights granted under this License, and you may not initiate litigation
467 (including a cross-claim or counterclaim in a lawsuit) alleging that
468 any patent claim is infringed by making, using, selling, offering for
469 sale, or importing the Program or any portion of it.
470
471 11. Patents.
472
473 A "contributor" is a copyright holder who authorizes use under this
474 License of the Program or a work on which the Program is based. The
475 work thus licensed is called the contributor's "contributor version".
476
477 A contributor's "essential patent claims" are all patent claims
478 owned or controlled by the contributor, whether already acquired or
479 hereafter acquired, that would be infringed by some manner, permitted
480 by this License, of making, using, or selling its contributor version,
481 but do not include claims that would be infringed only as a
482 consequence of further modification of the contributor version. For
483 purposes of this definition, "control" includes the right to grant
484 patent sublicenses in a manner consistent with the requirements of
485 this License.
486
487 Each contributor grants you a non-exclusive, worldwide, royalty-free
488 patent license under the contributor's essential patent claims, to
489 make, use, sell, offer for sale, import and otherwise run, modify and
490 propagate the contents of its contributor version.
491
492 In the following three paragraphs, a "patent license" is any express
493 agreement or commitment, however denominated, not to enforce a patent
494 (such as an express permission to practice a patent or covenant not to
495 sue for patent infringement). To "grant" such a patent license to a
496 party means to make such an agreement or commitment not to enforce a
497 patent against the party.
498
499 If you convey a covered work, knowingly relying on a patent license,
500 and the Corresponding Source of the work is not available for anyone
501 to copy, free of charge and under the terms of this License, through a
502 publicly available network server or other readily accessible means,
503 then you must either (1) cause the Corresponding Source to be so
504 available, or (2) arrange to deprive yourself of the benefit of the
505 patent license for this particular work, or (3) arrange, in a manner
506 consistent with the requirements of this License, to extend the patent
507 license to downstream recipients. "Knowingly relying" means you have
508 actual knowledge that, but for the patent license, your conveying the
509 covered work in a country, or your recipient's use of the covered work
510 in a country, would infringe one or more identifiable patents in that
511 country that you have reason to believe are valid.
512
513 If, pursuant to or in connection with a single transaction or
514 arrangement, you convey, or propagate by procuring conveyance of, a
515 covered work, and grant a patent license to some of the parties
516 receiving the covered work authorizing them to use, propagate, modify
517 or convey a specific copy of the covered work, then the patent license
518 you grant is automatically extended to all recipients of the covered
519 work and works based on it.
520
521 A patent license is "discriminatory" if it does not include within
522 the scope of its coverage, prohibits the exercise of, or is
523 conditioned on the non-exercise of one or more of the rights that are
524 specifically granted under this License. You may not convey a covered
525 work if you are a party to an arrangement with a third party that is
526 in the business of distributing software, under which you make payment
527 to the third party based on the extent of your activity of conveying
528 the work, and under which the third party grants, to any of the
529 parties who would receive the covered work from you, a discriminatory
530 patent license (a) in connection with copies of the covered work
531 conveyed by you (or copies made from those copies), or (b) primarily
532 for and in connection with specific products or compilations that
533 contain the covered work, unless you entered into that arrangement,
534 or that patent license was granted, prior to 28 March 2007.
535
536 Nothing in this License shall be construed as excluding or limiting
537 any implied license or other defenses to infringement that may
538 otherwise be available to you under applicable patent law.
539
540 12. No Surrender of Others' Freedom.
541
542 If conditions are imposed on you (whether by court order, agreement or
543 otherwise) that contradict the conditions of this License, they do not
544 excuse you from the conditions of this License. If you cannot convey a
545 covered work so as to satisfy simultaneously your obligations under this
546 License and any other pertinent obligations, then as a consequence you may
547 not convey it at all. For example, if you agree to terms that obligate you
548 to collect a royalty for further conveying from those to whom you convey
549 the Program, the only way you could satisfy both those terms and this
550 License would be to refrain entirely from conveying the Program.
551
552 13. Use with the GNU Affero General Public License.
553
554 Notwithstanding any other provision of this License, you have
555 permission to link or combine any covered work with a work licensed
556 under version 3 of the GNU Affero General Public License into a single
557 combined work, and to convey the resulting work. The terms of this
558 License will continue to apply to the part which is the covered work,
559 but the special requirements of the GNU Affero General Public License,
560 section 13, concerning interaction through a network will apply to the
561 combination as such.
562
563 14. Revised Versions of this License.
564
565 The Free Software Foundation may publish revised and/or new versions of
566 the GNU General Public License from time to time. Such new versions will
567 be similar in spirit to the present version, but may differ in detail to
568 address new problems or concerns.
569
570 Each version is given a distinguishing version number. If the
571 Program specifies that a certain numbered version of the GNU General
572 Public License "or any later version" applies to it, you have the
573 option of following the terms and conditions either of that numbered
574 version or of any later version published by the Free Software
575 Foundation. If the Program does not specify a version number of the
576 GNU General Public License, you may choose any version ever published
577 by the Free Software Foundation.
578
579 If the Program specifies that a proxy can decide which future
580 versions of the GNU General Public License can be used, that proxy's
581 public statement of acceptance of a version permanently authorizes you
582 to choose that version for the Program.
583
584 Later license versions may give you additional or different
585 permissions. However, no additional obligations are imposed on any
586 author or copyright holder as a result of your choosing to follow a
587 later version.
588
589 15. Disclaimer of Warranty.
590
591 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
600 16. Limitation of Liability.
601
602 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 SUCH DAMAGES.
611
612 17. Interpretation of Sections 15 and 16.
613
614 If the disclaimer of warranty and limitation of liability provided
615 above cannot be given local legal effect according to their terms,
616 reviewing courts shall apply local law that most closely approximates
617 an absolute waiver of all civil liability in connection with the
618 Program, unless a warranty or assumption of liability accompanies a
619 copy of the Program in return for a fee.
620
621 END OF TERMS AND CONDITIONS
622
623 How to Apply These Terms to Your New Programs
624
625 If you develop a new program, and you want it to be of the greatest
626 possible use to the public, the best way to achieve this is to make it
627 free software which everyone can redistribute and change under these terms.
628
629 To do so, attach the following notices to the program. It is safest
630 to attach them to the start of each source file to most effectively
631 state the exclusion of warranty; and each file should have at least
632 the "copyright" line and a pointer to where the full notice is found.
633
634 <one line to give the program's name and a brief idea of what it does.>
635 Copyright (C) <year> <name of author>
636
637 This program is free software: you can redistribute it and/or modify
638 it under the terms of the GNU General Public License as published by
639 the Free Software Foundation, either version 3 of the License, or
640 (at your option) any later version.
641
642 This program is distributed in the hope that it will be useful,
643 but WITHOUT ANY WARRANTY; without even the implied warranty of
644 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 GNU General Public License for more details.
646
647 You should have received a copy of the GNU General Public License
648 along with this program. If not, see <http://www.gnu.org/licenses/>.
649
650 Also add information on how to contact you by electronic and paper mail.
651
652 If the program does terminal interaction, make it output a short
653 notice like this when it starts in an interactive mode:
654
655 <program> Copyright (C) <year> <name of author>
656 This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 This is free software, and you are welcome to redistribute it
658 under certain conditions; type `show c' for details.
659
660 The hypothetical commands `show w' and `show c' should show the appropriate
661 parts of the General Public License. Of course, your program's commands
662 might be different; for a GUI interface, you would use an "about box".
663
664 You should also get your employer (if you work as a programmer) or school,
665 if any, to sign a "copyright disclaimer" for the program, if necessary.
666 For more information on this, and how to apply and follow the GNU GPL, see
667 <http://www.gnu.org/licenses/>.
668
669 The GNU General Public License does not permit incorporating your program
670 into proprietary programs. If your program is a subroutine library, you
671 may consider it more useful to permit linking proprietary applications with
672 the library. If this is what you want to do, use the GNU Lesser General
673 Public License instead of this License. But first, please read
674 <http://www.gnu.org/philosophy/why-not-lgpl.html>.
675
11 Version 2.1, February 1999
22
33 Copyright (C) 1991, 1999 Free Software Foundation, Inc.
4 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
4 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
55 Everyone is permitted to copy and distribute verbatim copies
66 of this license document, but changing it is not allowed.
77
145145 on the Library (independent of the use of the Library in a tool for
146146 writing it). Whether that is true depends on what the Library does
147147 and what the program that uses the Library does.
148
148
149149 1. You may copy and distribute verbatim copies of the Library's
150150 complete source code as you receive it, in any medium, provided that
151151 you conspicuously and appropriately publish on each copy an
484484
485485 You should have received a copy of the GNU Lesser General Public
486486 License along with this library; if not, write to the Free Software
487 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
487 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
488488
489489 Also add information on how to contact you by electronic and paper mail.
490490
0 GNU LESSER GENERAL PUBLIC LICENSE
1 Version 3, 29 June 2007
2
3 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
4 Everyone is permitted to copy and distribute verbatim copies
5 of this license document, but changing it is not allowed.
6
7
8 This version of the GNU Lesser General Public License incorporates
9 the terms and conditions of version 3 of the GNU General Public
10 License, supplemented by the additional permissions listed below.
11
12 0. Additional Definitions.
13
14 As used herein, "this License" refers to version 3 of the GNU Lesser
15 General Public License, and the "GNU GPL" refers to version 3 of the GNU
16 General Public License.
17
18 "The Library" refers to a covered work governed by this License,
19 other than an Application or a Combined Work as defined below.
20
21 An "Application" is any work that makes use of an interface provided
22 by the Library, but which is not otherwise based on the Library.
23 Defining a subclass of a class defined by the Library is deemed a mode
24 of using an interface provided by the Library.
25
26 A "Combined Work" is a work produced by combining or linking an
27 Application with the Library. The particular version of the Library
28 with which the Combined Work was made is also called the "Linked
29 Version".
30
31 The "Minimal Corresponding Source" for a Combined Work means the
32 Corresponding Source for the Combined Work, excluding any source code
33 for portions of the Combined Work that, considered in isolation, are
34 based on the Application, and not on the Linked Version.
35
36 The "Corresponding Application Code" for a Combined Work means the
37 object code and/or source code for the Application, including any data
38 and utility programs needed for reproducing the Combined Work from the
39 Application, but excluding the System Libraries of the Combined Work.
40
41 1. Exception to Section 3 of the GNU GPL.
42
43 You may convey a covered work under sections 3 and 4 of this License
44 without being bound by section 3 of the GNU GPL.
45
46 2. Conveying Modified Versions.
47
48 If you modify a copy of the Library, and, in your modifications, a
49 facility refers to a function or data to be supplied by an Application
50 that uses the facility (other than as an argument passed when the
51 facility is invoked), then you may convey a copy of the modified
52 version:
53
54 a) under this License, provided that you make a good faith effort to
55 ensure that, in the event an Application does not supply the
56 function or data, the facility still operates, and performs
57 whatever part of its purpose remains meaningful, or
58
59 b) under the GNU GPL, with none of the additional permissions of
60 this License applicable to that copy.
61
62 3. Object Code Incorporating Material from Library Header Files.
63
64 The object code form of an Application may incorporate material from
65 a header file that is part of the Library. You may convey such object
66 code under terms of your choice, provided that, if the incorporated
67 material is not limited to numerical parameters, data structure
68 layouts and accessors, or small macros, inline functions and templates
69 (ten or fewer lines in length), you do both of the following:
70
71 a) Give prominent notice with each copy of the object code that the
72 Library is used in it and that the Library and its use are
73 covered by this License.
74
75 b) Accompany the object code with a copy of the GNU GPL and this license
76 document.
77
78 4. Combined Works.
79
80 You may convey a Combined Work under terms of your choice that,
81 taken together, effectively do not restrict modification of the
82 portions of the Library contained in the Combined Work and reverse
83 engineering for debugging such modifications, if you also do each of
84 the following:
85
86 a) Give prominent notice with each copy of the Combined Work that
87 the Library is used in it and that the Library and its use are
88 covered by this License.
89
90 b) Accompany the Combined Work with a copy of the GNU GPL and this license
91 document.
92
93 c) For a Combined Work that displays copyright notices during
94 execution, include the copyright notice for the Library among
95 these notices, as well as a reference directing the user to the
96 copies of the GNU GPL and this license document.
97
98 d) Do one of the following:
99
100 0) Convey the Minimal Corresponding Source under the terms of this
101 License, and the Corresponding Application Code in a form
102 suitable for, and under terms that permit, the user to
103 recombine or relink the Application with a modified version of
104 the Linked Version to produce a modified Combined Work, in the
105 manner specified by section 6 of the GNU GPL for conveying
106 Corresponding Source.
107
108 1) Use a suitable shared library mechanism for linking with the
109 Library. A suitable mechanism is one that (a) uses at run time
110 a copy of the Library already present on the user's computer
111 system, and (b) will operate properly with a modified version
112 of the Library that is interface-compatible with the Linked
113 Version.
114
115 e) Provide Installation Information, but only if you would otherwise
116 be required to provide such information under section 6 of the
117 GNU GPL, and only to the extent that such information is
118 necessary to install and execute a modified version of the
119 Combined Work produced by recombining or relinking the
120 Application with a modified version of the Linked Version. (If
121 you use option 4d0, the Installation Information must accompany
122 the Minimal Corresponding Source and Corresponding Application
123 Code. If you use option 4d1, you must provide the Installation
124 Information in the manner specified by section 6 of the GNU GPL
125 for conveying Corresponding Source.)
126
127 5. Combined Libraries.
128
129 You may place library facilities that are a work based on the
130 Library side by side in a single library together with other library
131 facilities that are not Applications and are not covered by this
132 License, and convey such a combined library under terms of your
133 choice, if you do both of the following:
134
135 a) Accompany the combined library with a copy of the same work based
136 on the Library, uncombined with any other library facilities,
137 conveyed under the terms of this License.
138
139 b) Give prominent notice with the combined library that part of it
140 is a work based on the Library, and explaining where to find the
141 accompanying uncombined form of the same work.
142
143 6. Revised Versions of the GNU Lesser General Public License.
144
145 The Free Software Foundation may publish revised and/or new versions
146 of the GNU Lesser General Public License from time to time. Such new
147 versions will be similar in spirit to the present version, but may
148 differ in detail to address new problems or concerns.
149
150 Each version is given a distinguishing version number. If the
151 Library as you received it specifies that a certain numbered version
152 of the GNU Lesser General Public License "or any later version"
153 applies to it, you have the option of following the terms and
154 conditions either of that published version or of any later version
155 published by the Free Software Foundation. If the Library as you
156 received it does not specify a version number of the GNU Lesser
157 General Public License, you may choose any version of the GNU Lesser
158 General Public License ever published by the Free Software Foundation.
159
160 If the Library as you received it specifies that a proxy can decide
161 whether future versions of the GNU Lesser General Public License shall
162 apply, that proxy's public statement of acceptance of any version is
163 permanent authorization for you to choose that version for the
164 Library.
0 # -*- Makefile -*-
1
02 # FILE: Makefile.am --
13 # AUTHOR: W. Michael Petullo <mike@flyn.org>
24 # DATE: 03 August 2002
1820 # along with this program; if not, write to the Free Software
1921 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2022
21
22 if FLYN
23 # For local development use only.
24 include /etc/fctk/config.mk
25 endif
26
27 AUTOMAKE_OPTIONS = gnu
28
29 EXTRA_DIST = autogen.sh FAQ
30
23 AUTOMAKE_OPTIONS = foreign subdir-objects
24 EXTRA_DIST = autogen.sh AUTHORS FAQ LICENSE.GPL2 LICENSE.LGPL2
3125 SUBDIRS = src config scripts dry
32
33 if FLYN
34 # For local development use only.
35 # ============================= dist-hook =====================================
36 dist-hook:
37 make dry
38
39 # ============================= rpm ============================================
40 rpm: dry dist
41 $(BUILD_RPM)
42
43 # ============================= deb ===========================================
44 deb: dry dist
45 $(BUILD_DEB)
46
47 # ============================= check ==========================================
48 check: rpm
49 $(CHECK)
50
51 # ============================= publish ========================================
52 publish: dry/pam_mount.html rpm deb
53 $(PUBLISH)
54
55 endif
1212 # PARTICULAR PURPOSE.
1313
1414 @SET_MAKE@
15
16 # -*- Makefile -*-
1517
1618 # FILE: Makefile.am --
1719 # AUTHOR: W. Michael Petullo <mike@flyn.org>
5759 host_triplet = @host@
5860 DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
5961 $(srcdir)/Makefile.in $(srcdir)/config.h.in \
60 $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
61 TODO config.guess config.sub depcomp install-sh ltmain.sh \
62 missing
62 $(top_srcdir)/configure AUTHORS TODO config.guess config.sub \
63 depcomp install-sh ltmain.sh missing
6364 subdir = .
6465 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
65 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
66 am__aclocal_m4_deps = $(top_srcdir)/m4lib/gcc4_visibility.m4 \
67 $(top_srcdir)/configure.ac
6668 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
6769 $(ACLOCAL_M4)
6870 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
7072 mkinstalldirs = $(install_sh) -d
7173 CONFIG_HEADER = config.h
7274 CONFIG_CLEAN_FILES =
75 AM_LIBTOOL_SILENT = $(if $(V),,--silent)
76 AM_VERBOSE_CC = $(if $(V),,@echo " CC " $@;)
77 AM_VERBOSE_CCLD = $(if $(V),,@echo " CCLD " $@;)
78 AM_VERBOSE_CXX = $(if $(V),,@echo " CXX " $@;)
79 AM_VERBOSE_CXXLD = $(if $(V),,@echo " CXXLD " $@;)
80 AM_VERBOSE_OBJC = $(if $(V),,@echo " OBJC " $@;)
81 AM_VERBOSE_OBJCLD = $(if $(V),,@echo " OBJCLD " $@;)
82 AM_VERBOSE_YACC = $(if $(V),,@echo " YACC " $@;)
83 AM_VERBOSE_LEX = $(if $(V),,@echo " LEX " $@;)
84 AM_VERBOSE_AS = $(if $(V),,@echo " AS " $@;)
85 AM_VERBOSE_F77 = $(if $(V),,@echo " F77 " $@;)
86 AM_VERBOSE_F77LD = $(if $(V),,@echo " F77LD " $@;)
87 AM_VERBOSE_FC = $(if $(V),,@echo " FC " $@;)
88 AM_VERBOSE_FCLD = $(if $(V),,@echo " FCLD " $@;)
89 AM_VERBOSE_GCJ = $(if $(V),,@echo " GCJ " $@;)
90 AM_VERBOSE_GCJLD = $(if $(V),,@echo " GCJLD " $@;)
91 AM_VERBOSE_GEN = $(if $(V),,@echo " GEN " $@;)
7392 SOURCES =
7493 DIST_SOURCES =
7594 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
121140 EXEEXT = @EXEEXT@
122141 F77 = @F77@
123142 FFLAGS = @FFLAGS@
124 FLYN_FALSE = @FLYN_FALSE@
125 FLYN_TRUE = @FLYN_TRUE@
126143 GCC_FVISIBILITY_HIDDEN = @GCC_FVISIBILITY_HIDDEN@
127144 GLIB_CFLAGS = @GLIB_CFLAGS@
128145 GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
129146 GLIB_LIBS = @GLIB_LIBS@
130147 GLIB_MKENUMS = @GLIB_MKENUMS@
131148 GOBJECT_QUERY = @GOBJECT_QUERY@
149 GREP = @GREP@
132150 INSTALL_DATA = @INSTALL_DATA@
133151 INSTALL_PROGRAM = @INSTALL_PROGRAM@
134152 INSTALL_SCRIPT = @INSTALL_SCRIPT@
139157 LIBTOOL = @LIBTOOL@
140158 LN_S = @LN_S@
141159 LTLIBOBJS = @LTLIBOBJS@
142 MAJOR_VERSION = @MAJOR_VERSION@
143160 MAKEINFO = @MAKEINFO@
144 MICRO_VERSION = @MICRO_VERSION@
145 MINOR_VERSION = @MINOR_VERSION@
146161 OBJEXT = @OBJEXT@
147162 PACKAGE = @PACKAGE@
148163 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
158173 SHELL = @SHELL@
159174 STRIP = @STRIP@
160175 VERSION = @VERSION@
161 VER_INFO = @VER_INFO@
162 ac_ct_AR = @ac_ct_AR@
176 XML2_CONFIG = @XML2_CONFIG@
177 XML_CPPFLAGS = @XML_CPPFLAGS@
178 XML_LIBS = @XML_LIBS@
163179 ac_ct_CC = @ac_ct_CC@
164180 ac_ct_CXX = @ac_ct_CXX@
165181 ac_ct_F77 = @ac_ct_F77@
166 ac_ct_RANLIB = @ac_ct_RANLIB@
167 ac_ct_STRIP = @ac_ct_STRIP@
168182 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
169183 am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
170184 am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
181195 build_os = @build_os@
182196 build_vendor = @build_vendor@
183197 datadir = @datadir@
198 datarootdir = @datarootdir@
199 docdir = @docdir@
200 dvidir = @dvidir@
184201 exec_prefix = @exec_prefix@
185202 host = @host@
186203 host_alias = @host_alias@
187204 host_cpu = @host_cpu@
188205 host_os = @host_os@
189206 host_vendor = @host_vendor@
207 htmldir = @htmldir@
190208 includedir = @includedir@
191209 infodir = @infodir@
192210 install_sh = @install_sh@
193211 libdir = @libdir@
194212 libexecdir = @libexecdir@
213 localedir = @localedir@
195214 localstatedir = @localstatedir@
196215 mandir = @mandir@
197216 mkdir_p = @mkdir_p@
198217 oldincludedir = @oldincludedir@
218 pdfdir = @pdfdir@
199219 prefix = @prefix@
200220 program_transform_name = @program_transform_name@
221 psdir = @psdir@
222 regular_CFLAGS = @regular_CFLAGS@
201223 sbindir = @sbindir@
202224 sharedstatedir = @sharedstatedir@
203225 slibdir = @slibdir@
204226 ssbindir = @ssbindir@
205227 sysconfdir = @sysconfdir@
206228 target_alias = @target_alias@
207 AUTOMAKE_OPTIONS = gnu
208 EXTRA_DIST = autogen.sh FAQ
229 AUTOMAKE_OPTIONS = foreign subdir-objects
230 EXTRA_DIST = autogen.sh AUTHORS FAQ LICENSE.GPL2 LICENSE.LGPL2
209231 SUBDIRS = src config scripts dry
210232 all: config.h
211233 $(MAKE) $(AM_MAKEFLAGS) all-recursive
217239 @for dep in $?; do \
218240 case '$(am__configure_deps)' in \
219241 *$$dep*) \
220 echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
221 cd $(srcdir) && $(AUTOMAKE) --gnu \
242 echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
243 cd $(srcdir) && $(AUTOMAKE) --foreign \
222244 && exit 0; \
223245 exit 1;; \
224246 esac; \
225247 done; \
226 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
248 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
227249 cd $(top_srcdir) && \
228 $(AUTOMAKE) --gnu Makefile
250 $(AUTOMAKE) --foreign Makefile
229251 .PRECIOUS: Makefile
230252 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
231253 @case '$?' in \
403425
404426 distclean-tags:
405427 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
406 @FLYN_FALSE@dist-hook:
407428
408429 distdir: $(DISTFILES)
409430 $(am__remove_distdir)
410431 mkdir $(distdir)
432 $(mkdir_p) $(distdir)/m4lib
411433 @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
412434 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
413435 list='$(DISTFILES)'; for file in $$list; do \
449471 || exit 1; \
450472 fi; \
451473 done
452 $(MAKE) $(AM_MAKEFLAGS) \
453 top_distdir="$(top_distdir)" distdir="$(distdir)" \
454 dist-hook
455474 -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
456475 ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
457476 ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
633652 .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
634653 check-am clean clean-generic clean-libtool clean-recursive \
635654 ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
636 dist-hook dist-shar dist-tarZ dist-zip distcheck distclean \
655 dist-shar dist-tarZ dist-zip distcheck distclean \
637656 distclean-generic distclean-hdr distclean-libtool \
638657 distclean-recursive distclean-tags distcleancheck distdir \
639658 distuninstallcheck dvi dvi-am html html-am info info-am \
645664 mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
646665 tags tags-recursive uninstall uninstall-am uninstall-info-am
647666
648
649 # For local development use only.
650 @FLYN_TRUE@include /etc/fctk/config.mk
651
652 # For local development use only.
653 # ============================= dist-hook =====================================
654 @FLYN_TRUE@dist-hook:
655 @FLYN_TRUE@ make dry
656
657 # ============================= rpm ============================================
658 @FLYN_TRUE@rpm: dry dist
659 @FLYN_TRUE@ $(BUILD_RPM)
660
661 # ============================= deb ===========================================
662 @FLYN_TRUE@deb: dry dist
663 @FLYN_TRUE@ $(BUILD_DEB)
664
665 # ============================= check ==========================================
666 @FLYN_TRUE@check: rpm
667 @FLYN_TRUE@ $(CHECK)
668
669 # ============================= publish ========================================
670 @FLYN_TRUE@publish: dry/pam_mount.html rpm deb
671 @FLYN_TRUE@ $(PUBLISH)
672667 # Tell versions [3.59,3.63) of GNU make to not export all variables.
673668 # Otherwise a system limit (for SysV at least) may be exceeded.
674669 .NOEXPORT:
+0
-1
NEWS less more
0 No news is good news.
4040
4141 NASTY DETAILS
4242 The primary configuration file for the pam_mount module is
43 pam_mount.conf. On most platforms this file is read from /etc/secu‐
44 rity/pam_mount.conf. On OpenBSD pam_mount reads its configuration file
45 from /etc/pam_mount.conf. pam_mount.conf contains many comments docu‐
46 menting its use.
43 pam_mount.conf.xml. On most platforms this file is read from
44 /etc/security/pam_mount.conf.xml. On OpenBSD pam_mount reads its con‐
45 figuration file from /etc/pam_mount.conf.xml. pam_mount.conf.xml con‐
46 tains many comments documenting its use.
4747
4848 In addition, you must include two entries in the system's applicable
4949 /etc/pam.d/SERVICE config files, as the following example shows:
5858 session required pam_pwdb.so
5959 session optional pam_console.so
6060 +++ session optional pam_mount.so
61
62 When "sufficient" is used in the second column, you must make sure that
63 pam_mount is added before this entry. Otherwise pam_mount will not get
64 executed should a previous PAM module succeed. Also be aware of the
65 "include" statements. These make PAM look into the specified file. If
66 there is a "sufficient" statement, then the pam_mount entry must either
67 be in the included file before the "sufficient" statement or before the
68 "include" statement.
6169
6270 If you use pam_ldap, pam_winbind, or any other authentication services
6371 that make use of PAM's sufficient keyword then model your configuration
104112 password, simply regenerate efsk using efsk = E_sk (fsk). If you want
105113 to mount this volume by hand, use something like openssl enc -d
106114 -aes-256-ecb -in /home/user.key | mount -p0 /home/user. More informa‐
107 tion about this technique is included in pam_mount.conf.
115 tion about this technique is included in pam_mount.conf.xml.
108116
109117 A script named mkehd is provided with pam_mount to help create
110118 encrypted home directories. If you have an entry for a user using
111 encrypted home directories in pam_mount.conf, mkehd will create neces‐
112 sary filesystem images and possibly encrypted filesystem keys.
119 encrypted home directories in pam_mount.conf.xml, mkehd will create
120 necessary filesystem images and possibly encrypted filesystem keys.
113121
114122 Individual users may define additional volumes to mount if allowed by
115 pam_mount.conf (usually ~/.pam_mount.conf). The volume keyword is the
116 only valid keyword in these per-user configuration files. If the luser‐
117 conf parameter is set in pam_mount.conf, allowing user-defined volume,
118 then users may mount and unmount any volume they own at any mount point
119 they own. On some filesystem configurations this may be a security flaw
120 so user-defined volumes are not allowed by the example pam_mount.conf
121 distributed with pam_mount.
123 pam_mount.conf.xml (usually ~/.pam_mount.conf.xml). The volume keyword
124 is the only valid keyword in these per-user configuration files. If the
125 luserconf parameter is set in pam_mount.conf.xml, allowing user-defined
126 volume, then users may mount and unmount any volume they own at any
127 mount point they own. On some filesystem configurations this may be a
128 security flaw so user-defined volumes are not allowed by the example
129 pam_mount.conf.xml distributed with pam_mount.
122130
123 In general, you will leave all the first (general) parameters as pro‐
124 vided by default. You only have to provide the user/volume list in the
125 end of the file, following the examples.
131 In general, you will leave all the first (general) parameters as
132 provided by default. You only have to provide the user/volume list in
133 the end of the file, following the examples.
126134
127135 To ensure that your system and, possibly, the remote server are all
128136 properly configured, you should try to mount all or some of the volumes
129137 by hand, using the same commands and mount points provided in
130 pam_mount.conf. This will save you a lot of grief, since it is more
138 pam_mount.conf.xml. This will save you a lot of grief, since it is more
131139 difficult to debug the mounting process via pam_mount.
132140
133141 If you can mount the volumes by hand but it is not happening via
134 pam_mount, you may want to enable the "debug" option in pam_mount.conf
135 to see what is happening.
142 pam_mount, you may want to enable the "debug" option in
143 pam_mount.conf.xml to see what is happening.
136144
137145 Verify if the user owns the mount point and has sufficient permissions
138146 over that. pam_mount will verify this and will refuse to mount the
140148
141149 If pam_mount is having trouble unmounting volumes upon logging out,
142150 enable the debug variable and check the lsof variable in
143 pam_mount.conf. This causes pam_mount to run lsof upon logging out and
144 write lsof's output to the system's logs.
151 pam_mount.conf.xml. This causes pam_mount to run lsof upon logging out
152 and write lsof's output to the system's logs.
145153
146154 AUTHORS
147155 W. Michael Petullo <mike@flyn.org>
66036603 AC_MSG_RESULT([$SED])
66046604 ])
66056605
6606 # Configure paths for LIBXML2
6607 # Mike Hommey 2004-06-19
6608 # use CPPFLAGS instead of CFLAGS
6609 # Toshio Kuratomi 2001-04-21
6610 # Adapted from:
6611 # Configure paths for GLIB
6612 # Owen Taylor 97-11-3
6613
6614 dnl AM_PATH_XML2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
6615 dnl Test for XML, and define XML_CPPFLAGS and XML_LIBS
6616 dnl
6617 AC_DEFUN([AM_PATH_XML2],[
6618 AC_ARG_WITH(xml-prefix,
6619 [ --with-xml-prefix=PFX Prefix where libxml is installed (optional)],
6620 xml_config_prefix="$withval", xml_config_prefix="")
6621 AC_ARG_WITH(xml-exec-prefix,
6622 [ --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)],
6623 xml_config_exec_prefix="$withval", xml_config_exec_prefix="")
6624 AC_ARG_ENABLE(xmltest,
6625 [ --disable-xmltest Do not try to compile and run a test LIBXML program],,
6626 enable_xmltest=yes)
6627
6628 if test x$xml_config_exec_prefix != x ; then
6629 xml_config_args="$xml_config_args"
6630 if test x${XML2_CONFIG+set} != xset ; then
6631 XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config
6632 fi
6633 fi
6634 if test x$xml_config_prefix != x ; then
6635 xml_config_args="$xml_config_args --prefix=$xml_config_prefix"
6636 if test x${XML2_CONFIG+set} != xset ; then
6637 XML2_CONFIG=$xml_config_prefix/bin/xml2-config
6638 fi
6639 fi
6640
6641 AC_PATH_PROG(XML2_CONFIG, xml2-config, no)
6642 min_xml_version=ifelse([$1], ,2.0.0,[$1])
6643 AC_MSG_CHECKING(for libxml - version >= $min_xml_version)
6644 no_xml=""
6645 if test "$XML2_CONFIG" = "no" ; then
6646 no_xml=yes
6647 else
6648 XML_CPPFLAGS=`$XML2_CONFIG $xml_config_args --cflags`
6649 XML_LIBS=`$XML2_CONFIG $xml_config_args --libs`
6650 xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \
6651 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
6652 xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \
6653 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
6654 xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \
6655 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
6656 if test "x$enable_xmltest" = "xyes" ; then
6657 ac_save_CPPFLAGS="$CPPFLAGS"
6658 ac_save_LIBS="$LIBS"
6659 CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
6660 LIBS="$XML_LIBS $LIBS"
6661 dnl
6662 dnl Now check if the installed libxml is sufficiently new.
6663 dnl (Also sanity checks the results of xml2-config to some extent)
6664 dnl
6665 rm -f conf.xmltest
6666 AC_TRY_RUN([
6667 #include <stdlib.h>
6668 #include <stdio.h>
6669 #include <string.h>
6670 #include <libxml/xmlversion.h>
6671
6672 int
6673 main()
6674 {
6675 int xml_major_version, xml_minor_version, xml_micro_version;
6676 int major, minor, micro;
6677 char *tmp_version;
6678
6679 system("touch conf.xmltest");
6680
6681 /* Capture xml2-config output via autoconf/configure variables */
6682 /* HP/UX 9 (%@#!) writes to sscanf strings */
6683 tmp_version = (char *)strdup("$min_xml_version");
6684 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
6685 printf("%s, bad version string from xml2-config\n", "$min_xml_version");
6686 exit(1);
6687 }
6688 free(tmp_version);
6689
6690 /* Capture the version information from the header files */
6691 tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION);
6692 if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) {
6693 printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION");
6694 exit(1);
6695 }
6696 free(tmp_version);
6697
6698 /* Compare xml2-config output to the libxml headers */
6699 if ((xml_major_version != $xml_config_major_version) ||
6700 (xml_minor_version != $xml_config_minor_version) ||
6701 (xml_micro_version != $xml_config_micro_version))
6702 {
6703 printf("*** libxml header files (version %d.%d.%d) do not match\n",
6704 xml_major_version, xml_minor_version, xml_micro_version);
6705 printf("*** xml2-config (version %d.%d.%d)\n",
6706 $xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version);
6707 return 1;
6708 }
6709 /* Compare the headers to the library to make sure we match */
6710 /* Less than ideal -- doesn't provide us with return value feedback,
6711 * only exits if there's a serious mismatch between header and library.
6712 */
6713 LIBXML_TEST_VERSION;
6714
6715 /* Test that the library is greater than our minimum version */
6716 if ((xml_major_version > major) ||
6717 ((xml_major_version == major) && (xml_minor_version > minor)) ||
6718 ((xml_major_version == major) && (xml_minor_version == minor) &&
6719 (xml_micro_version >= micro)))
6720 {
6721 return 0;
6722 }
6723 else
6724 {
6725 printf("\n*** An old version of libxml (%d.%d.%d) was found.\n",
6726 xml_major_version, xml_minor_version, xml_micro_version);
6727 printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n",
6728 major, minor, micro);
6729 printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n");
6730 printf("***\n");
6731 printf("*** If you have already installed a sufficiently new version, this error\n");
6732 printf("*** probably means that the wrong copy of the xml2-config shell script is\n");
6733 printf("*** being found. The easiest way to fix this is to remove the old version\n");
6734 printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n");
6735 printf("*** correct copy of xml2-config. (In this case, you will have to\n");
6736 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
6737 printf("*** so that the correct libraries are found at run-time))\n");
6738 }
6739 return 1;
6740 }
6741 ],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
6742 CPPFLAGS="$ac_save_CPPFLAGS"
6743 LIBS="$ac_save_LIBS"
6744 fi
6745 fi
6746
6747 if test "x$no_xml" = x ; then
6748 AC_MSG_RESULT(yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version))
6749 ifelse([$2], , :, [$2])
6750 else
6751 AC_MSG_RESULT(no)
6752 if test "$XML2_CONFIG" = "no" ; then
6753 echo "*** The xml2-config script installed by LIBXML could not be found"
6754 echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in"
6755 echo "*** your path, or set the XML2_CONFIG environment variable to the"
6756 echo "*** full path to xml2-config."
6757 else
6758 if test -f conf.xmltest ; then
6759 :
6760 else
6761 echo "*** Could not run libxml test program, checking why..."
6762 CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
6763 LIBS="$LIBS $XML_LIBS"
6764 AC_TRY_LINK([
6765 #include <libxml/xmlversion.h>
6766 #include <stdio.h>
6767 ], [ LIBXML_TEST_VERSION; return 0;],
6768 [ echo "*** The test program compiled, but did not run. This usually means"
6769 echo "*** that the run-time linker is not finding LIBXML or finding the wrong"
6770 echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your"
6771 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
6772 echo "*** to the installed location Also, make sure you have run ldconfig if that"
6773 echo "*** is required on your system"
6774 echo "***"
6775 echo "*** If you have an old version installed, it is best to remove it, although"
6776 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
6777 [ echo "*** The test program failed to compile or link. See the file config.log for the"
6778 echo "*** exact error that occured. This usually means LIBXML was incorrectly installed"
6779 echo "*** or that you have moved LIBXML since it was installed. In the latter case, you"
6780 echo "*** may want to edit the xml2-config script: $XML2_CONFIG" ])
6781 CPPFLAGS="$ac_save_CPPFLAGS"
6782 LIBS="$ac_save_LIBS"
6783 fi
6784 fi
6785
6786 XML_CPPFLAGS=""
6787 XML_LIBS=""
6788 ifelse([$3], , :, [$3])
6789 fi
6790 AC_SUBST(XML_CPPFLAGS)
6791 AC_SUBST(XML_LIBS)
6792 rm -f conf.xmltest
6793 ])
6794
66066795 # Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
66076796 #
66086797 # This file is free software; the Free Software Foundation
69327121 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
69337122 ])
69347123
6935 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
6936 # Free Software Foundation, Inc.
6937 #
6938 # This file is free software; the Free Software Foundation
6939 # gives unlimited permission to copy and/or distribute it,
6940 # with or without modifications, as long as this notice is preserved.
6941
6942 # serial 8
6943
6944 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
6945 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
6946
69477124 # Do all the work for Automake. -*- Autoconf -*-
69487125
69497126 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
71437320 AC_SUBST([am__quote])
71447321 AC_MSG_RESULT([$_am_result])
71457322 rm -f confinc confmf
7323 ])
7324
7325 # Copyright (C) 1999, 2000, 2001, 2003, 2005 Free Software Foundation, Inc.
7326 #
7327 # This file is free software; the Free Software Foundation
7328 # gives unlimited permission to copy and/or distribute it,
7329 # with or without modifications, as long as this notice is preserved.
7330
7331 # serial 3
7332
7333 # AM_PROG_CC_C_O
7334 # --------------
7335 # Like AC_PROG_CC_C_O, but changed for automake.
7336 AC_DEFUN([AM_PROG_CC_C_O],
7337 [AC_REQUIRE([AC_PROG_CC_C_O])dnl
7338 AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7339 # FIXME: we rely on the cache variable name because
7340 # there is no other way.
7341 set dummy $CC
7342 ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
7343 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
7344 # Losing compiler, so override with the script.
7345 # FIXME: It is wrong to rewrite CC.
7346 # But if we don't then we get into trouble of one sort or another.
7347 # A longer-term fix would be to have automake use am__CC in this case,
7348 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
7349 CC="$am_aux_dir/compile $CC"
7350 fi
71467351 ])
71477352
71487353 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
0 #!/bin/bash
1
2 autoreconf -fi;
3 rm -Rf autom4te*.cache;
0
1 SVN /trunk
2 ==========
3 - [r209]: Do not use absolute paths, search $PATH instead for programs
4 (apparently Fedora fails it again since $PATH is crippled)
5 - [r210]: Add pam_mount.conf to .conf.xml converter
6 - [r223]: "sufficient" keyword documentation
7 - [r224]: Misc cryptmount fix
8 - [r232]: Pass down readonly flag to luksOpen
9 - [r237]: Add option to retain automatically created mountpoints
10 - [r240]: Create mountpoint as user if possible (e.g. if /home/USER
11 already exists and your volume is /home/USER/myvol)
12 - [r249]: Build fixes, making it work OOTB again with FC6 and Autoconf 2.59
13 - [r251]: Allow changing the password prompt
14 - [r252]: Add an overview of pam_mount options (options.txt)
15 - [r253]: Implement the "soft_try_pass" option
0 # Also update the following files:
1 # toplevel configure.in
2 # ../Makefile.am
0 # -*- Makefile -*-
31
4 EXTRA_DIST = pam_mount.conf pam_mount_macros.te pam_mount.fc
2 EXTRA_DIST = pam_mount.conf.xml pam_mount_macros.te pam_mount.fc
1313
1414 @SET_MAKE@
1515
16 # Also update the following files:
17 # toplevel configure.in
18 # ../Makefile.am
16 # -*- Makefile -*-
1917 srcdir = @srcdir@
2018 top_srcdir = @top_srcdir@
2119 VPATH = @srcdir@
4139 subdir = config
4240 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
4341 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
44 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
42 am__aclocal_m4_deps = $(top_srcdir)/m4lib/gcc4_visibility.m4 \
43 $(top_srcdir)/configure.ac
4544 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
4645 $(ACLOCAL_M4)
4746 mkinstalldirs = $(install_sh) -d
4847 CONFIG_HEADER = $(top_builddir)/config.h
4948 CONFIG_CLEAN_FILES =
49 AM_LIBTOOL_SILENT = $(if $(V),,--silent)
50 AM_VERBOSE_CC = $(if $(V),,@echo " CC " $@;)
51 AM_VERBOSE_CCLD = $(if $(V),,@echo " CCLD " $@;)
52 AM_VERBOSE_CXX = $(if $(V),,@echo " CXX " $@;)
53 AM_VERBOSE_CXXLD = $(if $(V),,@echo " CXXLD " $@;)
54 AM_VERBOSE_OBJC = $(if $(V),,@echo " OBJC " $@;)
55 AM_VERBOSE_OBJCLD = $(if $(V),,@echo " OBJCLD " $@;)
56 AM_VERBOSE_YACC = $(if $(V),,@echo " YACC " $@;)
57 AM_VERBOSE_LEX = $(if $(V),,@echo " LEX " $@;)
58 AM_VERBOSE_AS = $(if $(V),,@echo " AS " $@;)
59 AM_VERBOSE_F77 = $(if $(V),,@echo " F77 " $@;)
60 AM_VERBOSE_F77LD = $(if $(V),,@echo " F77LD " $@;)
61 AM_VERBOSE_FC = $(if $(V),,@echo " FC " $@;)
62 AM_VERBOSE_FCLD = $(if $(V),,@echo " FCLD " $@;)
63 AM_VERBOSE_GCJ = $(if $(V),,@echo " GCJ " $@;)
64 AM_VERBOSE_GCJLD = $(if $(V),,@echo " GCJLD " $@;)
65 AM_VERBOSE_GEN = $(if $(V),,@echo " GEN " $@;)
5066 SOURCES =
5167 DIST_SOURCES =
5268 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
7995 EXEEXT = @EXEEXT@
8096 F77 = @F77@
8197 FFLAGS = @FFLAGS@
82 FLYN_FALSE = @FLYN_FALSE@
83 FLYN_TRUE = @FLYN_TRUE@
8498 GCC_FVISIBILITY_HIDDEN = @GCC_FVISIBILITY_HIDDEN@
8599 GLIB_CFLAGS = @GLIB_CFLAGS@
86100 GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
87101 GLIB_LIBS = @GLIB_LIBS@
88102 GLIB_MKENUMS = @GLIB_MKENUMS@
89103 GOBJECT_QUERY = @GOBJECT_QUERY@
104 GREP = @GREP@
90105 INSTALL_DATA = @INSTALL_DATA@
91106 INSTALL_PROGRAM = @INSTALL_PROGRAM@
92107 INSTALL_SCRIPT = @INSTALL_SCRIPT@
97112 LIBTOOL = @LIBTOOL@
98113 LN_S = @LN_S@
99114 LTLIBOBJS = @LTLIBOBJS@
100 MAJOR_VERSION = @MAJOR_VERSION@
101115 MAKEINFO = @MAKEINFO@
102 MICRO_VERSION = @MICRO_VERSION@
103 MINOR_VERSION = @MINOR_VERSION@
104116 OBJEXT = @OBJEXT@
105117 PACKAGE = @PACKAGE@
106118 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
116128 SHELL = @SHELL@
117129 STRIP = @STRIP@
118130 VERSION = @VERSION@
119 VER_INFO = @VER_INFO@
120 ac_ct_AR = @ac_ct_AR@
131 XML2_CONFIG = @XML2_CONFIG@
132 XML_CPPFLAGS = @XML_CPPFLAGS@
133 XML_LIBS = @XML_LIBS@
121134 ac_ct_CC = @ac_ct_CC@
122135 ac_ct_CXX = @ac_ct_CXX@
123136 ac_ct_F77 = @ac_ct_F77@
124 ac_ct_RANLIB = @ac_ct_RANLIB@
125 ac_ct_STRIP = @ac_ct_STRIP@
126137 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
127138 am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
128139 am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
139150 build_os = @build_os@
140151 build_vendor = @build_vendor@
141152 datadir = @datadir@
153 datarootdir = @datarootdir@
154 docdir = @docdir@
155 dvidir = @dvidir@
142156 exec_prefix = @exec_prefix@
143157 host = @host@
144158 host_alias = @host_alias@
145159 host_cpu = @host_cpu@
146160 host_os = @host_os@
147161 host_vendor = @host_vendor@
162 htmldir = @htmldir@
148163 includedir = @includedir@
149164 infodir = @infodir@
150165 install_sh = @install_sh@
151166 libdir = @libdir@
152167 libexecdir = @libexecdir@
168 localedir = @localedir@
153169 localstatedir = @localstatedir@
154170 mandir = @mandir@
155171 mkdir_p = @mkdir_p@
156172 oldincludedir = @oldincludedir@
173 pdfdir = @pdfdir@
157174 prefix = @prefix@
158175 program_transform_name = @program_transform_name@
176 psdir = @psdir@
177 regular_CFLAGS = @regular_CFLAGS@
159178 sbindir = @sbindir@
160179 sharedstatedir = @sharedstatedir@
161180 slibdir = @slibdir@
162181 ssbindir = @ssbindir@
163182 sysconfdir = @sysconfdir@
164183 target_alias = @target_alias@
165 EXTRA_DIST = pam_mount.conf pam_mount_macros.te pam_mount.fc
184 EXTRA_DIST = pam_mount.conf.xml pam_mount_macros.te pam_mount.fc
166185 all: all-am
167186
168187 .SUFFIXES:
+0
-249
config/pam_mount.conf less more
0 # -*- sh -*-
1
2 # Turn on if you want to debug why some volume cannot be mounted etc.
3 # This can be overriden by user's local configuration
4 #
5 # Format: debug [ 1 | 0 ]
6 # Local user configuration can override this.
7 debug 1
8 # pmvarrun's debug variable is dictated by the 'pmvarrun' setting below.
9 # to enable pmvarrun debugging, add the -d option to it.
10
11
12 # Create mountpoint if it does not exist yet. This is a good thing.
13 mkmountpoint 1
14
15
16 # Loopback device to use to run fsck on loopback filesystems.
17 fsckloop /dev/loop7
18
19
20 #------------------------------------------------------------------------------
21 # Users' local configuration file (if there is none, comment this
22 # parameter out). Will be read as ~/<file>
23 #
24 # Note: you must include either options_allow or options_deny to use
25 # this directive. I recommend also including options_require.
26 #
27 # Individual users may define additional volumes to mount if allowed
28 # by pam_mount.conf (usually ~/.pam_mount.conf). The volume keyword is
29 # the only valid keyword in these per-user configuration files. If the
30 # luserconf parameter is set in pam_mount.conf, allowing user-defined
31 # volumes, users may mount and unmount any volumes they specify.
32 # The mount operation is executed under the user account, not with
33 # root permissions.
34 #
35 # Format: luserconf <file>
36 #
37 #luserconf .pam_mount.conf
38
39
40 #------------------------------------------------------------------------------
41 # These directives determine which options may be specified in a user config
42 # file (luserconf). You must include one of these directives if you have a
43 # luserconf directive. You may not include both directives.
44 #
45 # If you have an options_allow directive, then the options listed in that
46 # directive wil be allowed, and all others rejected. If you have an
47 # options_deny directive, then the options listed will be denied, and all others
48 # permitted.
49 #
50 # You may use the wildcard '*' to match all options.
51 # I recommend not permitting the suid and dev options.
52 #
53 options_allow nosuid,nodev,loop,encryption,fsck
54 #options_deny suid,dev
55 #options_allow *
56 #options_deny *
57
58
59 # The options listed in this directive are required for all volumes from a
60 # user config file. That is, any volume specified in a user config file that
61 # does not include these options will be ignored.
62 #
63 # Note: you must make sure that a required option is permitted (either by
64 # including it in options_allow, or by not including it in options_deny).
65 #
66 # I recommend requiring at least nosuid and nodev.
67 #
68 # This is ignored completely if the volume is configured to get its options
69 # and mount point from /etc/fstab.
70 #
71 options_require nosuid,nodev
72
73
74 #------------------------------------------------------------------------------
75 # Commands to mount/unmount volumes. They can take parameters, as shown.
76 #
77 # If you change the -p0 argument for lclmount, you'll need to modify the
78 # source in mount.c (it sends the password to the stdin file descriptor
79 # of the child process -- look for STDIN_FILENO).
80 #
81 lsof /usr/bin/lsof %(MNTPT)
82 fsck /sbin/fsck -p %(FSCKTARGET)
83 losetup /sbin/losetup -p0 "%(before=\"-e\" CIPHER)" "%(before=\"-k\" KEYBITS)" %(FSCKLOOP) %(VOLUME)
84 unlosetup /sbin/losetup -d %(FSCKLOOP)
85 cifsmount /bin/mount -t cifs //%(SERVER)/%(VOLUME) %(MNTPT) -o "user=%(USER),uid=%(USERUID),gid=%(USERGID)%(before=\",\" OPTIONS)"
86
87 smbmount /usr/bin/smbmount //%(SERVER)/%(VOLUME) %(MNTPT) -o "username=%(USER),uid=%(USERUID),gid=%(USERGID)%(before=\",\" OPTIONS)"
88 ncpmount /usr/bin/ncpmount %(SERVER)/%(USER) %(MNTPT) -o "pass-fd=0,volume=%(VOLUME)%(before=\",\" OPTIONS)"
89 smbumount /usr/bin/smbumount %(MNTPT)
90 ncpumount /usr/bin/ncpumount %(MNTPT)
91 fusemount /sbin/mount.fuse %(VOLUME) %(MNTPT) "%(before=\"-o\" OPTIONS)"
92 fuseumount /usr/bin/fusermount -u %(MNTPT)
93
94 # Linux supports lazy unmounting (-l). May be dangerous for encrypted volumes.
95 # May also break loopback mounts because loopback devices are not freed.
96 # Need to unmount mount point not volume to support SMB mounts, etc.
97 umount /bin/umount %(MNTPT)
98
99 # On OpenBSD try "/usr/local/bin/mount_ehd" (included in pam_mount package).
100 lclmount /bin/mount -p0 -t %(FSTYPE) %(VOLUME) %(MNTPT) "%(before=\"-o\" OPTIONS)"
101 cryptmount /bin/mount -t crypt "%(before=\"-o\" OPTIONS)" %(VOLUME) %(MNTPT)
102 nfsmount /bin/mount %(SERVER):%(VOLUME) %(MNTPT) "%(before=\"-o\" OPTIONS)"
103 mntagain /bin/mount --bind %(PREVMNTPT) %(MNTPT)
104 # For BSD: mntagain mount_null %(PREVMNTPT) %(MNTPT)
105 # For Solaris: mntagain mount -F lofs %(PREVMNTPT) %(MNTPT)
106 mntcheck /bin/mount # For BSDs (don't have /etc/mtab)
107 pmvarrun /usr/sbin/pmvarrun -u %(USER) -o %(OPERATION)
108
109
110 #------------------------------------------------------------------------------
111 # Volumes that will be mounted when user triggers the pam_mount module
112 # (usually at login).
113 #
114 # Format (one line):
115 # volume <user> <type> <server> <volume> <mount point>
116 # <mount options> <fs key cipher> <fs key path>
117 #
118 # - <user> is a user for which a volume rule applies.
119 # - "*" selects all users,
120 # - "@xyz" selects all users who have xyz as their primary group
121 # - "@@xyz" selects all users who either have xyz as their primary
122 # or secondary group (/etc/group)
123 #
124 # - If such a wildcard (* or @) is used, the '&' wildcard becomes available
125 # for <volume>, <mount point>, <mount options> and <fs key path>, and
126 # expands to the username that was used for login.
127 # - '~' expands to the user's home directory as present in the passwd
128 # database, but ONLY if it is the first char. (Like in bash; /import/~ does
129 # not equal /import/home/jengelh!)
130 # Examples see below.
131 #
132 # <type> can be any filesystem type. If /bin/mount or the kernel does not
133 # support it, you will get an error. You can use the special keyword "auto"
134 # which automatically lets the kernel choose a matching filesystem. Note
135 # that you the kernel's auto feature only works with filesystems listed in
136 # /proc/filesystem, so you will have to load the necessary modules *first*
137 # for them to be recognized with "auto".
138 #
139 # The "cifs", "smbfs" and "ncpfs" types override the identically-named kernel
140 # filesystems and use the smbmount/ncpmount programs, as defined above,
141 # instead of `mount -t smbfs ...`.
142 #
143 # Note that if the mount command has specified an option, e.g. %(KEYBITS)
144 # and you don't specify a value, a warning is printed in the log. The
145 # warning can usually be ignored, except when the option is mandatory.
146 #
147 # SMB mounts require the `smbmount` and `smbumount` programs,
148 # NCP `ncpmount` and `ncpumount`. Both SMB and NCP work in ~/.pam_mount.conf.
149 #
150 # General examples:
151 # volume user smbfs krueger public /home/user/krueger - - -
152 # volume user ncpfs krueger public /home/user/krueger user=user.context - -
153 # volume * smbfs krueger homes /home/&/remote dmask=0711 - -
154 # Useful for pam_chroot:
155 # volume * auto - /bin /home/&/bin - - -
156 # For FUSE mounts, example sshfs:
157 # volume * fuse - "sshfs#&@fileserver:" /home/& - - -
158 # Or...
159 # volume * fuse - "sshfs#&@fileserver:" ~ - - -
160 # volume * nfs server /home/& ~ - - -
161 # Some more examples:
162 # volume * auto - /home/&.img ~ - aes-256-ecb /etc/ehd/&
163 # Windows 2000, which requires a domain specified, example (thanks John Knox):
164 # volume * smbfs viper & /home/& uid=&,gid=&,dmask=0751,workgroup=WINDOWS_DOMAIN - -
165 # An NCP example:
166 # volume user ncpfs SERVER /USERS/Department/user /home/user user=user.full.context,uid=user,gid=user,symlinks - -
167 # An example using spaces:
168 # volume * smbfs krueger 'Home Directories' /home/& - - -
169 # volume * smbfs krueger Home\ Directories /home/& - - -
170
171
172 #------------------------------------------------------------------------------
173 # Linux encrypted home directory examples, using dm_crypt:
174 #
175 # crypt mounts require a kernel with CONFIG_BLK_DEV_DM and CONFIG_DM_CRYPT
176 # enabled as well as all the used ciphers (e.g. CONFIG_CRYPTO_AES_586,
177 # CONFIG_CRYPTO_TWOFISH, etc.).
178 # crypt mounts must be in the global config file /etc/security/pam_mount.conf
179 # volume user crypt - /dev/sda2 /home/user cipher=aes,fsck aes-256-ecb /home/user.key
180 #
181 # Linux encrypted home directory examples, using dm_crypt:
182 # volume user crypt - /dev/sda2 /home/user cipher=aes aes-256-ecb /home/user.key
183
184
185 # cryptoloop mounts require a kernel with CONFIG_BLK_DEV_CRYPTOLOOP enabled.
186 # cryptoloop mounts must be in the global config /etc/security/pam_mount.conf
187 # Linux encrypted home directory examples, using cryptoloop:
188 #
189 # volume user auto - /dev/hda123 /home/user loop,encryption=aes - -
190 # volume user auto - /home/user.img /home/user loop,user,exec,encryption=aes,keybits=256 - -
191 # volume user auto - /home/user.img - - - -
192 # volume user auto - /home/user.img - - aes-256-ecb /home/user4.key
193
194 # The last two examples (^^) need a line like the following in
195 # /etc/fstab:
196 # /home/user4.img /home/user4 xfs user,loop,encryption=aes,keybits=256,noauto 0 0
197
198
199 # OpenBSD encrypted home directory example (see also lclmount above):
200 # volume user auto - /home/user.img /home/user svnd0 - -
201
202
203 # Volatile tmpfs mount with restricted size
204 # (thanks to Mike Hommey for this example)
205 # volume test tmpfs - /tmpfs/test /home/test "size=10M,uid=test,gid=users,mode=0700 -t tmpfs" - -
206
207
208 # Details:
209 # Local user configuration (~/.pam_mount.conf) can extend this.
210 #
211 # If there are no servers, mount options, fs key ciphers, etc. you must
212 # supply a lone dash, i.e. "-"
213 #
214 # See http://www.tldp.org/HOWTO/Loopback-Encrypted-Filesystem-HOWTO.html
215 # to learn how to create a encrypted loopback filesystem.
216 #
217 # If the volume's password is different than the user's login password,
218 # the following technique may be used (see also README):
219 #
220 # {...} are placeholders, insert the proper value there!
221 #
222 # 1. Create a file containing the volume's password (FS key). If you are
223 # using pam_mount to mount an loopback encrypted volume, this password
224 # should be generated with /dev/urandom.
225 #
226 # Simple example:
227 # echo {volume password} | openssl enc -aes-256-ecb >/home/user.key
228 # Encrypt this file using the user's login password as the key.
229 #
230 # Verbose loopback encrypted volume example:
231 # a. dd if=/dev/urandom of=/home/user.img bs=1M count={image size in MB}
232 # b. dd if=/dev/urandom bs=1c count={keysize/8} | \
233 # openssl enc -{fs key cipher} >/home/user.key
234 # Encrypt this file using the user's login password as the key.
235 # c. modprobe -q cryptoloop
236 # d. openssl enc -d -{fs key cipher} -in /home/user.key | \
237 # losetup -e aes -k {keysize} -p0 /dev/loop0 /home/user.img
238 # e. mkfs -t ext2 /dev/loop0
239 # f. losetup -d /dev/loop0
240 #
241 # 3. In pam_mount.conf:
242 # a. Set the fs key cipher variable to the cipher used (ie: aes-256-ecb).
243 # b. Set the fs key path variable to the key's path (ie: /home/user.key)
244 # 4. If a user changes his login password, regenerate the efsk that
245 # was created in step 1b. A script named passwdehd is provided to do this.
246 #
247 # If fs_key_cipher is -, then the user's login password is also the volume's
248 # password.
0 <?xml version="1.0" encoding="utf-8" ?>
1 <pam_mount>
2
3 <!--
4 NOTE: Special characters like < > and & require escaping them to &lt; &gt;
5 and &amp; according to the XML standard. Though, you really should not use
6 them in pathnames.
7
8 Do not use comments inside tags like <lsof></lsof> - the case is not
9 handled by the parser.
10 -->
11
12
13 <!-- Turn on if you want to debug why some volume cannot be mounted etc.
14 This can be overriden by user's local configuration. This will also affect
15 the pmvarrun helper program. To disable, use enable="0" or comment it out
16 entirely. -->
17 <debug enable="0" />
18
19
20 <!--
21 Create mountpoint if it does not exist yet. This is a good thing.
22
23 If enabled, and a mountpoint was created by pam_mount, the mountpoint will
24 be removed again on logout. To disable this behavior, use remove="false".
25 -->
26 <mkmountpoint enable="1" remove="true" />
27
28
29 <!-- Loopback device to use to run fsck on loopback filesystems. -->
30 <fsckloop device="/dev/loop7" />
31
32
33 <!--
34 Users' local configuration file (if there is none, comment this parameter
35 out). Will be read as ~/<file>.
36
37 Note: you must include either options_allow or options_deny to use this
38 directive. I recommend also including options_require.
39
40 Individual users may define additional volumes to mount if allowed by
41 pam_mount.conf.xml (usually ~/.pam_mount.conf.xml). The volume keyword is
42 the only valid keyword in these per-user configuration files. If the
43 luserconf parameter is set in pam_mount.conf.xml, allowing user-defined
44 volumes, users may mount and unmount any volumes they specify. The mount
45 operation is executed under the user account, not with root permissions.
46
47 <luserconf name=".pam_mount.conf.xml" />
48 -->
49
50
51 <!--
52 These directives determine which options may be specified in a user config
53 file (luserconf). You must include one of these directives if you have a
54 luserconf directive. You may not include both directives.
55
56 If you have an options_allow directive, then the options listed in that
57 directive wil be allowed, and all others rejected. If you have an
58 options_deny directive, then the options listed will be denied, and all
59 others permitted.
60
61 You may use the wildcard '*' to match all options. I recommend not
62 permitting the suid and dev options.
63 -->
64
65 <mntoptions allow="nosuid,nodev,loop,encryption,fsck,nonempty,allow_root,allow_other" />
66 <!--
67 <mntoptions deny="suid,dev" />
68 <mntoptions allow="*" />
69 <mntoptions deny="*" />
70 -->
71
72
73 <!--
74 The options listed in this directive are required for all volumes from a
75 user config file. That is, any volume specified in a user config file that
76 does not include these options will be ignored.
77
78 Note: you must make sure that a required option is permitted (either by
79 including it in options_allow, or by not including it in options_deny).
80
81 I recommend requiring at least nosuid and nodev.
82
83 This is ignored completely if the volume is configured to get its options
84 and mount point from /etc/fstab.
85 -->
86 <mntoptions require="nosuid,nodev" />
87
88
89 <!--
90 Commands to mount/unmount volumes. They can take parameters, as shown.
91
92 If you change the -p0 argument for lclmount, you'll need to modify the
93 source in mount.c (it sends the password to the stdin file descriptor of
94 the child process - look for STDIN_FILENO).
95
96 You can specify either absolute paths, or short ones. In the latter case,
97 PATH will be searched, so ensure that your login process and/or the PAM
98 subsystem has PATH set properly.
99 (E.g. PATH=/sbin:/bin:/usr/sbin:/usr/bin is a good choice.)
100 -->
101
102 <lsof>lsof %(MNTPT)</lsof>
103
104 <fsck>fsck -p %(FSCKTARGET)</fsck>
105
106 <losetup>losetup -p0 "%(before=\"-e\" CIPHER)"
107 "%(before=\"-k\" KEYBITS)" %(FSCKLOOP) %(VOLUME)</losetup>
108
109 <unlosetup>losetup -d %(FSCKLOOP)</unlosetup>
110
111 <cifsmount>mount -t cifs //%(SERVER)/%(VOLUME) %(MNTPT) -o
112 "user=%(USER),uid=%(USERUID),gid=%(USERGID)%(before=\",\" OPTIONS)"</cifsmount>
113
114 <davmount>mount -t davfs %(SERVER)/%(VOLUME) %(MNTPT) -o
115 "username=%(USER),uid=%(USERUID),gid=%(USERGID)%(before=\",\"
116 OPTIONS)"</davmount>
117
118 <smbmount>smbmount //%(SERVER)/%(VOLUME) %(MNTPT) -o
119 "username=%(USER),uid=%(USERUID),gid=%(USERGID)%(before=\",\" OPTIONS)"</smbmount>
120
121 <smbumount>smbumount %(MNTPT)</smbumount>
122
123 <ncpmount>ncpmount %(SERVER)/%(USER) %(MNTPT) -o
124 "pass-fd=0,volume=%(VOLUME)%(before=\",\" OPTIONS)"</ncpmount>
125
126 <ncpumount>ncpumount %(MNTPT)</ncpumount>
127
128 <fusemount>mount.fuse %(VOLUME) %(MNTPT) "%(before=\"-o\" OPTIONS)"</fusemount>
129
130 <fuseumount>fusermount -u %(MNTPT)</fuseumount>
131
132 <truecryptmount>truecrypt %(VOLUME) %(MNTPT)</truecryptmount>
133
134 <truecryptumount>truecrypt -d %(MNTPT)</truecryptumount>
135
136 <!-- Linux supports lazy unmounting (-l). May be dangerous for encrypted
137 volumes. May also break loopback mounts because loopback devices are not
138 freed. Need to unmount mount point (not volume!) to support SMB mounts,
139 etc. -->
140 <umount>umount %(MNTPT)</umount>
141
142
143 <!-- On OpenBSD try "/usr/local/bin/mount_ehd" (included in pam_mount
144 package). -->
145 <lclmount>mount -p0 -t %(FSTYPE) %(VOLUME) %(MNTPT)
146 "%(before=\"-o\" OPTIONS)"</lclmount>
147
148 <cryptmount>mount -t crypt "%(before=\"-o\" OPTIONS)"
149 %(VOLUME) %(MNTPT)</cryptmount>
150
151 <nfsmount>mount %(SERVER):%(VOLUME) %(MNTPT)
152 "%(before=\"-o\" OPTIONS)"</nfsmount>
153
154 <mntagain>mount --bind %(PREVMNTPT) %(MNTPT)</mntagain>
155
156 <!-- For BSD:
157 <mntagain>mount_null %(PREVMNTPT) %(MNTPT)</mntagain>
158 -->
159 <!-- For solaris:
160 <mntagain>mount -F lofs %(PREVMNTPT) %(MNTPT)</mntagain>
161 -->
162
163
164 <!-- mntcheck utility for BSDs which lack /etc/mtab -->
165 <mntcheck>mount</mntcheck>
166
167 <pmvarrun>pmvarrun -u %(USER) -o %(OPERATION)</pmvarrun>
168
169 <!--
170 Volumes that will be mounted when user triggers the pam_mount module
171 (usually at login).
172
173 <volume
174 user="*" | pgrp="foo" | sgrp="bar"
175 invert="1"
176 fstype="auto"
177 server="..."
178 path="..."
179 mountpoint="..."
180 options="..."
181 fskeycipher="..."
182 fskeypath="..."
183 />
184
185
186 USER is a user for which a volume rule applies, "*" selects all users.
187
188 A volume with PGRP attribute will be mounted when a user has that
189 particular group as its primary group. A volume with SGRP attribute will
190 be mounted when the user has the group as either primary or secondary.
191
192 USER, PGRP and SGRP are mutually exclusive. If neither is present,
193 USER="*" is assumed.
194
195 INVERT will invert the sense of the USER, PGRP or SGRP selector, thereby
196 making it possible to specify, e.g. "all users not in group xyz".
197
198
199 FSTYPE can be any filesystem type. If /bin/mount or the kernel does not
200 support it, you will get an error. You can use the special keyword "auto"
201 which automatically lets the kernel choose a matching filesystem. Note
202 that the kernel's auto feature only works with currently loaded
203 filesystems (listed in /proc/filesystem), so you will have to load the
204 necessary modules _first_ for them to be recognized with "auto". If this
205 attribute is not present, "auto" is assumed.
206
207 The "cifs", "davfs", "smbfs", "ncpfs", "fuse" and "truecrypt" types
208 override the identically-named kernel filesystems and use the
209 helper programs as defined above.
210
211
212 SERVER defines the server from which to source. The exact volume path
213 depends on the filesystem type. SMB uses //SERVER/VOLUME, NFS uses
214 SERVER:VOLUME. davfs uses SERVER/VOLUME. The attribute may be absent.
215
216
217 PATH specifies the location of the volume, locally or on the server (if
218 applies), respectively. This attribute is mandatory.
219
220
221 MOUNTPOINT specifies the destination directory onto which the volume is
222 mounted. '~' expands to the user's home directory as present in the passwd
223 database, according to sh semantics. "~name" is not supported. If this
224 attribute is omitted, the location is read from /etc/fstab, which also
225 requires PATH to be the device of an fstab entry.
226
227
228 OPTIONS specifies mount options. If omitted, and /etc/fstab is used (see
229 MOUNTPOINT), then the options are also sourced from fstab.
230
231
232 Note that if the mount command has specified an option, e.g. %(KEYBITS)
233 and you do not specify a value, a warning is printed in the log. The
234 warning can usually be ignored, except when the option is mandatory.
235
236 SMB mounts require the `smbmount` and `smbumount` programs, NCP `ncpmount`
237 and `ncpumount`. Both SMB and NCP work in ~/.pam_mount.conf.xml.
238
239
240 General examples:
241
242 <volume user="user" fstype="smbfs" server="krueger" path="public"
243 mountpoint="/home/user/krueger" />
244
245 <volume user="user" fstype="ncpfs" server="krueger" path="public"
246 mountpoint="/home/user/krueger" options="user=user.context" />
247
248 <volume fstype="smbfs" server="krueger" path="homes"
249 mountpoint="/home/%(USER)/remote" options="dmask=0711" />
250
251 <volume fstype="davfs" server="https://dev.computergmbh.de/"
252 path="/svn/libHX/trunk" mountpoint="/projects/libHX" />
253
254 You can use ~ to use whatever home directory the user has (therefore you
255 can distribute home directories along more than one location. This is
256 useful for pam_chroot:
257
258 <volume path="/bin" mountpoint="~/bin" options="bind" />
259
260 For FUSE mounts, use something like this:
261
262 <volume fstype="fuse" path="sshfs#%(USER)@fileserver:"
263 mountpoint="~" />
264
265 <volume fstype="nfs" server="fileserver" path="/home/%(USER)"
266 mountpoint="~" />
267
268 Some more examples:
269
270 <volume path="/home/%(USER).img" mountpoint="~" fskeycipher="aes-256-ecb"
271 fskeypath="/etc/ehd/%(USER)" />
272
273 Windows 2000, which requires a domain specified (does it really? works for
274 me without -jengelh), example (thanks John Knox):
275
276 <volume fstype="smbfs" server="viper" path="%(USER)"
277 mountpoint="~" options="dmask=0751,workgroup=WINDOWS_DOMAIN" />
278
279 -->
280
281
282 <!--
283 Linux encrypted home directory examples, using dm_crypt:
284
285 crypt mounts require a kernel with CONFIG_BLK_DEV_DM and CONFIG_DM_CRYPT
286 enabled as well as all the used ciphers (e.g. CONFIG_CRYPTO_AES_586,
287 CONFIG_CRYPTO_TWOFISH, etc.). crypt mounts must be in the global config
288 file /etc/security/pam_mount.conf.xml.
289
290 Linux encrypted home directory examples, using dm_crypt:
291
292 <volume fstype="crypt" path="/dev/sda2" mountpoint="/home/user"
293 options="cipher=aes" fskeycipher="aes-256-ecb"
294 fskeypath="/home/user.key" />
295
296 cryptoloop mounts require a kernel with CONFIG_BLK_DEV_CRYPTOLOOP enabled.
297 cryptoloop mounts must be in the global config
298 /etc/security/pam_mount.conf.xml. Linux encrypted home directory examples,
299 using cryptoloop:
300
301 <volume path="/dev/hda123" mountpoint="/home/user"
302 options="loop,encryption=aes" />
303
304 <volume path="/home/user.img" mountpoint="/home/user"
305 options="loop,user,exec,encryption=aes,keybits=256" />
306
307 <volume path="/home/user.img" />
308
309 <volume path="/home/user.img" fskeycipher="aes-256-ecb"
310 fskeypath="/home/user4.key" />
311
312 The last two examples (^^) need a line like the following in /etc/fstab:
313
314 /home/user4.img /home/user4 xfs user,loop,encryption=aes,keybits=256,noauto 0 0
315
316 OpenBSD encrypted home directory example (see also lclmount above):
317
318 <volume path="/home/user.img" mountpoint="/home/user"
319 options="svnd0" />
320
321 Volatile tmpfs mount with restricted size (thanks to Mike Hommey for this
322 example):
323
324 <volume user="test" fstype="tmpfs" path="none" mountpoint="/home/test"
325 options="size=10M,uid=test,gid=users,mode=0700" />
326
327 See http://www.tldp.org/HOWTO/Loopback-Encrypted-Filesystem-HOWTO.html to
328 learn how to create a encrypted loopback filesystem.
329
330 If the volume's password is different than the user's login password, the
331 following technique may be used (see also README):
332
333 {...} are placeholders, insert the proper value there!
334
335 1. Create a file containing the volume's password (FS key). If you are
336 using pam_mount to mount an loopback encrypted volume, this password
337 should be generated with /dev/urandom.
338
339 Simple example:
340 echo {volume password} | openssl enc -aes-256-ecb >/home/user.key
341 Encrypt this file using the user's login password as the key.
342
343 Verbose loopback encrypted volume example:
344 a. dd if=/dev/urandom of=/home/user.img bs=1M count={image size in MB}
345 b. dd if=/dev/urandom bs=1c count={keysize/8} | \
346 openssl enc -{fs key cipher} >/home/user.key
347 Encrypt this file using the user's login password as the key.
348 c. modprobe -q cryptoloop
349 d. openssl enc -d -{fs key cipher} -in /home/user.key | \
350 losetup -e aes -k {keysize} -p0 /dev/loop0 /home/user.img
351 e. mkfs -t ext2 /dev/loop0
352 f. losetup -d /dev/loop0
353
354 3. In pam_mount.conf.xml:
355 a. Set the fs key cipher variable to the cipher used
356 (ie: aes-256-ecb).
357 b. Set the fs key path variable to the key's path
358 (ie: /home/user.key)
359
360 4. If a user changes his login password, regenerate the efsk that was
361 created in step 1b. A script named passwdehd is provided to do this.
362
363 If FSKEYCIPHER is empty, then the user's login password is also the
364 volume's password.
365 -->
366
367 <!--
368 When pam_mount is not used with "use_first_pass" or "try_first_pass" in
369 the PAM configuration files (/etc/pam.d/), it will have to ask for a
370 password. This is also the case if pam_mount is the first auth module
371 in the block.
372 -->
373 <msg-authpw>pam_mount password:</msg-authpw>
374
375 <!--
376 In case the 'session' PAM block does not have the password (e.g. on su
377 from root to user), it will ask again.
378 -->
379 <msg-sessionpw>reenter password for pam_mount:</msg-sessionpw>
380
381 </pam_mount>
99 domain_auto_trans($2_t, pam_mount_exec_t, pam_mount_t)
1010
1111 # FIXME: should have more fine-grained types
12 # read /etc/pam_mount.conf and ~/.pam_mount.conf
12 # read /etc/pam_mount.conf.xml and ~/.pam_mount.conf.xml
1313 allow $2_t etc_runtime_t:file { getattr read };
1414 allow $2_t user_home_t:file { getattr read };
1515
00 #! /bin/sh
11 # Attempt to guess a canonical system name.
22 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4
5 timestamp='2005-07-08'
3 # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
4 # Inc.
5
6 timestamp='2006-05-13'
67
78 # This file is free software; you can redistribute it and/or modify it
89 # under the terms of the GNU General Public License as published by
105106 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
106107 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
107108 : ${TMPDIR=/tmp} ;
108 { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
109 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
109110 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
110111 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
111112 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
215216 *:ekkoBSD:*:*)
216217 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
217218 exit ;;
219 *:SolidBSD:*:*)
220 echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
221 exit ;;
218222 macppc:MirBSD:*:*)
219223 echo powerppc-unknown-mirbsd${UNAME_RELEASE}
220224 exit ;;
773777 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
774778 exit ;;
775779 *:FreeBSD:*:*)
776 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
780 case ${UNAME_MACHINE} in
781 pc98)
782 echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
783 amd64)
784 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
785 *)
786 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
787 esac
777788 exit ;;
778789 i*:CYGWIN*:*)
779790 echo ${UNAME_MACHINE}-pc-cygwin
788799 i*:PW*:*)
789800 echo ${UNAME_MACHINE}-pc-pw32
790801 exit ;;
791 x86:Interix*:[34]*)
792 echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
802 x86:Interix*:[345]*)
803 echo i586-pc-interix${UNAME_RELEASE}
804 exit ;;
805 EM64T:Interix*:[345]*)
806 echo x86_64-unknown-interix${UNAME_RELEASE}
793807 exit ;;
794808 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
795809 echo i${UNAME_MACHINE}-pc-mks
803817 i*:UWIN*:*)
804818 echo ${UNAME_MACHINE}-pc-uwin
805819 exit ;;
806 amd64:CYGWIN*:*:*)
820 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
807821 echo x86_64-unknown-cygwin
808822 exit ;;
809823 p*:CYGWIN*:*)
824838 echo ${UNAME_MACHINE}-pc-minix
825839 exit ;;
826840 arm*:Linux:*:*)
827 echo ${UNAME_MACHINE}-${VENDOR}-linux
841 echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
828842 exit ;;
829843 cris:Linux:*:*)
830 echo cris-axis-linux
844 echo cris-axis-linux-gnu
831845 exit ;;
832846 crisv32:Linux:*:*)
833 echo crisv32-axis-linux
847 echo crisv32-axis-linux-gnu
834848 exit ;;
835849 frv:Linux:*:*)
836 echo frv-${VENDOR}-linux
850 echo frv-${VENDOR}-linux-gnu
837851 exit ;;
838852 ia64:Linux:*:*)
839 echo ${UNAME_MACHINE}-${VENDOR}-linux
853 echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
840854 exit ;;
841855 m32r*:Linux:*:*)
842 echo ${UNAME_MACHINE}-${VENDOR}-linux
856 echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
843857 exit ;;
844858 m68*:Linux:*:*)
845 echo ${UNAME_MACHINE}-${VENDOR}-linux
859 echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
846860 exit ;;
847861 mips:Linux:*:*)
848862 eval $set_cc_for_build
860874 #endif
861875 #endif
862876 EOF
863 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
864 test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux"; exit; }
877 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
878 /^CPU/{
879 s: ::g
880 p
881 }'`"
882 test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-gnu"; exit; }
865883 ;;
866884 mips64:Linux:*:*)
867885 eval $set_cc_for_build
879897 #endif
880898 #endif
881899 EOF
882 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
883 test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux"; exit; }
900 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
901 /^CPU/{
902 s: ::g
903 p
904 }'`"
905 test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-gnu"; exit; }
884906 ;;
907 or32:Linux:*:*)
908 echo or32-${VENDOR}-linux-gnu
909 exit ;;
885910 ppc:Linux:*:*)
886 echo powerpc-${VENDOR}-linux
911 echo powerpc-${VENDOR}-linux-gnu
887912 exit ;;
888913 ppc64:Linux:*:*)
889 echo powerpc64-${VENDOR}-linux
914 echo powerpc64-${VENDOR}-linux-gnu
890915 exit ;;
891916 alpha:Linux:*:*)
892917 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
900925 esac
901926 objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
902927 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
903 echo ${UNAME_MACHINE}-${VENDOR}-linux${LIBC}
928 echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu${LIBC}
904929 exit ;;
905930 parisc:Linux:*:* | hppa:Linux:*:*)
906931 # Look for CPU level
907932 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
908 PA7*) echo hppa1.1-${VENDOR}-linux ;;
909 PA8*) echo hppa2.0-${VENDOR}-linux ;;
910 *) echo hppa-${VENDOR}-linux ;;
933 PA7*) echo hppa1.1-${VENDOR}-linux-gnu ;;
934 PA8*) echo hppa2.0-${VENDOR}-linux-gnu ;;
935 *) echo hppa-${VENDOR}-linux-gnu ;;
911936 esac
912937 exit ;;
913938 parisc64:Linux:*:* | hppa64:Linux:*:*)
914 echo hppa64-${VENDOR}-linux
939 echo hppa64-${VENDOR}-linux-gnu
915940 exit ;;
916941 s390:Linux:*:* | s390x:Linux:*:*)
917942 echo ${UNAME_MACHINE}-ibm-linux
918943 exit ;;
919944 sh64*:Linux:*:*)
920 echo ${UNAME_MACHINE}-${VENDOR}-linux
945 echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
921946 exit ;;
922947 sh*:Linux:*:*)
923 echo ${UNAME_MACHINE}-${VENDOR}-linux
948 echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
924949 exit ;;
925950 sparc:Linux:*:* | sparc64:Linux:*:*)
926 echo ${UNAME_MACHINE}-${VENDOR}-linux
951 echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
952 exit ;;
953 vax:Linux:*:*)
954 echo ${UNAME_MACHINE}-dec-linux-gnu
927955 exit ;;
928956 x86_64:Linux:*:*)
929 echo x86_64-${VENDOR}-linux
957 echo x86_64-${VENDOR}-linux-gnu
930958 exit ;;
931959 i*86:Linux:*:*)
932960 # The BFD linker knows what the default object file format is, so
941969 p'`
942970 case "$ld_supported_targets" in
943971 elf32-i386)
944 TENTATIVE="${UNAME_MACHINE}-${VENDOR}-linux"
972 TENTATIVE="${UNAME_MACHINE}-${VENDOR}-linux-gnu"
945973 ;;
946974 a.out-i386-linux)
947 echo "${UNAME_MACHINE}-${VENDOR}-linuxaout"
975 echo "${UNAME_MACHINE}-${VENDOR}-linux-gnuaout"
948976 exit ;;
949977 coff-i386)
950 echo "${UNAME_MACHINE}-${VENDOR}-linuxcoff"
978 echo "${UNAME_MACHINE}-${VENDOR}-linux-gnucoff"
951979 exit ;;
952980 "")
953 # Either a pre-BFD a.out linker (linuxoldld) or
981 # Either a pre-BFD a.out linker (linux-gnuoldld) or
954982 # one that does not give us useful --help.
955 echo "${UNAME_MACHINE}-${VENDOR}-linuxoldld"
983 echo "${UNAME_MACHINE}-${VENDOR}-linux-gnuoldld"
956984 exit ;;
957985 esac
958986 # Determine whether the default compiler is a.out or elf
970998 LIBC=gnulibc1
971999 # endif
9721000 #else
973 #ifdef __INTEL_COMPILER
1001 #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
9741002 LIBC=gnu
9751003 #else
9761004 LIBC=gnuaout
9801008 LIBC=dietlibc
9811009 #endif
9821010 EOF
983 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
1011 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
1012 /^LIBC/{
1013 s: ::g
1014 p
1015 }'`"
9841016 test x"${LIBC}" != x && {
985 echo "${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}" | sed 's/linux-gnu/linux/'
1017 echo "${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}"
9861018 exit
9871019 }
9881020 test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
11911223 *:Darwin:*:*)
11921224 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
11931225 case $UNAME_PROCESSOR in
1194 *86) UNAME_PROCESSOR=i686 ;;
11951226 unknown) UNAME_PROCESSOR=powerpc ;;
11961227 esac
11971228 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
12691300 exit ;;
12701301 i*86:skyos:*:*)
12711302 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1303 exit ;;
1304 i*86:rdos:*:*)
1305 echo ${UNAME_MACHINE}-pc-rdos
12721306 exit ;;
12731307 esac
12741308
1414 /* Define to 1 if you have the <memory.h> header file. */
1515 #undef HAVE_MEMORY_H
1616
17 /* Define to 1 if you have the `setfsuid' function. */
18 #undef HAVE_SETFSUID
19
2017 /* Define to 1 if you have the <stdint.h> header file. */
2118 #undef HAVE_STDINT_H
2219
2926 /* Define to 1 if you have the <string.h> header file. */
3027 #undef HAVE_STRING_H
3128
29 /* Define to 1 if `lo_file_name' is member of `struct loop_info64'. */
30 #undef HAVE_STRUCT_LOOP_INFO64_LO_FILE_NAME
31
3232 /* Define to 1 if you have the <sys/stat.h> header file. */
3333 #undef HAVE_SYS_STAT_H
3434
4040
4141 /* True if compiler supports -fvisibility=hidden */
4242 #undef HAVE_VISIBILITY_HIDDEN
43
44 /* Define to 1 if your C compiler doesn't accept -c and -o together. */
45 #undef NO_MINUS_C_MINUS_O
4346
4447 /* Name of package */
4548 #undef PACKAGE
00 #! /bin/sh
11 # Configuration validation subroutine script.
22 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4
5 timestamp='2005-07-08'
3 # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
4 # Inc.
5
6 timestamp='2006-05-13'
67
78 # This file is (in principle) common to ALL GNU software.
89 # The presence of a machine in this file suggests that SOME GNU software
118119 # Here we must recognize all the valid KERNEL-OS combinations.
119120 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
120121 case $maybe_os in
121 nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
122 kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
122 nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
123 uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
124 storm-chaos* | os2-emx* | rtmk-nova*)
123125 os=-$maybe_os
124126 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
125127 ;;
170172 -hiux*)
171173 os=-hiuxwe2
172174 ;;
175 -sco6)
176 os=-sco5v6
177 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
178 ;;
173179 -sco5)
174180 os=-sco3.2v5
175181 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
183189 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
184190 ;;
185191 -sco3.2v[4-9]*)
192 # Don't forget version if it is 3.2v4 or newer.
193 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
194 ;;
195 -sco5v6*)
186196 # Don't forget version if it is 3.2v4 or newer.
187197 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
188198 ;;
238248 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
239249 | i370 | i860 | i960 | ia64 \
240250 | ip2k | iq2000 \
241 | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
251 | m32c | m32r | m32rle | m68000 | m68k | m88k \
252 | maxq | mb | microblaze | mcore \
242253 | mips | mipsbe | mipseb | mipsel | mipsle \
243254 | mips16 \
244255 | mips64 | mips64el \
256267 | mipsisa64sr71k | mipsisa64sr71kel \
257268 | mipstx39 | mipstx39el \
258269 | mn10200 | mn10300 \
259 | ms1 \
270 | mt \
260271 | msp430 \
272 | nios | nios2 \
261273 | ns16k | ns32k \
262274 | or32 \
263275 | pdp10 | pdp11 | pj | pjl \
264276 | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
265277 | pyramid \
266 | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
278 | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
267279 | sh64 | sh64le \
268 | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
269 | sparcv8 | sparcv9 | sparcv9b \
270 | strongarm \
280 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
281 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
282 | spu | strongarm \
271283 | tahoe | thumb | tic4x | tic80 | tron \
272284 | v850 | v850e \
273285 | we32k \
275287 | z8k)
276288 basic_machine=$basic_machine-unknown
277289 ;;
278 m32c)
279 basic_machine=$basic_machine-unknown
280 ;;
281290 m6811 | m68hc11 | m6812 | m68hc12)
282291 # Motorola 68HC11/12.
283292 basic_machine=$basic_machine-unknown
284293 os=-none
285294 ;;
286295 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
296 ;;
297 ms1)
298 basic_machine=mt-unknown
287299 ;;
288300
289301 # We use `pc' rather than `unknown'
315327 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
316328 | i*86-* | i860-* | i960-* | ia64-* \
317329 | ip2k-* | iq2000-* \
318 | m32r-* | m32rle-* \
330 | m32c-* | m32r-* | m32rle-* \
319331 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
320332 | m88110-* | m88k-* | maxq-* | mcore-* \
321333 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
335347 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
336348 | mipstx39-* | mipstx39el-* \
337349 | mmix-* \
338 | ms1-* \
350 | mt-* \
339351 | msp430-* \
352 | nios-* | nios2-* \
340353 | none-* | np1-* | ns16k-* | ns32k-* \
341354 | orion-* \
342355 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
343356 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
344357 | pyramid-* \
345358 | romp-* | rs6000-* \
346 | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
359 | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
347360 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
348 | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
361 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
349362 | sparclite-* \
350 | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
363 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
351364 | tahoe-* | thumb-* \
352365 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
353366 | tron-* \
358371 | ymp-* \
359372 | z8k-*)
360373 ;;
361 m32c-*)
362 ;;
363374 # Recognize the various machine names and aliases which stand
364375 # for a CPU type and a company and sometimes even an OS.
365376 386bsd)
694705 msdos)
695706 basic_machine=i386-pc
696707 os=-msdos
708 ;;
709 ms1-*)
710 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
697711 ;;
698712 mvs)
699713 basic_machine=i370-ibm
802816 pc532 | pc532-*)
803817 basic_machine=ns32k-pc532
804818 ;;
819 pc98)
820 basic_machine=i386-pc
821 ;;
822 pc98-*)
823 basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
824 ;;
805825 pentium | p5 | k5 | k6 | nexgen | viac3)
806826 basic_machine=i586-pc
807827 ;;
857877 pw32)
858878 basic_machine=i586-unknown
859879 os=-pw32
880 ;;
881 rdos)
882 basic_machine=i386-pc
883 os=-rdos
860884 ;;
861885 rom68k)
862886 basic_machine=m68k-rom68k
11001124 sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
11011125 basic_machine=sh-unknown
11021126 ;;
1103 sparc | sparcv8 | sparcv9 | sparcv9b)
1127 sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
11041128 basic_machine=sparc-sun
11051129 ;;
11061130 cydra)
11731197 | -aos* \
11741198 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
11751199 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1176 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
1200 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1201 | -openbsd* | -solidbsd* \
11771202 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
11781203 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
11791204 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
11801205 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
11811206 | -chorusos* | -chorusrdb* \
11821207 | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1183 | -mingw32* | -linux* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
1208 | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
1209 | -uxpv* | -beos* | -mpeix* | -udk* \
11841210 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
11851211 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
11861212 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
11871213 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
11881214 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
11891215 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1190 | -skyos* | -haiku*)
1216 | -skyos* | -haiku* | -rdos*)
11911217 # Remember, each alternative MUST END IN *, to match a version number.
11921218 ;;
11931219 -qnx*)
12141240 -linux-dietlibc)
12151241 os=-linux-dietlibc
12161242 ;;
1243 -linux*)
1244 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1245 ;;
12171246 -sunos5*)
12181247 os=`echo $os | sed -e 's|sunos5|solaris2|'`
12191248 ;;
13361365 # system, and we'll never get to this point.
13371366
13381367 case $basic_machine in
1368 spu-*)
1369 os=-elf
1370 ;;
13391371 *-acorn)
13401372 os=-riscix1.2
13411373 ;;
13451377 arm*-semi)
13461378 os=-aout
13471379 ;;
1348 c4x-* | tic4x-*)
1349 os=-coff
1350 ;;
1380 c4x-* | tic4x-*)
1381 os=-coff
1382 ;;
13511383 # This must come before the *-dec entry.
13521384 pdp10-*)
13531385 os=-tops20
+5050
-3378
configure less more
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.59.
2 # Generated by GNU Autoconf 2.60 for pam_mount 0.20.
33 #
4 # Copyright (C) 2003 Free Software Foundation, Inc.
4 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
5 # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
56 # This configure script is free software; the Free Software Foundation
67 # gives unlimited permission to copy, distribute and modify it.
78 ## --------------------- ##
1516 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
1617 # is contrary to our usage. Disable this feature.
1718 alias -g '${1+"$@"}'='"$@"'
18 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
19 set -o posix
20 fi
19 setopt NO_GLOB_SUBST
20 else
21 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
22 fi
23 BIN_SH=xpg4; export BIN_SH # for Tru64
2124 DUALCASE=1; export DUALCASE # for MKS sh
2225
23 # Support unset when possible.
24 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
25 as_unset=unset
26 else
27 as_unset=false
28 fi
29
30
31 # Work around bugs in pre-3.0 UWIN ksh.
32 $as_unset ENV MAIL MAILPATH
33 PS1='$ '
34 PS2='> '
35 PS4='+ '
36
37 # NLS nuisances.
38 for as_var in \
39 LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
40 LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
41 LC_TELEPHONE LC_TIME
42 do
43 if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
44 eval $as_var=C; export $as_var
45 else
46 $as_unset $as_var
47 fi
48 done
49
50 # Required to use basename.
51 if expr a : '\(a\)' >/dev/null 2>&1; then
52 as_expr=expr
53 else
54 as_expr=false
55 fi
56
57 if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
58 as_basename=basename
59 else
60 as_basename=false
61 fi
62
63
64 # Name of the executable.
65 as_me=`$as_basename "$0" ||
66 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
67 X"$0" : 'X\(//\)$' \| \
68 X"$0" : 'X\(/\)$' \| \
69 . : '\(.\)' 2>/dev/null ||
70 echo X/"$0" |
71 sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
72 /^X\/\(\/\/\)$/{ s//\1/; q; }
73 /^X\/\(\/\).*/{ s//\1/; q; }
74 s/.*/./; q'`
75
76
77 # PATH needs CR, and LINENO needs CR and PATH.
26
27 # PATH needs CR
7828 # Avoid depending upon Character Ranges.
7929 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
8030 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
9545 rm -f conf$$.sh
9646 fi
9747
98
99 as_lineno_1=$LINENO
100 as_lineno_2=$LINENO
101 as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
102 test "x$as_lineno_1" != "x$as_lineno_2" &&
103 test "x$as_lineno_3" = "x$as_lineno_2" || {
104 # Find who we are. Look in the path if we contain no path at all
105 # relative or not.
106 case $0 in
107 *[\\/]* ) as_myself=$0 ;;
108 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
48 # Support unset when possible.
49 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
50 as_unset=unset
51 else
52 as_unset=false
53 fi
54
55
56 # IFS
57 # We need space, tab and new line, in precisely that order. Quoting is
58 # there to prevent editors from complaining about space-tab.
59 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
60 # splitting by setting IFS to empty value.)
61 as_nl='
62 '
63 IFS=" "" $as_nl"
64
65 # Find who we are. Look in the path if we contain no directory separator.
66 case $0 in
67 *[\\/]* ) as_myself=$0 ;;
68 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10969 for as_dir in $PATH
11070 do
11171 IFS=$as_save_IFS
11272 test -z "$as_dir" && as_dir=.
11373 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
11474 done
115
116 ;;
117 esac
118 # We did not find ourselves, most probably we were run as `sh COMMAND'
119 # in which case we are not to be found in the path.
120 if test "x$as_myself" = x; then
121 as_myself=$0
75 IFS=$as_save_IFS
76
77 ;;
78 esac
79 # We did not find ourselves, most probably we were run as `sh COMMAND'
80 # in which case we are not to be found in the path.
81 if test "x$as_myself" = x; then
82 as_myself=$0
83 fi
84 if test ! -f "$as_myself"; then
85 echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
86 { (exit 1); exit 1; }
87 fi
88
89 # Work around bugs in pre-3.0 UWIN ksh.
90 for as_var in ENV MAIL MAILPATH
91 do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
92 done
93 PS1='$ '
94 PS2='> '
95 PS4='+ '
96
97 # NLS nuisances.
98 for as_var in \
99 LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
100 LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
101 LC_TELEPHONE LC_TIME
102 do
103 if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
104 eval $as_var=C; export $as_var
105 else
106 ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
122107 fi
123 if test ! -f "$as_myself"; then
124 { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
125 { (exit 1); exit 1; }; }
126 fi
127 case $CONFIG_SHELL in
128 '')
108 done
109
110 # Required to use basename.
111 if expr a : '\(a\)' >/dev/null 2>&1 &&
112 test "X`expr 00001 : '.*\(...\)'`" = X001; then
113 as_expr=expr
114 else
115 as_expr=false
116 fi
117
118 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
119 as_basename=basename
120 else
121 as_basename=false
122 fi
123
124
125 # Name of the executable.
126 as_me=`$as_basename -- "$0" ||
127 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
128 X"$0" : 'X\(//\)$' \| \
129 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
130 echo X/"$0" |
131 sed '/^.*\/\([^/][^/]*\)\/*$/{
132 s//\1/
133 q
134 }
135 /^X\/\(\/\/\)$/{
136 s//\1/
137 q
138 }
139 /^X\/\(\/\).*/{
140 s//\1/
141 q
142 }
143 s/.*/./; q'`
144
145 # CDPATH.
146 $as_unset CDPATH
147
148
149 if test "x$CONFIG_SHELL" = x; then
150 if (eval ":") 2>/dev/null; then
151 as_have_required=yes
152 else
153 as_have_required=no
154 fi
155
156 if test $as_have_required = yes && (eval ":
157 (as_func_return () {
158 (exit \$1)
159 }
160 as_func_success () {
161 as_func_return 0
162 }
163 as_func_failure () {
164 as_func_return 1
165 }
166 as_func_ret_success () {
167 return 0
168 }
169 as_func_ret_failure () {
170 return 1
171 }
172
173 exitcode=0
174 if as_func_success; then
175 :
176 else
177 exitcode=1
178 echo as_func_success failed.
179 fi
180
181 if as_func_failure; then
182 exitcode=1
183 echo as_func_failure succeeded.
184 fi
185
186 if as_func_ret_success; then
187 :
188 else
189 exitcode=1
190 echo as_func_ret_success failed.
191 fi
192
193 if as_func_ret_failure; then
194 exitcode=1
195 echo as_func_ret_failure succeeded.
196 fi
197
198 if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
199 :
200 else
201 exitcode=1
202 echo positional parameters were not saved.
203 fi
204
205 test \$exitcode = 0) || { (exit 1); exit 1; }
206
207 (
208 as_lineno_1=\$LINENO
209 as_lineno_2=\$LINENO
210 test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
211 test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
212 ") 2> /dev/null; then
213 :
214 else
215 as_candidate_shells=
129216 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
130 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
217 for as_dir in /usr/bin/posix$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
131218 do
132219 IFS=$as_save_IFS
133220 test -z "$as_dir" && as_dir=.
134 for as_base in sh bash ksh sh5; do
135 case $as_dir in
221 case $as_dir in
136222 /*)
137 if ("$as_dir/$as_base" -c '
223 for as_base in sh bash ksh sh5; do
224 as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
225 done;;
226 esac
227 done
228 IFS=$as_save_IFS
229
230
231 for as_shell in $as_candidate_shells $SHELL; do
232 # Try only shells that exist, to save several forks.
233 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
234 { ("$as_shell") 2> /dev/null <<\_ASEOF
235 # Be Bourne compatible
236 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
237 emulate sh
238 NULLCMD=:
239 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
240 # is contrary to our usage. Disable this feature.
241 alias -g '${1+"$@"}'='"$@"'
242 setopt NO_GLOB_SUBST
243 else
244 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
245 fi
246 BIN_SH=xpg4; export BIN_SH # for Tru64
247 DUALCASE=1; export DUALCASE # for MKS sh
248
249 :
250 _ASEOF
251 }; then
252 CONFIG_SHELL=$as_shell
253 as_have_required=yes
254 if { "$as_shell" 2> /dev/null <<\_ASEOF
255 # Be Bourne compatible
256 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
257 emulate sh
258 NULLCMD=:
259 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
260 # is contrary to our usage. Disable this feature.
261 alias -g '${1+"$@"}'='"$@"'
262 setopt NO_GLOB_SUBST
263 else
264 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
265 fi
266 BIN_SH=xpg4; export BIN_SH # for Tru64
267 DUALCASE=1; export DUALCASE # for MKS sh
268
269 :
270 (as_func_return () {
271 (exit $1)
272 }
273 as_func_success () {
274 as_func_return 0
275 }
276 as_func_failure () {
277 as_func_return 1
278 }
279 as_func_ret_success () {
280 return 0
281 }
282 as_func_ret_failure () {
283 return 1
284 }
285
286 exitcode=0
287 if as_func_success; then
288 :
289 else
290 exitcode=1
291 echo as_func_success failed.
292 fi
293
294 if as_func_failure; then
295 exitcode=1
296 echo as_func_failure succeeded.
297 fi
298
299 if as_func_ret_success; then
300 :
301 else
302 exitcode=1
303 echo as_func_ret_success failed.
304 fi
305
306 if as_func_ret_failure; then
307 exitcode=1
308 echo as_func_ret_failure succeeded.
309 fi
310
311 if ( set x; as_func_ret_success y && test x = "$1" ); then
312 :
313 else
314 exitcode=1
315 echo positional parameters were not saved.
316 fi
317
318 test $exitcode = 0) || { (exit 1); exit 1; }
319
320 (
138321 as_lineno_1=$LINENO
139322 as_lineno_2=$LINENO
140 as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
141323 test "x$as_lineno_1" != "x$as_lineno_2" &&
142 test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
143 $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
144 $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
145 CONFIG_SHELL=$as_dir/$as_base
146 export CONFIG_SHELL
147 exec "$CONFIG_SHELL" "$0" ${1+"$@"}
148 fi;;
149 esac
150 done
151 done
152 ;;
153 esac
324 test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
325
326 _ASEOF
327 }; then
328 break
329 fi
330
331 fi
332
333 done
334
335 if test "x$CONFIG_SHELL" != x; then
336 for as_var in BASH_ENV ENV
337 do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
338 done
339 export CONFIG_SHELL
340 exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
341 fi
342
343
344 if test $as_have_required = no; then
345 echo This script requires a shell more modern than all the
346 echo shells that I found on your system. Please install a
347 echo modern shell, or manually run the script under such a
348 echo shell if you do have one.
349 { (exit 1); exit 1; }
350 fi
351
352
353 fi
354
355 fi
356
357
358
359 (eval "as_func_return () {
360 (exit \$1)
361 }
362 as_func_success () {
363 as_func_return 0
364 }
365 as_func_failure () {
366 as_func_return 1
367 }
368 as_func_ret_success () {
369 return 0
370 }
371 as_func_ret_failure () {
372 return 1
373 }
374
375 exitcode=0
376 if as_func_success; then
377 :
378 else
379 exitcode=1
380 echo as_func_success failed.
381 fi
382
383 if as_func_failure; then
384 exitcode=1
385 echo as_func_failure succeeded.
386 fi
387
388 if as_func_ret_success; then
389 :
390 else
391 exitcode=1
392 echo as_func_ret_success failed.
393 fi
394
395 if as_func_ret_failure; then
396 exitcode=1
397 echo as_func_ret_failure succeeded.
398 fi
399
400 if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
401 :
402 else
403 exitcode=1
404 echo positional parameters were not saved.
405 fi
406
407 test \$exitcode = 0") || {
408 echo No shell found that supports shell functions.
409 echo Please tell autoconf@gnu.org about your system,
410 echo including any error possibly output before this
411 echo message
412 }
413
414
415
416 as_lineno_1=$LINENO
417 as_lineno_2=$LINENO
418 test "x$as_lineno_1" != "x$as_lineno_2" &&
419 test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
154420
155421 # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
156422 # uniformly replaced by the line number. The first 'sed' inserts a
157 # line-number line before each line; the second 'sed' does the real
158 # work. The second script uses 'N' to pair each line-number line
159 # with the numbered line, and appends trailing '-' during
160 # substitution so that $LINENO is not a special case at line end.
423 # line-number line after each line using $LINENO; the second 'sed'
424 # does the real work. The second script uses 'N' to pair each
425 # line-number line with the line containing $LINENO, and appends
426 # trailing '-' during substitution so that $LINENO is not a special
427 # case at line end.
161428 # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
162 # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
163 sed '=' <$as_myself |
429 # scripts with optimization help from Paolo Bonzini. Blame Lee
430 # E. McMahon (1931-1989) for sed's syntax. :-)
431 sed -n '
432 p
433 /[$]LINENO/=
434 ' <$as_myself |
164435 sed '
436 s/[$]LINENO.*/&-/
437 t lineno
438 b
439 :lineno
165440 N
166 s,$,-,
167 : loop
168 s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
441 :loop
442 s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
169443 t loop
170 s,-$,,
171 s,^['$as_cr_digits']*\n,,
444 s/-\n.*//
172445 ' >$as_me.lineno &&
173 chmod +x $as_me.lineno ||
446 chmod +x "$as_me.lineno" ||
174447 { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
175448 { (exit 1); exit 1; }; }
176449
177450 # Don't try to exec as it changes $[0], causing all sort of problems
178451 # (the dirname of $[0] is not the place where we might find the
179 # original and so on. Autoconf is especially sensible to this).
180 . ./$as_me.lineno
452 # original and so on. Autoconf is especially sensitive to this).
453 . "./$as_me.lineno"
181454 # Exit status is that of the last command.
182455 exit
183456 }
184457
185458
186 case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
187 *c*,-n*) ECHO_N= ECHO_C='
188 ' ECHO_T=' ' ;;
189 *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
190 *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
459 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
460 as_dirname=dirname
461 else
462 as_dirname=false
463 fi
464
465 ECHO_C= ECHO_N= ECHO_T=
466 case `echo -n x` in
467 -n*)
468 case `echo 'x\c'` in
469 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
470 *) ECHO_C='\c';;
471 esac;;
472 *)
473 ECHO_N='-n';;
191474 esac
192475
193 if expr a : '\(a\)' >/dev/null 2>&1; then
476 if expr a : '\(a\)' >/dev/null 2>&1 &&
477 test "X`expr 00001 : '.*\(...\)'`" = X001; then
194478 as_expr=expr
195479 else
196480 as_expr=false
197481 fi
198482
199483 rm -f conf$$ conf$$.exe conf$$.file
484 if test -d conf$$.dir; then
485 rm -f conf$$.dir/conf$$.file
486 else
487 rm -f conf$$.dir
488 mkdir conf$$.dir
489 fi
200490 echo >conf$$.file
201491 if ln -s conf$$.file conf$$ 2>/dev/null; then
202 # We could just check for DJGPP; but this test a) works b) is more generic
203 # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
204 if test -f conf$$.exe; then
205 # Don't use ln at all; we don't have any links
492 as_ln_s='ln -s'
493 # ... but there are two gotchas:
494 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
495 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
496 # In both cases, we have to default to `cp -p'.
497 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
206498 as_ln_s='cp -p'
207 else
208 as_ln_s='ln -s'
209 fi
210499 elif ln conf$$.file conf$$ 2>/dev/null; then
211500 as_ln_s=ln
212501 else
213502 as_ln_s='cp -p'
214503 fi
215 rm -f conf$$ conf$$.exe conf$$.file
504 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
505 rmdir conf$$.dir 2>/dev/null
216506
217507 if mkdir -p . 2>/dev/null; then
218508 as_mkdir_p=:
221511 as_mkdir_p=false
222512 fi
223513
224 as_executable_p="test -f"
514 # Find out whether ``test -x'' works. Don't use a zero-byte file, as
515 # systems may use methods other than mode bits to determine executability.
516 cat >conf$$.file <<_ASEOF
517 #! /bin/sh
518 exit 0
519 _ASEOF
520 chmod +x conf$$.file
521 if test -x conf$$.file >/dev/null 2>&1; then
522 as_executable_p="test -x"
523 else
524 as_executable_p=:
525 fi
526 rm -f conf$$.file
225527
226528 # Sed expression to map a string onto a valid CPP name.
227529 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
229531 # Sed expression to map a string onto a valid variable name.
230532 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
231533
232
233 # IFS
234 # We need space, tab and new line, in precisely that order.
235 as_nl='
236 '
237 IFS=" $as_nl"
238
239 # CDPATH.
240 $as_unset CDPATH
241534
242535
243536
394687
395688 tagnames=${tagnames+${tagnames},}F77
396689
690 exec 7<&0 </dev/null 6>&1
691
397692 # Name of the host.
398693 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
399694 # so uname gets run too.
400695 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
401696
402 exec 6>&1
403
404697 #
405698 # Initializations.
406699 #
407700 ac_default_prefix=/usr/local
701 ac_clean_files=
408702 ac_config_libobj_dir=.
703 LIBOBJS=
409704 cross_compiling=no
410705 subdirs=
411706 MFLAGS=
412707 MAKEFLAGS=
413708 SHELL=${CONFIG_SHELL-/bin/sh}
414709
415 # Maximum number of lines to put in a shell here document.
416 # This variable seems obsolete. It should probably be removed, and
417 # only ac_max_sed_lines should be used.
418 : ${ac_max_here_lines=38}
419
420710 # Identity of this package.
421 PACKAGE_NAME=
422 PACKAGE_TARNAME=
423 PACKAGE_VERSION=
424 PACKAGE_STRING=
425 PACKAGE_BUGREPORT=
426
427 ac_unique_file="src/pam_mount.c"
711 PACKAGE_NAME='pam_mount'
712 PACKAGE_TARNAME='pam_mount'
713 PACKAGE_VERSION='0.20'
714 PACKAGE_STRING='pam_mount 0.20'
715 PACKAGE_BUGREPORT=''
716
428717 # Factoring default headers for most tests.
429718 ac_includes_default="\
430719 #include <stdio.h>
453742 #endif
454743 #if HAVE_INTTYPES_H
455744 # include <inttypes.h>
456 #else
457 # if HAVE_STDINT_H
458 # include <stdint.h>
459 # endif
745 #endif
746 #if HAVE_STDINT_H
747 # include <stdint.h>
460748 #endif
461749 #if HAVE_UNISTD_H
462750 # include <unistd.h>
463751 #endif"
464752
465 ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAJOR_VERSION MINOR_VERSION MICRO_VERSION VER_INFO slibdir ssbindir CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE GCC_FVISIBILITY_HIDDEN build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL PKG_CONFIG GLIB_CFLAGS GLIB_LIBS GLIB_GENMARSHAL GOBJECT_QUERY GLIB_MKENUMS FLYN_TRUE FLYN_FALSE PAM_MODDIR LIBOBJS LTLIBOBJS'
753 ac_subst_vars='SHELL
754 PATH_SEPARATOR
755 PACKAGE_NAME
756 PACKAGE_TARNAME
757 PACKAGE_VERSION
758 PACKAGE_STRING
759 PACKAGE_BUGREPORT
760 exec_prefix
761 prefix
762 program_transform_name
763 bindir
764 sbindir
765 libexecdir
766 datarootdir
767 datadir
768 sysconfdir
769 sharedstatedir
770 localstatedir
771 includedir
772 oldincludedir
773 docdir
774 infodir
775 htmldir
776 dvidir
777 pdfdir
778 psdir
779 libdir
780 localedir
781 mandir
782 DEFS
783 ECHO_C
784 ECHO_N
785 ECHO_T
786 LIBS
787 build_alias
788 host_alias
789 target_alias
790 INSTALL_PROGRAM
791 INSTALL_SCRIPT
792 INSTALL_DATA
793 CYGPATH_W
794 PACKAGE
795 VERSION
796 ACLOCAL
797 AUTOCONF
798 AUTOMAKE
799 AUTOHEADER
800 MAKEINFO
801 install_sh
802 STRIP
803 INSTALL_STRIP_PROGRAM
804 mkdir_p
805 AWK
806 SET_MAKE
807 am__leading_dot
808 AMTAR
809 am__tar
810 am__untar
811 CC
812 CFLAGS
813 LDFLAGS
814 CPPFLAGS
815 ac_ct_CC
816 EXEEXT
817 OBJEXT
818 DEPDIR
819 am__include
820 am__quote
821 AMDEP_TRUE
822 AMDEP_FALSE
823 AMDEPBACKSLASH
824 CCDEPMODE
825 am__fastdepCC_TRUE
826 am__fastdepCC_FALSE
827 build
828 build_cpu
829 build_vendor
830 build_os
831 host
832 host_cpu
833 host_vendor
834 host_os
835 GREP
836 EGREP
837 LN_S
838 ECHO
839 AR
840 RANLIB
841 CPP
842 CXX
843 CXXFLAGS
844 ac_ct_CXX
845 CXXDEPMODE
846 am__fastdepCXX_TRUE
847 am__fastdepCXX_FALSE
848 CXXCPP
849 F77
850 FFLAGS
851 ac_ct_F77
852 LIBTOOL
853 PKG_CONFIG
854 GLIB_CFLAGS
855 GLIB_LIBS
856 GLIB_GENMARSHAL
857 GOBJECT_QUERY
858 GLIB_MKENUMS
859 XML2_CONFIG
860 XML_CPPFLAGS
861 XML_LIBS
862 slibdir
863 ssbindir
864 GCC_FVISIBILITY_HIDDEN
865 regular_CFLAGS
866 PAM_MODDIR
867 LIBOBJS
868 LTLIBOBJS'
466869 ac_subst_files=''
870 ac_precious_vars='build_alias
871 host_alias
872 target_alias
873 CC
874 CFLAGS
875 LDFLAGS
876 CPPFLAGS
877 CPP
878 CXX
879 CXXFLAGS
880 CCC
881 CXXCPP
882 F77
883 FFLAGS'
884
467885
468886 # Initialize some variables set by options.
469887 ac_init_help=
490908 # and all the variables that are supposed to be based on exec_prefix
491909 # by default will actually change.
492910 # Use braces instead of parens because sh, perl, etc. also accept them.
911 # (The list follows the same order as the GNU Coding Standards.)
493912 bindir='${exec_prefix}/bin'
494913 sbindir='${exec_prefix}/sbin'
495914 libexecdir='${exec_prefix}/libexec'
496 datadir='${prefix}/share'
915 datarootdir='${prefix}/share'
916 datadir='${datarootdir}'
497917 sysconfdir='${prefix}/etc'
498918 sharedstatedir='${prefix}/com'
499919 localstatedir='${prefix}/var'
500 libdir='${exec_prefix}/lib'
501920 includedir='${prefix}/include'
502921 oldincludedir='/usr/include'
503 infodir='${prefix}/info'
504 mandir='${prefix}/man'
922 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
923 infodir='${datarootdir}/info'
924 htmldir='${docdir}'
925 dvidir='${docdir}'
926 pdfdir='${docdir}'
927 psdir='${docdir}'
928 libdir='${exec_prefix}/lib'
929 localedir='${datarootdir}/locale'
930 mandir='${datarootdir}/man'
505931
506932 ac_prev=
933 ac_dashdash=
507934 for ac_option
508935 do
509936 # If the previous option needs an argument, assign it.
510937 if test -n "$ac_prev"; then
511 eval "$ac_prev=\$ac_option"
938 eval $ac_prev=\$ac_option
512939 ac_prev=
513940 continue
514941 fi
515942
516 ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
943 case $ac_option in
944 *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
945 *) ac_optarg=yes ;;
946 esac
517947
518948 # Accept the important Cygnus configure options, so we can diagnose typos.
519949
520 case $ac_option in
950 case $ac_dashdash$ac_option in
951 --)
952 ac_dashdash=yes ;;
521953
522954 -bindir | --bindir | --bindi | --bind | --bin | --bi)
523955 ac_prev=bindir ;;
539971 --config-cache | -C)
540972 cache_file=config.cache ;;
541973
542 -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
974 -datadir | --datadir | --datadi | --datad)
543975 ac_prev=datadir ;;
544 -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
545 | --da=*)
976 -datadir=* | --datadir=* | --datadi=* | --datad=*)
546977 datadir=$ac_optarg ;;
978
979 -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
980 | --dataroo | --dataro | --datar)
981 ac_prev=datarootdir ;;
982 -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
983 | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
984 datarootdir=$ac_optarg ;;
547985
548986 -disable-* | --disable-*)
549987 ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
552990 { echo "$as_me: error: invalid feature name: $ac_feature" >&2
553991 { (exit 1); exit 1; }; }
554992 ac_feature=`echo $ac_feature | sed 's/-/_/g'`
555 eval "enable_$ac_feature=no" ;;
993 eval enable_$ac_feature=no ;;
994
995 -docdir | --docdir | --docdi | --doc | --do)
996 ac_prev=docdir ;;
997 -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
998 docdir=$ac_optarg ;;
999
1000 -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
1001 ac_prev=dvidir ;;
1002 -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
1003 dvidir=$ac_optarg ;;
5561004
5571005 -enable-* | --enable-*)
5581006 ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
5611009 { echo "$as_me: error: invalid feature name: $ac_feature" >&2
5621010 { (exit 1); exit 1; }; }
5631011 ac_feature=`echo $ac_feature | sed 's/-/_/g'`
564 case $ac_option in
565 *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
566 *) ac_optarg=yes ;;
567 esac
568 eval "enable_$ac_feature='$ac_optarg'" ;;
1012 eval enable_$ac_feature=\$ac_optarg ;;
5691013
5701014 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
5711015 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
5921036 -host=* | --host=* | --hos=* | --ho=*)
5931037 host_alias=$ac_optarg ;;
5941038
1039 -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
1040 ac_prev=htmldir ;;
1041 -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
1042 | --ht=*)
1043 htmldir=$ac_optarg ;;
1044
5951045 -includedir | --includedir | --includedi | --included | --include \
5961046 | --includ | --inclu | --incl | --inc)
5971047 ac_prev=includedir ;;
6161066 | --libexe=* | --libex=* | --libe=*)
6171067 libexecdir=$ac_optarg ;;
6181068
1069 -localedir | --localedir | --localedi | --localed | --locale)
1070 ac_prev=localedir ;;
1071 -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
1072 localedir=$ac_optarg ;;
1073
6191074 -localstatedir | --localstatedir | --localstatedi | --localstated \
620 | --localstate | --localstat | --localsta | --localst \
621 | --locals | --local | --loca | --loc | --lo)
1075 | --localstate | --localstat | --localsta | --localst | --locals)
6221076 ac_prev=localstatedir ;;
6231077 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
624 | --localstate=* | --localstat=* | --localsta=* | --localst=* \
625 | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
1078 | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
6261079 localstatedir=$ac_optarg ;;
6271080
6281081 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
6871140 | --progr-tra=* | --program-tr=* | --program-t=*)
6881141 program_transform_name=$ac_optarg ;;
6891142
1143 -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
1144 ac_prev=pdfdir ;;
1145 -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
1146 pdfdir=$ac_optarg ;;
1147
1148 -psdir | --psdir | --psdi | --psd | --ps)
1149 ac_prev=psdir ;;
1150 -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
1151 psdir=$ac_optarg ;;
1152
6901153 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
6911154 | -silent | --silent | --silen | --sile | --sil)
6921155 silent=yes ;;
7431206 { echo "$as_me: error: invalid package name: $ac_package" >&2
7441207 { (exit 1); exit 1; }; }
7451208 ac_package=`echo $ac_package| sed 's/-/_/g'`
746 case $ac_option in
747 *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
748 *) ac_optarg=yes ;;
749 esac
750 eval "with_$ac_package='$ac_optarg'" ;;
1209 eval with_$ac_package=\$ac_optarg ;;
7511210
7521211 -without-* | --without-*)
7531212 ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
7561215 { echo "$as_me: error: invalid package name: $ac_package" >&2
7571216 { (exit 1); exit 1; }; }
7581217 ac_package=`echo $ac_package | sed 's/-/_/g'`
759 eval "with_$ac_package=no" ;;
1218 eval with_$ac_package=no ;;
7601219
7611220 --x)
7621221 # Obsolete; use --with-x.
7871246 expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
7881247 { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
7891248 { (exit 1); exit 1; }; }
790 ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
791 eval "$ac_envvar='$ac_optarg'"
1249 eval $ac_envvar=\$ac_optarg
7921250 export $ac_envvar ;;
7931251
7941252 *)
8081266 { (exit 1); exit 1; }; }
8091267 fi
8101268
811 # Be sure to have absolute paths.
812 for ac_var in exec_prefix prefix
1269 # Be sure to have absolute directory names.
1270 for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
1271 datadir sysconfdir sharedstatedir localstatedir includedir \
1272 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1273 libdir localedir mandir
8131274 do
814 eval ac_val=$`echo $ac_var`
1275 eval ac_val=\$$ac_var
8151276 case $ac_val in
816 [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
817 *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
818 { (exit 1); exit 1; }; };;
1277 [\\/$]* | ?:[\\/]* ) continue;;
1278 NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
8191279 esac
820 done
821
822 # Be sure to have absolute paths.
823 for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
824 localstatedir libdir includedir oldincludedir infodir mandir
825 do
826 eval ac_val=$`echo $ac_var`
827 case $ac_val in
828 [\\/$]* | ?:[\\/]* ) ;;
829 *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
830 { (exit 1); exit 1; }; };;
831 esac
1280 { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
1281 { (exit 1); exit 1; }; }
8321282 done
8331283
8341284 # There might be people who depend on the old broken behavior: `$host'
8551305 test "$silent" = yes && exec 6>/dev/null
8561306
8571307
1308 ac_pwd=`pwd` && test -n "$ac_pwd" &&
1309 ac_ls_di=`ls -di .` &&
1310 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
1311 { echo "$as_me: error: Working directory cannot be determined" >&2
1312 { (exit 1); exit 1; }; }
1313 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
1314 { echo "$as_me: error: pwd does not report name of working directory" >&2
1315 { (exit 1); exit 1; }; }
1316
1317
8581318 # Find the source files, if location was not specified.
8591319 if test -z "$srcdir"; then
8601320 ac_srcdir_defaulted=yes
861 # Try the directory containing this script, then its parent.
862 ac_confdir=`(dirname "$0") 2>/dev/null ||
1321 # Try the directory containing this script, then the parent directory.
1322 ac_confdir=`$as_dirname -- "$0" ||
8631323 $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
8641324 X"$0" : 'X\(//\)[^/]' \| \
8651325 X"$0" : 'X\(//\)$' \| \
866 X"$0" : 'X\(/\)' \| \
867 . : '\(.\)' 2>/dev/null ||
1326 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
8681327 echo X"$0" |
869 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
870 /^X\(\/\/\)[^/].*/{ s//\1/; q; }
871 /^X\(\/\/\)$/{ s//\1/; q; }
872 /^X\(\/\).*/{ s//\1/; q; }
873 s/.*/./; q'`
1328 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
1329 s//\1/
1330 q
1331 }
1332 /^X\(\/\/\)[^/].*/{
1333 s//\1/
1334 q
1335 }
1336 /^X\(\/\/\)$/{
1337 s//\1/
1338 q
1339 }
1340 /^X\(\/\).*/{
1341 s//\1/
1342 q
1343 }
1344 s/.*/./; q'`
8741345 srcdir=$ac_confdir
875 if test ! -r $srcdir/$ac_unique_file; then
1346 if test ! -r "$srcdir/$ac_unique_file"; then
8761347 srcdir=..
8771348 fi
8781349 else
8791350 ac_srcdir_defaulted=no
8801351 fi
881 if test ! -r $srcdir/$ac_unique_file; then
882 if test "$ac_srcdir_defaulted" = yes; then
883 { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
1352 if test ! -r "$srcdir/$ac_unique_file"; then
1353 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
1354 { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
8841355 { (exit 1); exit 1; }; }
885 else
886 { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
1356 fi
1357 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
1358 ac_abs_confdir=`(
1359 cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
8871360 { (exit 1); exit 1; }; }
888 fi
889 fi
890 (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
891 { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
892 { (exit 1); exit 1; }; }
893 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
894 ac_env_build_alias_set=${build_alias+set}
895 ac_env_build_alias_value=$build_alias
896 ac_cv_env_build_alias_set=${build_alias+set}
897 ac_cv_env_build_alias_value=$build_alias
898 ac_env_host_alias_set=${host_alias+set}
899 ac_env_host_alias_value=$host_alias
900 ac_cv_env_host_alias_set=${host_alias+set}
901 ac_cv_env_host_alias_value=$host_alias
902 ac_env_target_alias_set=${target_alias+set}
903 ac_env_target_alias_value=$target_alias
904 ac_cv_env_target_alias_set=${target_alias+set}
905 ac_cv_env_target_alias_value=$target_alias
906 ac_env_CC_set=${CC+set}
907 ac_env_CC_value=$CC
908 ac_cv_env_CC_set=${CC+set}
909 ac_cv_env_CC_value=$CC
910 ac_env_CFLAGS_set=${CFLAGS+set}
911 ac_env_CFLAGS_value=$CFLAGS
912 ac_cv_env_CFLAGS_set=${CFLAGS+set}
913 ac_cv_env_CFLAGS_value=$CFLAGS
914 ac_env_LDFLAGS_set=${LDFLAGS+set}
915 ac_env_LDFLAGS_value=$LDFLAGS
916 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
917 ac_cv_env_LDFLAGS_value=$LDFLAGS
918 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
919 ac_env_CPPFLAGS_value=$CPPFLAGS
920 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
921 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
922 ac_env_CPP_set=${CPP+set}
923 ac_env_CPP_value=$CPP
924 ac_cv_env_CPP_set=${CPP+set}
925 ac_cv_env_CPP_value=$CPP
926 ac_env_CXX_set=${CXX+set}
927 ac_env_CXX_value=$CXX
928 ac_cv_env_CXX_set=${CXX+set}
929 ac_cv_env_CXX_value=$CXX
930 ac_env_CXXFLAGS_set=${CXXFLAGS+set}
931 ac_env_CXXFLAGS_value=$CXXFLAGS
932 ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}
933 ac_cv_env_CXXFLAGS_value=$CXXFLAGS
934 ac_env_CXXCPP_set=${CXXCPP+set}
935 ac_env_CXXCPP_value=$CXXCPP
936 ac_cv_env_CXXCPP_set=${CXXCPP+set}
937 ac_cv_env_CXXCPP_value=$CXXCPP
938 ac_env_F77_set=${F77+set}
939 ac_env_F77_value=$F77
940 ac_cv_env_F77_set=${F77+set}
941 ac_cv_env_F77_value=$F77
942 ac_env_FFLAGS_set=${FFLAGS+set}
943 ac_env_FFLAGS_value=$FFLAGS
944 ac_cv_env_FFLAGS_set=${FFLAGS+set}
945 ac_cv_env_FFLAGS_value=$FFLAGS
1361 pwd)`
1362 # When building in place, set srcdir=.
1363 if test "$ac_abs_confdir" = "$ac_pwd"; then
1364 srcdir=.
1365 fi
1366 # Remove unnecessary trailing slashes from srcdir.
1367 # Double slashes in file names in object file debugging info
1368 # mess up M-x gdb in Emacs.
1369 case $srcdir in
1370 */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
1371 esac
1372 for ac_var in $ac_precious_vars; do
1373 eval ac_env_${ac_var}_set=\${${ac_var}+set}
1374 eval ac_env_${ac_var}_value=\$${ac_var}
1375 eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
1376 eval ac_cv_env_${ac_var}_value=\$${ac_var}
1377 done
9461378
9471379 #
9481380 # Report the --help message.
9511383 # Omit some internal or obsolete options to make the list less imposing.
9521384 # This message is too long to be a string in the A/UX 3.1 sh.
9531385 cat <<_ACEOF
954 \`configure' configures this package to adapt to many kinds of systems.
1386 \`configure' configures pam_mount 0.20 to adapt to many kinds of systems.
9551387
9561388 Usage: $0 [OPTION]... [VAR=VALUE]...
9571389
9711403 -n, --no-create do not create output files
9721404 --srcdir=DIR find the sources in DIR [configure dir or \`..']
9731405
974 _ACEOF
975
976 cat <<_ACEOF
9771406 Installation directories:
9781407 --prefix=PREFIX install architecture-independent files in PREFIX
9791408 [$ac_default_prefix]
9911420 --bindir=DIR user executables [EPREFIX/bin]
9921421 --sbindir=DIR system admin executables [EPREFIX/sbin]
9931422 --libexecdir=DIR program executables [EPREFIX/libexec]
994 --datadir=DIR read-only architecture-independent data [PREFIX/share]
9951423 --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
9961424 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
9971425 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
9981426 --libdir=DIR object code libraries [EPREFIX/lib]
9991427 --includedir=DIR C header files [PREFIX/include]
10001428 --oldincludedir=DIR C header files for non-gcc [/usr/include]
1001 --infodir=DIR info documentation [PREFIX/info]
1002 --mandir=DIR man documentation [PREFIX/man]
1429 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
1430 --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
1431 --infodir=DIR info documentation [DATAROOTDIR/info]
1432 --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
1433 --mandir=DIR man documentation [DATAROOTDIR/man]
1434 --docdir=DIR documentation root [DATAROOTDIR/doc/pam_mount]
1435 --htmldir=DIR html documentation [DOCDIR]
1436 --dvidir=DIR dvi documentation [DOCDIR]
1437 --pdfdir=DIR pdf documentation [DOCDIR]
1438 --psdir=DIR ps documentation [DOCDIR]
10031439 _ACEOF
10041440
10051441 cat <<\_ACEOF
10161452 fi
10171453
10181454 if test -n "$ac_init_help"; then
1019
1455 case $ac_init_help in
1456 short | recursive ) echo "Configuration of pam_mount 0.20:";;
1457 esac
10201458 cat <<\_ACEOF
10211459
10221460 Optional Features:
10241462 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
10251463 --disable-dependency-tracking speeds up one-time build
10261464 --enable-dependency-tracking do not reject slow dependency extractors
1027 --enable-shared[=PKGS]
1028 build shared libraries [default=yes]
1029 --enable-static[=PKGS]
1030 build static libraries [default=yes]
1465 --enable-static[=PKGS] build static libraries [default=no]
1466 --enable-shared[=PKGS] build shared libraries [default=yes]
10311467 --enable-fast-install[=PKGS]
10321468 optimize for fast installation [default=yes]
10331469 --disable-libtool-lock avoid locking (might break parallel builds)
10341470 --disable-glibtest do not try to compile and run a test GLIB program
1471 --disable-xmltest Do not try to compile and run a test LIBXML program
10351472
10361473 Optional Packages:
10371474 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
10381475 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
1039 --with-slibdir=PATH Path to the super sbin directory [/sbin]
1040 --with-ssbindir=PATH Path to the super lib directory [/lib]
10411476 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
10421477 --with-pic try to use only PIC/non-PIC objects [default=use
10431478 both]
1044 --with-tags[=TAGS]
1045 include additional configurations [automatic]
1479 --with-tags[=TAGS] include additional configurations [automatic]
1480 --with-xml-prefix=PFX Prefix where libxml is installed (optional)
1481 --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)
1482 --with-slibdir=PATH Path to the super lib directory [/lib]
1483 --with-ssbindir=PATH Path to the super sbin directory [/sbin]
10461484
10471485 Some influential environment variables:
10481486 CC C compiler command
10491487 CFLAGS C compiler flags
10501488 LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
10511489 nonstandard directory <lib dir>
1052 CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
1053 headers in a nonstandard directory <include dir>
1490 CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
1491 you have headers in a nonstandard directory <include dir>
10541492 CPP C preprocessor
10551493 CXX C++ compiler command
10561494 CXXFLAGS C++ compiler flags
10621500 it to find libraries and programs with nonstandard names/locations.
10631501
10641502 _ACEOF
1503 ac_status=$?
10651504 fi
10661505
10671506 if test "$ac_init_help" = "recursive"; then
10681507 # If there are subdirs, report their specific --help.
1069 ac_popdir=`pwd`
10701508 for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
1071 test -d $ac_dir || continue
1509 test -d "$ac_dir" || continue
10721510 ac_builddir=.
10731511
1074 if test "$ac_dir" != .; then
1512 case "$ac_dir" in
1513 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
1514 *)
10751515 ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
1076 # A "../" for each directory in $ac_dir_suffix.
1077 ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
1078 else
1079 ac_dir_suffix= ac_top_builddir=
1080 fi
1516 # A ".." for each directory in $ac_dir_suffix.
1517 ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
1518 case $ac_top_builddir_sub in
1519 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
1520 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
1521 esac ;;
1522 esac
1523 ac_abs_top_builddir=$ac_pwd
1524 ac_abs_builddir=$ac_pwd$ac_dir_suffix
1525 # for backward compatibility:
1526 ac_top_builddir=$ac_top_build_prefix
10811527
10821528 case $srcdir in
1083 .) # No --srcdir option. We are building in place.
1529 .) # We are building in place.
10841530 ac_srcdir=.
1085 if test -z "$ac_top_builddir"; then
1086 ac_top_srcdir=.
1087 else
1088 ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
1089 fi ;;
1090 [\\/]* | ?:[\\/]* ) # Absolute path.
1531 ac_top_srcdir=$ac_top_builddir_sub
1532 ac_abs_top_srcdir=$ac_pwd ;;
1533 [\\/]* | ?:[\\/]* ) # Absolute name.
10911534 ac_srcdir=$srcdir$ac_dir_suffix;
1092 ac_top_srcdir=$srcdir ;;
1093 *) # Relative path.
1094 ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
1095 ac_top_srcdir=$ac_top_builddir$srcdir ;;
1535 ac_top_srcdir=$srcdir
1536 ac_abs_top_srcdir=$srcdir ;;
1537 *) # Relative name.
1538 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
1539 ac_top_srcdir=$ac_top_build_prefix$srcdir
1540 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
10961541 esac
1097
1098 # Do not use `cd foo && pwd` to compute absolute paths, because
1099 # the directories may not exist.
1100 case `pwd` in
1101 .) ac_abs_builddir="$ac_dir";;
1102 *)
1103 case "$ac_dir" in
1104 .) ac_abs_builddir=`pwd`;;
1105 [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
1106 *) ac_abs_builddir=`pwd`/"$ac_dir";;
1107 esac;;
1108 esac
1109 case $ac_abs_builddir in
1110 .) ac_abs_top_builddir=${ac_top_builddir}.;;
1111 *)
1112 case ${ac_top_builddir}. in
1113 .) ac_abs_top_builddir=$ac_abs_builddir;;
1114 [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
1115 *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
1116 esac;;
1117 esac
1118 case $ac_abs_builddir in
1119 .) ac_abs_srcdir=$ac_srcdir;;
1120 *)
1121 case $ac_srcdir in
1122 .) ac_abs_srcdir=$ac_abs_builddir;;
1123 [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
1124 *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
1125 esac;;
1126 esac
1127 case $ac_abs_builddir in
1128 .) ac_abs_top_srcdir=$ac_top_srcdir;;
1129 *)
1130 case $ac_top_srcdir in
1131 .) ac_abs_top_srcdir=$ac_abs_builddir;;
1132 [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
1133 *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
1134 esac;;
1135 esac
1136
1137 cd $ac_dir
1138 # Check for guested configure; otherwise get Cygnus style configure.
1139 if test -f $ac_srcdir/configure.gnu; then
1140 echo
1141 $SHELL $ac_srcdir/configure.gnu --help=recursive
1142 elif test -f $ac_srcdir/configure; then
1143 echo
1144 $SHELL $ac_srcdir/configure --help=recursive
1145 elif test -f $ac_srcdir/configure.ac ||
1146 test -f $ac_srcdir/configure.in; then
1147 echo
1148 $ac_configure --help
1542 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
1543
1544 cd "$ac_dir" || { ac_status=$?; continue; }
1545 # Check for guested configure.
1546 if test -f "$ac_srcdir/configure.gnu"; then
1547 echo &&
1548 $SHELL "$ac_srcdir/configure.gnu" --help=recursive
1549 elif test -f "$ac_srcdir/configure"; then
1550 echo &&
1551 $SHELL "$ac_srcdir/configure" --help=recursive
11491552 else
11501553 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
1151 fi
1152 cd $ac_popdir
1554 fi || ac_status=$?
1555 cd "$ac_pwd" || { ac_status=$?; break; }
11531556 done
11541557 fi
11551558
1156 test -n "$ac_init_help" && exit 0
1559 test -n "$ac_init_help" && exit $ac_status
11571560 if $ac_init_version; then
11581561 cat <<\_ACEOF
1159
1160 Copyright (C) 2003 Free Software Foundation, Inc.
1562 pam_mount configure 0.20
1563 generated by GNU Autoconf 2.60
1564
1565 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
1566 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
11611567 This configure script is free software; the Free Software Foundation
11621568 gives unlimited permission to copy, distribute and modify it.
11631569 _ACEOF
1164 exit 0
1165 fi
1166 exec 5>config.log
1167 cat >&5 <<_ACEOF
1570 exit
1571 fi
1572 cat >config.log <<_ACEOF
11681573 This file contains any messages produced by compilers while
11691574 running configure, to aid debugging if configure makes a mistake.
11701575
1171 It was created by $as_me, which was
1172 generated by GNU Autoconf 2.59. Invocation command line was
1576 It was created by pam_mount $as_me 0.20, which was
1577 generated by GNU Autoconf 2.60. Invocation command line was
11731578
11741579 $ $0 $@
11751580
11761581 _ACEOF
1582 exec 5>>config.log
11771583 {
11781584 cat <<_ASUNAME
11791585 ## --------- ##
11921598 /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
11931599 /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
11941600 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
1195 hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
1601 /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
11961602 /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
11971603 /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
11981604 /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
12061612 test -z "$as_dir" && as_dir=.
12071613 echo "PATH: $as_dir"
12081614 done
1615 IFS=$as_save_IFS
12091616
12101617 } >&5
12111618
12271634 ac_configure_args=
12281635 ac_configure_args0=
12291636 ac_configure_args1=
1230 ac_sep=
12311637 ac_must_keep_next=false
12321638 for ac_pass in 1 2
12331639 do
12381644 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
12391645 | -silent | --silent | --silen | --sile | --sil)
12401646 continue ;;
1241 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1647 *\'*)
12421648 ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
12431649 esac
12441650 case $ac_pass in
12601666 -* ) ac_must_keep_next=true ;;
12611667 esac
12621668 fi
1263 ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
1264 # Get rid of the leading space.
1265 ac_sep=" "
1669 ac_configure_args="$ac_configure_args '$ac_arg'"
12661670 ;;
12671671 esac
12681672 done
12731677 # When interrupted or exit'd, cleanup temporary files, and complete
12741678 # config.log. We remove comments because anyway the quotes in there
12751679 # would cause problems or look ugly.
1276 # WARNING: Be sure not to use single quotes in there, as some shells,
1277 # such as our DU 5.0 friend, will then `close' the trap.
1680 # WARNING: Use '\'' to represent an apostrophe within the trap.
1681 # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
12781682 trap 'exit_status=$?
12791683 # Save into config.log some information that might help in debugging.
12801684 {
12871691 _ASBOX
12881692 echo
12891693 # The following way of writing the cache mishandles newlines in values,
1290 {
1694 (
1695 for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
1696 eval ac_val=\$$ac_var
1697 case $ac_val in #(
1698 *${as_nl}*)
1699 case $ac_var in #(
1700 *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
1701 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
1702 esac
1703 case $ac_var in #(
1704 _ | IFS | as_nl) ;; #(
1705 *) $as_unset $ac_var ;;
1706 esac ;;
1707 esac
1708 done
12911709 (set) 2>&1 |
1292 case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
1293 *ac_space=\ *)
1710 case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
1711 *${as_nl}ac_space=\ *)
12941712 sed -n \
1295 "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
1296 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
1297 ;;
1713 "s/'\''/'\''\\\\'\'''\''/g;
1714 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
1715 ;; #(
12981716 *)
1299 sed -n \
1300 "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
1301 ;;
1302 esac;
1303 }
1717 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
1718 ;;
1719 esac |
1720 sort
1721 )
13041722 echo
13051723
13061724 cat <<\_ASBOX
13111729 echo
13121730 for ac_var in $ac_subst_vars
13131731 do
1314 eval ac_val=$`echo $ac_var`
1315 echo "$ac_var='"'"'$ac_val'"'"'"
1732 eval ac_val=\$$ac_var
1733 case $ac_val in
1734 *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
1735 esac
1736 echo "$ac_var='\''$ac_val'\''"
13161737 done | sort
13171738 echo
13181739
13191740 if test -n "$ac_subst_files"; then
13201741 cat <<\_ASBOX
1321 ## ------------- ##
1322 ## Output files. ##
1323 ## ------------- ##
1742 ## ------------------- ##
1743 ## File substitutions. ##
1744 ## ------------------- ##
13241745 _ASBOX
13251746 echo
13261747 for ac_var in $ac_subst_files
13271748 do
1328 eval ac_val=$`echo $ac_var`
1329 echo "$ac_var='"'"'$ac_val'"'"'"
1749 eval ac_val=\$$ac_var
1750 case $ac_val in
1751 *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
1752 esac
1753 echo "$ac_var='\''$ac_val'\''"
13301754 done | sort
13311755 echo
13321756 fi
13381762 ## ----------- ##
13391763 _ASBOX
13401764 echo
1341 sed "/^$/d" confdefs.h | sort
1765 cat confdefs.h
13421766 echo
13431767 fi
13441768 test "$ac_signal" != 0 &&
13451769 echo "$as_me: caught signal $ac_signal"
13461770 echo "$as_me: exit $exit_status"
13471771 } >&5
1348 rm -f core *.core &&
1349 rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
1772 rm -f core *.core core.conftest.* &&
1773 rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
13501774 exit $exit_status
1351 ' 0
1775 ' 0
13521776 for ac_signal in 1 2 13 15; do
13531777 trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
13541778 done
13551779 ac_signal=0
13561780
13571781 # confdefs.h avoids OS command line length limits that DEFS can exceed.
1358 rm -rf conftest* confdefs.h
1359 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
1360 echo >confdefs.h
1782 rm -f -r conftest* confdefs.h
13611783
13621784 # Predefined preprocessor variables.
13631785
13881810
13891811 # Let the site file select an alternate cache file if it wants to.
13901812 # Prefer explicitly selected file to automatically selected ones.
1391 if test -z "$CONFIG_SITE"; then
1392 if test "x$prefix" != xNONE; then
1393 CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
1394 else
1395 CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
1396 fi
1397 fi
1398 for ac_site_file in $CONFIG_SITE; do
1813 if test -n "$CONFIG_SITE"; then
1814 set x "$CONFIG_SITE"
1815 elif test "x$prefix" != xNONE; then
1816 set x "$prefix/share/config.site" "$prefix/etc/config.site"
1817 else
1818 set x "$ac_default_prefix/share/config.site" \
1819 "$ac_default_prefix/etc/config.site"
1820 fi
1821 shift
1822 for ac_site_file
1823 do
13991824 if test -r "$ac_site_file"; then
14001825 { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
14011826 echo "$as_me: loading site script $ac_site_file" >&6;}
14111836 { echo "$as_me:$LINENO: loading cache $cache_file" >&5
14121837 echo "$as_me: loading cache $cache_file" >&6;}
14131838 case $cache_file in
1414 [\\/]* | ?:[\\/]* ) . $cache_file;;
1415 *) . ./$cache_file;;
1839 [\\/]* | ?:[\\/]* ) . "$cache_file";;
1840 *) . "./$cache_file";;
14161841 esac
14171842 fi
14181843 else
14241849 # Check that the precious variables saved in the cache have kept the same
14251850 # value.
14261851 ac_cache_corrupted=false
1427 for ac_var in `(set) 2>&1 |
1428 sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
1852 for ac_var in $ac_precious_vars; do
14291853 eval ac_old_set=\$ac_cv_env_${ac_var}_set
14301854 eval ac_new_set=\$ac_env_${ac_var}_set
1431 eval ac_old_val="\$ac_cv_env_${ac_var}_value"
1432 eval ac_new_val="\$ac_env_${ac_var}_value"
1855 eval ac_old_val=\$ac_cv_env_${ac_var}_value
1856 eval ac_new_val=\$ac_env_${ac_var}_value
14331857 case $ac_old_set,$ac_new_set in
14341858 set,)
14351859 { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
14541878 # Pass precious variables to config.status.
14551879 if test "$ac_new_set" = set; then
14561880 case $ac_new_val in
1457 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1458 ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
1881 *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
14591882 *) ac_arg=$ac_var=$ac_new_val ;;
14601883 esac
14611884 case " $ac_configure_args " in
14721895 { (exit 1); exit 1; }; }
14731896 fi
14741897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
14751922 ac_ext=c
14761923 ac_cpp='$CPP $CPPFLAGS'
14771924 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
14791926 ac_compiler_gnu=$ac_cv_c_compiler_gnu
14801927
14811928
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500 ac_config_headers="$ac_config_headers config.h"
1501
1502
1503 MAJOR_VERSION=0
1504 MINOR_VERSION=18
1505 MICRO_VERSION=0
1506 am__api_version="1.9"
1929 ac_config_headers="$ac_config_headers config.h"
1930
15071931 ac_aux_dir=
1508 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1509 if test -f $ac_dir/install-sh; then
1932 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
1933 if test -f "$ac_dir/install-sh"; then
15101934 ac_aux_dir=$ac_dir
15111935 ac_install_sh="$ac_aux_dir/install-sh -c"
15121936 break
1513 elif test -f $ac_dir/install.sh; then
1937 elif test -f "$ac_dir/install.sh"; then
15141938 ac_aux_dir=$ac_dir
15151939 ac_install_sh="$ac_aux_dir/install.sh -c"
15161940 break
1517 elif test -f $ac_dir/shtool; then
1941 elif test -f "$ac_dir/shtool"; then
15181942 ac_aux_dir=$ac_dir
15191943 ac_install_sh="$ac_aux_dir/shtool install -c"
15201944 break
15211945 fi
15221946 done
15231947 if test -z "$ac_aux_dir"; then
1524 { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1525 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1948 { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
1949 echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
15261950 { (exit 1); exit 1; }; }
15271951 fi
1528 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1529 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1530 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1952
1953 # These three variables are undocumented and unsupported,
1954 # and are intended to be withdrawn in a future Autoconf release.
1955 # They can cause serious problems if a builder's source tree is in a directory
1956 # whose full name contains unusual characters.
1957 ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
1958 ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
1959 ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
1960
15311961
15321962 # Find a good install program. We prefer a C program (faster),
15331963 # so one script is as good as another. But avoid the broken or
15421972 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
15431973 # OS/2's system install, which has a completely different semantic
15441974 # ./install, which can be erroneously created by make from ./install.sh.
1545 echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
1546 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
1975 { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
1976 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
15471977 if test -z "$INSTALL"; then
15481978 if test "${ac_cv_path_install+set}" = set; then
15491979 echo $ECHO_N "(cached) $ECHO_C" >&6
15651995 # by default.
15661996 for ac_prog in ginstall scoinst install; do
15671997 for ac_exec_ext in '' $ac_executable_extensions; do
1568 if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
1998 if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; }; then
15691999 if test $ac_prog = install &&
15702000 grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
15712001 # AIX install. It has an incompatible calling convention.
15842014 ;;
15852015 esac
15862016 done
2017 IFS=$as_save_IFS
15872018
15882019
15892020 fi
15902021 if test "${ac_cv_path_install+set}" = set; then
15912022 INSTALL=$ac_cv_path_install
15922023 else
1593 # As a last resort, use the slow shell script. We don't cache a
1594 # path for INSTALL within a source directory, because that will
2024 # As a last resort, use the slow shell script. Don't cache a
2025 # value for INSTALL within a source directory, because that will
15952026 # break other packages using the cache if that directory is
1596 # removed, or if the path is relative.
2027 # removed, or if the value is a relative name.
15972028 INSTALL=$ac_install_sh
15982029 fi
15992030 fi
1600 echo "$as_me:$LINENO: result: $INSTALL" >&5
1601 echo "${ECHO_T}$INSTALL" >&6
2031 { echo "$as_me:$LINENO: result: $INSTALL" >&5
2032 echo "${ECHO_T}$INSTALL" >&6; }
16022033
16032034 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
16042035 # It thinks the first close brace ends the variable substitution.
16082039
16092040 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
16102041
1611 echo "$as_me:$LINENO: checking whether build environment is sane" >&5
1612 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
2042 am__api_version="1.9"
2043 { echo "$as_me:$LINENO: checking whether build environment is sane" >&5
2044 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; }
16132045 # Just in case
16142046 sleep 1
16152047 echo timestamp > conftest.file
16512083 Check your system clock" >&2;}
16522084 { (exit 1); exit 1; }; }
16532085 fi
1654 echo "$as_me:$LINENO: result: yes" >&5
1655 echo "${ECHO_T}yes" >&6
2086 { echo "$as_me:$LINENO: result: yes" >&5
2087 echo "${ECHO_T}yes" >&6; }
16562088 test "$program_prefix" != NONE &&
1657 program_transform_name="s,^,$program_prefix,;$program_transform_name"
2089 program_transform_name="s&^&$program_prefix&;$program_transform_name"
16582090 # Use a double $ so make ignores it.
16592091 test "$program_suffix" != NONE &&
1660 program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2092 program_transform_name="s&\$&$program_suffix&;$program_transform_name"
16612093 # Double any \ or $. echo might interpret backslashes.
16622094 # By default was `s,x,x', remove it if useless.
16632095 cat <<\_ACEOF >conftest.sed
16642096 s/[\\$]/&&/g;s/;s,x,x,$//
16652097 _ACEOF
16662098 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1667 rm conftest.sed
2099 rm -f conftest.sed
16682100
16692101 # expand $ac_aux_dir to an absolute path
16702102 am_aux_dir=`cd $ac_aux_dir && pwd`
17162148 do
17172149 # Extract the first word of "$ac_prog", so it can be a program name with args.
17182150 set dummy $ac_prog; ac_word=$2
1719 echo "$as_me:$LINENO: checking for $ac_word" >&5
1720 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2151 { echo "$as_me:$LINENO: checking for $ac_word" >&5
2152 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
17212153 if test "${ac_cv_prog_AWK+set}" = set; then
17222154 echo $ECHO_N "(cached) $ECHO_C" >&6
17232155 else
17302162 IFS=$as_save_IFS
17312163 test -z "$as_dir" && as_dir=.
17322164 for ac_exec_ext in '' $ac_executable_extensions; do
1733 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2165 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
17342166 ac_cv_prog_AWK="$ac_prog"
17352167 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
17362168 break 2
17372169 fi
17382170 done
17392171 done
2172 IFS=$as_save_IFS
17402173
17412174 fi
17422175 fi
17432176 AWK=$ac_cv_prog_AWK
17442177 if test -n "$AWK"; then
1745 echo "$as_me:$LINENO: result: $AWK" >&5
1746 echo "${ECHO_T}$AWK" >&6
1747 else
1748 echo "$as_me:$LINENO: result: no" >&5
1749 echo "${ECHO_T}no" >&6
1750 fi
2178 { echo "$as_me:$LINENO: result: $AWK" >&5
2179 echo "${ECHO_T}$AWK" >&6; }
2180 else
2181 { echo "$as_me:$LINENO: result: no" >&5
2182 echo "${ECHO_T}no" >&6; }
2183 fi
2184
17512185
17522186 test -n "$AWK" && break
17532187 done
17542188
1755 echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
1756 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
1757 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
1758 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
2189 { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
2190 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
2191 set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
2192 if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
17592193 echo $ECHO_N "(cached) $ECHO_C" >&6
17602194 else
17612195 cat >conftest.make <<\_ACEOF
2196 SHELL = /bin/sh
17622197 all:
1763 @echo 'ac_maketemp="$(MAKE)"'
2198 @echo '@@@%%%=$(MAKE)=@@@%%%'
17642199 _ACEOF
17652200 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1766 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1767 if test -n "$ac_maketemp"; then
1768 eval ac_cv_prog_make_${ac_make}_set=yes
1769 else
1770 eval ac_cv_prog_make_${ac_make}_set=no
1771 fi
2201 case `${MAKE-make} -f conftest.make 2>/dev/null` in
2202 *@@@%%%=?*=@@@%%%*)
2203 eval ac_cv_prog_make_${ac_make}_set=yes;;
2204 *)
2205 eval ac_cv_prog_make_${ac_make}_set=no;;
2206 esac
17722207 rm -f conftest.make
17732208 fi
1774 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1775 echo "$as_me:$LINENO: result: yes" >&5
1776 echo "${ECHO_T}yes" >&6
2209 if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
2210 { echo "$as_me:$LINENO: result: yes" >&5
2211 echo "${ECHO_T}yes" >&6; }
17772212 SET_MAKE=
17782213 else
1779 echo "$as_me:$LINENO: result: no" >&5
1780 echo "${ECHO_T}no" >&6
2214 { echo "$as_me:$LINENO: result: no" >&5
2215 echo "${ECHO_T}no" >&6; }
17812216 SET_MAKE="MAKE=${MAKE-make}"
17822217 fi
17832218
18092244
18102245
18112246 # Define the identity of the package.
1812 PACKAGE=pam_mount
1813 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
2247 PACKAGE='pam_mount'
2248 VERSION='0.20'
18142249
18152250
18162251 cat >>confdefs.h <<_ACEOF
18482283 if test -n "$ac_tool_prefix"; then
18492284 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
18502285 set dummy ${ac_tool_prefix}strip; ac_word=$2
1851 echo "$as_me:$LINENO: checking for $ac_word" >&5
1852 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2286 { echo "$as_me:$LINENO: checking for $ac_word" >&5
2287 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
18532288 if test "${ac_cv_prog_STRIP+set}" = set; then
18542289 echo $ECHO_N "(cached) $ECHO_C" >&6
18552290 else
18622297 IFS=$as_save_IFS
18632298 test -z "$as_dir" && as_dir=.
18642299 for ac_exec_ext in '' $ac_executable_extensions; do
1865 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2300 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
18662301 ac_cv_prog_STRIP="${ac_tool_prefix}strip"
18672302 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
18682303 break 2
18692304 fi
18702305 done
18712306 done
2307 IFS=$as_save_IFS
18722308
18732309 fi
18742310 fi
18752311 STRIP=$ac_cv_prog_STRIP
18762312 if test -n "$STRIP"; then
1877 echo "$as_me:$LINENO: result: $STRIP" >&5
1878 echo "${ECHO_T}$STRIP" >&6
1879 else
1880 echo "$as_me:$LINENO: result: no" >&5
1881 echo "${ECHO_T}no" >&6
1882 fi
2313 { echo "$as_me:$LINENO: result: $STRIP" >&5
2314 echo "${ECHO_T}$STRIP" >&6; }
2315 else
2316 { echo "$as_me:$LINENO: result: no" >&5
2317 echo "${ECHO_T}no" >&6; }
2318 fi
2319
18832320
18842321 fi
18852322 if test -z "$ac_cv_prog_STRIP"; then
18862323 ac_ct_STRIP=$STRIP
18872324 # Extract the first word of "strip", so it can be a program name with args.
18882325 set dummy strip; ac_word=$2
1889 echo "$as_me:$LINENO: checking for $ac_word" >&5
1890 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2326 { echo "$as_me:$LINENO: checking for $ac_word" >&5
2327 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
18912328 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
18922329 echo $ECHO_N "(cached) $ECHO_C" >&6
18932330 else
19002337 IFS=$as_save_IFS
19012338 test -z "$as_dir" && as_dir=.
19022339 for ac_exec_ext in '' $ac_executable_extensions; do
1903 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2340 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
19042341 ac_cv_prog_ac_ct_STRIP="strip"
19052342 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
19062343 break 2
19072344 fi
19082345 done
19092346 done
1910
1911 test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
2347 IFS=$as_save_IFS
2348
19122349 fi
19132350 fi
19142351 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
19152352 if test -n "$ac_ct_STRIP"; then
1916 echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
1917 echo "${ECHO_T}$ac_ct_STRIP" >&6
1918 else
1919 echo "$as_me:$LINENO: result: no" >&5
1920 echo "${ECHO_T}no" >&6
1921 fi
1922
1923 STRIP=$ac_ct_STRIP
2353 { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
2354 echo "${ECHO_T}$ac_ct_STRIP" >&6; }
2355 else
2356 { echo "$as_me:$LINENO: result: no" >&5
2357 echo "${ECHO_T}no" >&6; }
2358 fi
2359
2360 if test "x$ac_ct_STRIP" = x; then
2361 STRIP=":"
2362 else
2363 case $cross_compiling:$ac_tool_warned in
2364 yes:)
2365 { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
2366 whose name does not start with the host triplet. If you think this
2367 configuration is useful to you, please write to autoconf@gnu.org." >&5
2368 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
2369 whose name does not start with the host triplet. If you think this
2370 configuration is useful to you, please write to autoconf@gnu.org." >&2;}
2371 ac_tool_warned=yes ;;
2372 esac
2373 STRIP=$ac_ct_STRIP
2374 fi
19242375 else
19252376 STRIP="$ac_cv_prog_STRIP"
19262377 fi
19372388 am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
19382389
19392390
1940
1941
1942
1943
1944 VER_INFO=`expr $MINOR_VERSION + $MAJOR_VERSION`:$MICRO_VERSION:$MINOR_VERSION
1945
1946
1947
1948
1949
1950
1951
1952 # Check whether --with-slibdir or --without-slibdir was given.
1953 if test "${with_slibdir+set}" = set; then
1954 withval="$with_slibdir"
1955 slibdir="$withval"
1956 else
1957 slibdir="/lib"
1958 fi;
1959
1960 # Check whether --with-ssbindir or --without-ssbindir was given.
1961 if test "${with_ssbindir+set}" = set; then
1962 withval="$with_ssbindir"
1963 ssbindir="$withval"
1964 else
1965 ssbindir="/sbin"
1966 fi;
19672391
19682392
19692393
19752399 if test -n "$ac_tool_prefix"; then
19762400 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
19772401 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1978 echo "$as_me:$LINENO: checking for $ac_word" >&5
1979 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2402 { echo "$as_me:$LINENO: checking for $ac_word" >&5
2403 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
19802404 if test "${ac_cv_prog_CC+set}" = set; then
19812405 echo $ECHO_N "(cached) $ECHO_C" >&6
19822406 else
19892413 IFS=$as_save_IFS
19902414 test -z "$as_dir" && as_dir=.
19912415 for ac_exec_ext in '' $ac_executable_extensions; do
1992 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2416 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
19932417 ac_cv_prog_CC="${ac_tool_prefix}gcc"
19942418 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
19952419 break 2
19962420 fi
19972421 done
19982422 done
2423 IFS=$as_save_IFS
19992424
20002425 fi
20012426 fi
20022427 CC=$ac_cv_prog_CC
20032428 if test -n "$CC"; then
2004 echo "$as_me:$LINENO: result: $CC" >&5
2005 echo "${ECHO_T}$CC" >&6
2006 else
2007 echo "$as_me:$LINENO: result: no" >&5
2008 echo "${ECHO_T}no" >&6
2009 fi
2429 { echo "$as_me:$LINENO: result: $CC" >&5
2430 echo "${ECHO_T}$CC" >&6; }
2431 else
2432 { echo "$as_me:$LINENO: result: no" >&5
2433 echo "${ECHO_T}no" >&6; }
2434 fi
2435
20102436
20112437 fi
20122438 if test -z "$ac_cv_prog_CC"; then
20132439 ac_ct_CC=$CC
20142440 # Extract the first word of "gcc", so it can be a program name with args.
20152441 set dummy gcc; ac_word=$2
2016 echo "$as_me:$LINENO: checking for $ac_word" >&5
2017 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2442 { echo "$as_me:$LINENO: checking for $ac_word" >&5
2443 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
20182444 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
20192445 echo $ECHO_N "(cached) $ECHO_C" >&6
20202446 else
20272453 IFS=$as_save_IFS
20282454 test -z "$as_dir" && as_dir=.
20292455 for ac_exec_ext in '' $ac_executable_extensions; do
2030 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2456 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
20312457 ac_cv_prog_ac_ct_CC="gcc"
20322458 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
20332459 break 2
20342460 fi
20352461 done
20362462 done
2463 IFS=$as_save_IFS
20372464
20382465 fi
20392466 fi
20402467 ac_ct_CC=$ac_cv_prog_ac_ct_CC
20412468 if test -n "$ac_ct_CC"; then
2042 echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
2043 echo "${ECHO_T}$ac_ct_CC" >&6
2044 else
2045 echo "$as_me:$LINENO: result: no" >&5
2046 echo "${ECHO_T}no" >&6
2047 fi
2048
2049 CC=$ac_ct_CC
2469 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
2470 echo "${ECHO_T}$ac_ct_CC" >&6; }
2471 else
2472 { echo "$as_me:$LINENO: result: no" >&5
2473 echo "${ECHO_T}no" >&6; }
2474 fi
2475
2476 if test "x$ac_ct_CC" = x; then
2477 CC=""
2478 else
2479 case $cross_compiling:$ac_tool_warned in
2480 yes:)
2481 { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
2482 whose name does not start with the host triplet. If you think this
2483 configuration is useful to you, please write to autoconf@gnu.org." >&5
2484 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
2485 whose name does not start with the host triplet. If you think this
2486 configuration is useful to you, please write to autoconf@gnu.org." >&2;}
2487 ac_tool_warned=yes ;;
2488 esac
2489 CC=$ac_ct_CC
2490 fi
20502491 else
20512492 CC="$ac_cv_prog_CC"
20522493 fi
20532494
20542495 if test -z "$CC"; then
2055 if test -n "$ac_tool_prefix"; then
2056 # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
2496 if test -n "$ac_tool_prefix"; then
2497 # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
20572498 set dummy ${ac_tool_prefix}cc; ac_word=$2
2058 echo "$as_me:$LINENO: checking for $ac_word" >&5
2059 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2499 { echo "$as_me:$LINENO: checking for $ac_word" >&5
2500 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
20602501 if test "${ac_cv_prog_CC+set}" = set; then
20612502 echo $ECHO_N "(cached) $ECHO_C" >&6
20622503 else
20692510 IFS=$as_save_IFS
20702511 test -z "$as_dir" && as_dir=.
20712512 for ac_exec_ext in '' $ac_executable_extensions; do
2072 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2513 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
20732514 ac_cv_prog_CC="${ac_tool_prefix}cc"
20742515 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
20752516 break 2
20762517 fi
20772518 done
20782519 done
2520 IFS=$as_save_IFS
20792521
20802522 fi
20812523 fi
20822524 CC=$ac_cv_prog_CC
20832525 if test -n "$CC"; then
2084 echo "$as_me:$LINENO: result: $CC" >&5
2085 echo "${ECHO_T}$CC" >&6
2086 else
2087 echo "$as_me:$LINENO: result: no" >&5
2088 echo "${ECHO_T}no" >&6
2089 fi
2090
2091 fi
2092 if test -z "$ac_cv_prog_CC"; then
2093 ac_ct_CC=$CC
2094 # Extract the first word of "cc", so it can be a program name with args.
2095 set dummy cc; ac_word=$2
2096 echo "$as_me:$LINENO: checking for $ac_word" >&5
2097 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2098 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
2099 echo $ECHO_N "(cached) $ECHO_C" >&6
2100 else
2101 if test -n "$ac_ct_CC"; then
2102 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
2103 else
2104 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2105 for as_dir in $PATH
2106 do
2107 IFS=$as_save_IFS
2108 test -z "$as_dir" && as_dir=.
2109 for ac_exec_ext in '' $ac_executable_extensions; do
2110 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2111 ac_cv_prog_ac_ct_CC="cc"
2112 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2113 break 2
2526 { echo "$as_me:$LINENO: result: $CC" >&5
2527 echo "${ECHO_T}$CC" >&6; }
2528 else
2529 { echo "$as_me:$LINENO: result: no" >&5
2530 echo "${ECHO_T}no" >&6; }
2531 fi
2532
2533
21142534 fi
2115 done
2116 done
2117
2118 fi
2119 fi
2120 ac_ct_CC=$ac_cv_prog_ac_ct_CC
2121 if test -n "$ac_ct_CC"; then
2122 echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
2123 echo "${ECHO_T}$ac_ct_CC" >&6
2124 else
2125 echo "$as_me:$LINENO: result: no" >&5
2126 echo "${ECHO_T}no" >&6
2127 fi
2128
2129 CC=$ac_ct_CC
2130 else
2131 CC="$ac_cv_prog_CC"
2132 fi
2133
21342535 fi
21352536 if test -z "$CC"; then
21362537 # Extract the first word of "cc", so it can be a program name with args.
21372538 set dummy cc; ac_word=$2
2138 echo "$as_me:$LINENO: checking for $ac_word" >&5
2139 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2539 { echo "$as_me:$LINENO: checking for $ac_word" >&5
2540 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
21402541 if test "${ac_cv_prog_CC+set}" = set; then
21412542 echo $ECHO_N "(cached) $ECHO_C" >&6
21422543 else
21502551 IFS=$as_save_IFS
21512552 test -z "$as_dir" && as_dir=.
21522553 for ac_exec_ext in '' $ac_executable_extensions; do
2153 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2554 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
21542555 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
21552556 ac_prog_rejected=yes
21562557 continue
21612562 fi
21622563 done
21632564 done
2565 IFS=$as_save_IFS
21642566
21652567 if test $ac_prog_rejected = yes; then
21662568 # We found a bogon in the path, so make sure we never use it.
21782580 fi
21792581 CC=$ac_cv_prog_CC
21802582 if test -n "$CC"; then
2181 echo "$as_me:$LINENO: result: $CC" >&5
2182 echo "${ECHO_T}$CC" >&6
2183 else
2184 echo "$as_me:$LINENO: result: no" >&5
2185 echo "${ECHO_T}no" >&6
2186 fi
2583 { echo "$as_me:$LINENO: result: $CC" >&5
2584 echo "${ECHO_T}$CC" >&6; }
2585 else
2586 { echo "$as_me:$LINENO: result: no" >&5
2587 echo "${ECHO_T}no" >&6; }
2588 fi
2589
21872590
21882591 fi
21892592 if test -z "$CC"; then
21902593 if test -n "$ac_tool_prefix"; then
2191 for ac_prog in cl
2594 for ac_prog in cl.exe
21922595 do
21932596 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
21942597 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
2195 echo "$as_me:$LINENO: checking for $ac_word" >&5
2196 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2598 { echo "$as_me:$LINENO: checking for $ac_word" >&5
2599 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
21972600 if test "${ac_cv_prog_CC+set}" = set; then
21982601 echo $ECHO_N "(cached) $ECHO_C" >&6
21992602 else
22062609 IFS=$as_save_IFS
22072610 test -z "$as_dir" && as_dir=.
22082611 for ac_exec_ext in '' $ac_executable_extensions; do
2209 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2612 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
22102613 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
22112614 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
22122615 break 2
22132616 fi
22142617 done
22152618 done
2619 IFS=$as_save_IFS
22162620
22172621 fi
22182622 fi
22192623 CC=$ac_cv_prog_CC
22202624 if test -n "$CC"; then
2221 echo "$as_me:$LINENO: result: $CC" >&5
2222 echo "${ECHO_T}$CC" >&6
2223 else
2224 echo "$as_me:$LINENO: result: no" >&5
2225 echo "${ECHO_T}no" >&6
2226 fi
2625 { echo "$as_me:$LINENO: result: $CC" >&5
2626 echo "${ECHO_T}$CC" >&6; }
2627 else
2628 { echo "$as_me:$LINENO: result: no" >&5
2629 echo "${ECHO_T}no" >&6; }
2630 fi
2631
22272632
22282633 test -n "$CC" && break
22292634 done
22302635 fi
22312636 if test -z "$CC"; then
22322637 ac_ct_CC=$CC
2233 for ac_prog in cl
2638 for ac_prog in cl.exe
22342639 do
22352640 # Extract the first word of "$ac_prog", so it can be a program name with args.
22362641 set dummy $ac_prog; ac_word=$2
2237 echo "$as_me:$LINENO: checking for $ac_word" >&5
2238 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2642 { echo "$as_me:$LINENO: checking for $ac_word" >&5
2643 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
22392644 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
22402645 echo $ECHO_N "(cached) $ECHO_C" >&6
22412646 else
22482653 IFS=$as_save_IFS
22492654 test -z "$as_dir" && as_dir=.
22502655 for ac_exec_ext in '' $ac_executable_extensions; do
2251 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2656 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
22522657 ac_cv_prog_ac_ct_CC="$ac_prog"
22532658 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
22542659 break 2
22552660 fi
22562661 done
22572662 done
2663 IFS=$as_save_IFS
22582664
22592665 fi
22602666 fi
22612667 ac_ct_CC=$ac_cv_prog_ac_ct_CC
22622668 if test -n "$ac_ct_CC"; then
2263 echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
2264 echo "${ECHO_T}$ac_ct_CC" >&6
2265 else
2266 echo "$as_me:$LINENO: result: no" >&5
2267 echo "${ECHO_T}no" >&6
2268 fi
2669 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
2670 echo "${ECHO_T}$ac_ct_CC" >&6; }
2671 else
2672 { echo "$as_me:$LINENO: result: no" >&5
2673 echo "${ECHO_T}no" >&6; }
2674 fi
2675
22692676
22702677 test -n "$ac_ct_CC" && break
22712678 done
22722679
2273 CC=$ac_ct_CC
2680 if test "x$ac_ct_CC" = x; then
2681 CC=""
2682 else
2683 case $cross_compiling:$ac_tool_warned in
2684 yes:)
2685 { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
2686 whose name does not start with the host triplet. If you think this
2687 configuration is useful to you, please write to autoconf@gnu.org." >&5
2688 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
2689 whose name does not start with the host triplet. If you think this
2690 configuration is useful to you, please write to autoconf@gnu.org." >&2;}
2691 ac_tool_warned=yes ;;
2692 esac
2693 CC=$ac_ct_CC
2694 fi
22742695 fi
22752696
22762697 fi
22832704 { (exit 1); exit 1; }; }
22842705
22852706 # Provide some information about the compiler.
2286 echo "$as_me:$LINENO:" \
2287 "checking for C compiler version" >&5
2707 echo "$as_me:$LINENO: checking for C compiler version" >&5
22882708 ac_compiler=`set X $ac_compile; echo $2`
2289 { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
2290 (eval $ac_compiler --version </dev/null >&5) 2>&5
2709 { (ac_try="$ac_compiler --version >&5"
2710 case "(($ac_try" in
2711 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2712 *) ac_try_echo=$ac_try;;
2713 esac
2714 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
2715 (eval "$ac_compiler --version >&5") 2>&5
22912716 ac_status=$?
22922717 echo "$as_me:$LINENO: \$? = $ac_status" >&5
22932718 (exit $ac_status); }
2294 { (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
2295 (eval $ac_compiler -v </dev/null >&5) 2>&5
2719 { (ac_try="$ac_compiler -v >&5"
2720 case "(($ac_try" in
2721 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2722 *) ac_try_echo=$ac_try;;
2723 esac
2724 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
2725 (eval "$ac_compiler -v >&5") 2>&5
22962726 ac_status=$?
22972727 echo "$as_me:$LINENO: \$? = $ac_status" >&5
22982728 (exit $ac_status); }
2299 { (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
2300 (eval $ac_compiler -V </dev/null >&5) 2>&5
2729 { (ac_try="$ac_compiler -V >&5"
2730 case "(($ac_try" in
2731 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2732 *) ac_try_echo=$ac_try;;
2733 esac
2734 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
2735 (eval "$ac_compiler -V >&5") 2>&5
23012736 ac_status=$?
23022737 echo "$as_me:$LINENO: \$? = $ac_status" >&5
23032738 (exit $ac_status); }
23222757 # Try to create an executable without -o first, disregard a.out.
23232758 # It will help us diagnose broken compilers, and finding out an intuition
23242759 # of exeext.
2325 echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
2326 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
2760 { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
2761 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
23272762 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
2328 if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
2329 (eval $ac_link_default) 2>&5
2763 #
2764 # List of possible output files, starting from the most likely.
2765 # The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
2766 # only as a last resort. b.out is created by i960 compilers.
2767 ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
2768 #
2769 # The IRIX 6 linker writes into existing files which may not be
2770 # executable, retaining their permissions. Remove them first so a
2771 # subsequent execution test works.
2772 ac_rmfiles=
2773 for ac_file in $ac_files
2774 do
2775 case $ac_file in
2776 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
2777 * ) ac_rmfiles="$ac_rmfiles $ac_file";;
2778 esac
2779 done
2780 rm -f $ac_rmfiles
2781
2782 if { (ac_try="$ac_link_default"
2783 case "(($ac_try" in
2784 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2785 *) ac_try_echo=$ac_try;;
2786 esac
2787 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
2788 (eval "$ac_link_default") 2>&5
23302789 ac_status=$?
23312790 echo "$as_me:$LINENO: \$? = $ac_status" >&5
23322791 (exit $ac_status); }; then
2333 # Find the output, starting from the most likely. This scheme is
2334 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
2335 # resort.
2336
2337 # Be careful to initialize this variable, since it used to be cached.
2338 # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
2339 ac_cv_exeext=
2340 # b.out is created by i960 compilers.
2341 for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
2792 # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
2793 # So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
2794 # in a Makefile. We should not override ac_cv_exeext if it was cached,
2795 # so that the user can short-circuit this test for compilers unknown to
2796 # Autoconf.
2797 for ac_file in $ac_files
23422798 do
23432799 test -f "$ac_file" || continue
23442800 case $ac_file in
2345 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
2346 ;;
2347 conftest.$ac_ext )
2348 # This is the source file.
2801 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
23492802 ;;
23502803 [ab].out )
23512804 # We found the default executable, but exeext='' is most
23522805 # certainly right.
23532806 break;;
23542807 *.* )
2355 ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
2356 # FIXME: I believe we export ac_cv_exeext for Libtool,
2357 # but it would be cool to find out if it's true. Does anybody
2358 # maintain Libtool? --akim.
2359 export ac_cv_exeext
2808 if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
2809 then :; else
2810 ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
2811 fi
2812 # We set ac_cv_exeext here because the later test for it is not
2813 # safe: cross compilers may not add the suffix if given an `-o'
2814 # argument, so we may need to know it at that point already.
2815 # Even if this section looks crufty: it has the advantage of
2816 # actually working.
23602817 break;;
23612818 * )
23622819 break;;
23632820 esac
23642821 done
2822 test "$ac_cv_exeext" = no && ac_cv_exeext=
2823
23652824 else
23662825 echo "$as_me: failed program was:" >&5
23672826 sed 's/^/| /' conftest.$ac_ext >&5
23742833 fi
23752834
23762835 ac_exeext=$ac_cv_exeext
2377 echo "$as_me:$LINENO: result: $ac_file" >&5
2378 echo "${ECHO_T}$ac_file" >&6
2379
2380 # Check the compiler produces executables we can run. If not, either
2836 { echo "$as_me:$LINENO: result: $ac_file" >&5
2837 echo "${ECHO_T}$ac_file" >&6; }
2838
2839 # Check that the compiler produces executables we can run. If not, either
23812840 # the compiler is broken, or we cross compile.
2382 echo "$as_me:$LINENO: checking whether the C compiler works" >&5
2383 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
2841 { echo "$as_me:$LINENO: checking whether the C compiler works" >&5
2842 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
23842843 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
23852844 # If not cross compiling, check that we can run a simple program.
23862845 if test "$cross_compiling" != yes; then
23872846 if { ac_try='./$ac_file'
2388 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2389 (eval $ac_try) 2>&5
2847 { (case "(($ac_try" in
2848 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2849 *) ac_try_echo=$ac_try;;
2850 esac
2851 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
2852 (eval "$ac_try") 2>&5
23902853 ac_status=$?
23912854 echo "$as_me:$LINENO: \$? = $ac_status" >&5
23922855 (exit $ac_status); }; }; then
24052868 fi
24062869 fi
24072870 fi
2408 echo "$as_me:$LINENO: result: yes" >&5
2409 echo "${ECHO_T}yes" >&6
2871 { echo "$as_me:$LINENO: result: yes" >&5
2872 echo "${ECHO_T}yes" >&6; }
24102873
24112874 rm -f a.out a.exe conftest$ac_cv_exeext b.out
24122875 ac_clean_files=$ac_clean_files_save
2413 # Check the compiler produces executables we can run. If not, either
2876 # Check that the compiler produces executables we can run. If not, either
24142877 # the compiler is broken, or we cross compile.
2415 echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
2416 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
2417 echo "$as_me:$LINENO: result: $cross_compiling" >&5
2418 echo "${ECHO_T}$cross_compiling" >&6
2419
2420 echo "$as_me:$LINENO: checking for suffix of executables" >&5
2421 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
2422 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
2423 (eval $ac_link) 2>&5
2878 { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
2879 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
2880 { echo "$as_me:$LINENO: result: $cross_compiling" >&5
2881 echo "${ECHO_T}$cross_compiling" >&6; }
2882
2883 { echo "$as_me:$LINENO: checking for suffix of executables" >&5
2884 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
2885 if { (ac_try="$ac_link"
2886 case "(($ac_try" in
2887 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2888 *) ac_try_echo=$ac_try;;
2889 esac
2890 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
2891 (eval "$ac_link") 2>&5
24242892 ac_status=$?
24252893 echo "$as_me:$LINENO: \$? = $ac_status" >&5
24262894 (exit $ac_status); }; then
24312899 for ac_file in conftest.exe conftest conftest.*; do
24322900 test -f "$ac_file" || continue
24332901 case $ac_file in
2434 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
2902 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
24352903 *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
2436 export ac_cv_exeext
24372904 break;;
24382905 * ) break;;
24392906 esac
24472914 fi
24482915
24492916 rm -f conftest$ac_cv_exeext
2450 echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
2451 echo "${ECHO_T}$ac_cv_exeext" >&6
2917 { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
2918 echo "${ECHO_T}$ac_cv_exeext" >&6; }
24522919
24532920 rm -f conftest.$ac_ext
24542921 EXEEXT=$ac_cv_exeext
24552922 ac_exeext=$EXEEXT
2456 echo "$as_me:$LINENO: checking for suffix of object files" >&5
2457 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
2923 { echo "$as_me:$LINENO: checking for suffix of object files" >&5
2924 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
24582925 if test "${ac_cv_objext+set}" = set; then
24592926 echo $ECHO_N "(cached) $ECHO_C" >&6
24602927 else
24742941 }
24752942 _ACEOF
24762943 rm -f conftest.o conftest.obj
2477 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
2478 (eval $ac_compile) 2>&5
2944 if { (ac_try="$ac_compile"
2945 case "(($ac_try" in
2946 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2947 *) ac_try_echo=$ac_try;;
2948 esac
2949 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
2950 (eval "$ac_compile") 2>&5
24792951 ac_status=$?
24802952 echo "$as_me:$LINENO: \$? = $ac_status" >&5
24812953 (exit $ac_status); }; then
2482 for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
2954 for ac_file in conftest.o conftest.obj conftest.*; do
2955 test -f "$ac_file" || continue;
24832956 case $ac_file in
2484 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
2957 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
24852958 *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
24862959 break;;
24872960 esac
24992972
25002973 rm -f conftest.$ac_cv_objext conftest.$ac_ext
25012974 fi
2502 echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
2503 echo "${ECHO_T}$ac_cv_objext" >&6
2975 { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
2976 echo "${ECHO_T}$ac_cv_objext" >&6; }
25042977 OBJEXT=$ac_cv_objext
25052978 ac_objext=$OBJEXT
2506 echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
2507 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
2979 { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
2980 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
25082981 if test "${ac_cv_c_compiler_gnu+set}" = set; then
25092982 echo $ECHO_N "(cached) $ECHO_C" >&6
25102983 else
25273000 }
25283001 _ACEOF
25293002 rm -f conftest.$ac_objext
2530 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
2531 (eval $ac_compile) 2>conftest.er1
3003 if { (ac_try="$ac_compile"
3004 case "(($ac_try" in
3005 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3006 *) ac_try_echo=$ac_try;;
3007 esac
3008 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3009 (eval "$ac_compile") 2>conftest.er1
25323010 ac_status=$?
25333011 grep -v '^ *+' conftest.er1 >conftest.err
25343012 rm -f conftest.er1
25353013 cat conftest.err >&5
25363014 echo "$as_me:$LINENO: \$? = $ac_status" >&5
25373015 (exit $ac_status); } &&
2538 { ac_try='test -z "$ac_c_werror_flag"
2539 || test ! -s conftest.err'
2540 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2541 (eval $ac_try) 2>&5
3016 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
3017 { (case "(($ac_try" in
3018 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3019 *) ac_try_echo=$ac_try;;
3020 esac
3021 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3022 (eval "$ac_try") 2>&5
25423023 ac_status=$?
25433024 echo "$as_me:$LINENO: \$? = $ac_status" >&5
25443025 (exit $ac_status); }; } &&
25453026 { ac_try='test -s conftest.$ac_objext'
2546 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2547 (eval $ac_try) 2>&5
3027 { (case "(($ac_try" in
3028 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3029 *) ac_try_echo=$ac_try;;
3030 esac
3031 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3032 (eval "$ac_try") 2>&5
25483033 ac_status=$?
25493034 echo "$as_me:$LINENO: \$? = $ac_status" >&5
25503035 (exit $ac_status); }; }; then
25533038 echo "$as_me: failed program was:" >&5
25543039 sed 's/^/| /' conftest.$ac_ext >&5
25553040
2556 ac_compiler_gnu=no
2557 fi
2558 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
3041 ac_compiler_gnu=no
3042 fi
3043
3044 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25593045 ac_cv_c_compiler_gnu=$ac_compiler_gnu
25603046
25613047 fi
2562 echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
2563 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
3048 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
3049 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
25643050 GCC=`test $ac_compiler_gnu = yes && echo yes`
25653051 ac_test_CFLAGS=${CFLAGS+set}
25663052 ac_save_CFLAGS=$CFLAGS
2567 CFLAGS="-g"
2568 echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
2569 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
3053 { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
3054 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
25703055 if test "${ac_cv_prog_cc_g+set}" = set; then
25713056 echo $ECHO_N "(cached) $ECHO_C" >&6
25723057 else
2573 cat >conftest.$ac_ext <<_ACEOF
3058 ac_save_c_werror_flag=$ac_c_werror_flag
3059 ac_c_werror_flag=yes
3060 ac_cv_prog_cc_g=no
3061 CFLAGS="-g"
3062 cat >conftest.$ac_ext <<_ACEOF
25743063 /* confdefs.h. */
25753064 _ACEOF
25763065 cat confdefs.h >>conftest.$ac_ext
25863075 }
25873076 _ACEOF
25883077 rm -f conftest.$ac_objext
2589 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
2590 (eval $ac_compile) 2>conftest.er1
3078 if { (ac_try="$ac_compile"
3079 case "(($ac_try" in
3080 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3081 *) ac_try_echo=$ac_try;;
3082 esac
3083 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3084 (eval "$ac_compile") 2>conftest.er1
25913085 ac_status=$?
25923086 grep -v '^ *+' conftest.er1 >conftest.err
25933087 rm -f conftest.er1
25943088 cat conftest.err >&5
25953089 echo "$as_me:$LINENO: \$? = $ac_status" >&5
25963090 (exit $ac_status); } &&
2597 { ac_try='test -z "$ac_c_werror_flag"
2598 || test ! -s conftest.err'
2599 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2600 (eval $ac_try) 2>&5
3091 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
3092 { (case "(($ac_try" in
3093 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3094 *) ac_try_echo=$ac_try;;
3095 esac
3096 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3097 (eval "$ac_try") 2>&5
26013098 ac_status=$?
26023099 echo "$as_me:$LINENO: \$? = $ac_status" >&5
26033100 (exit $ac_status); }; } &&
26043101 { ac_try='test -s conftest.$ac_objext'
2605 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2606 (eval $ac_try) 2>&5
3102 { (case "(($ac_try" in
3103 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3104 *) ac_try_echo=$ac_try;;
3105 esac
3106 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3107 (eval "$ac_try") 2>&5
26073108 ac_status=$?
26083109 echo "$as_me:$LINENO: \$? = $ac_status" >&5
26093110 (exit $ac_status); }; }; then
26123113 echo "$as_me: failed program was:" >&5
26133114 sed 's/^/| /' conftest.$ac_ext >&5
26143115
2615 ac_cv_prog_cc_g=no
2616 fi
2617 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
2618 fi
2619 echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
2620 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
3116 CFLAGS=""
3117 cat >conftest.$ac_ext <<_ACEOF
3118 /* confdefs.h. */
3119 _ACEOF
3120 cat confdefs.h >>conftest.$ac_ext
3121 cat >>conftest.$ac_ext <<_ACEOF
3122 /* end confdefs.h. */
3123
3124 int
3125 main ()
3126 {
3127
3128 ;
3129 return 0;
3130 }
3131 _ACEOF
3132 rm -f conftest.$ac_objext
3133 if { (ac_try="$ac_compile"
3134 case "(($ac_try" in
3135 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3136 *) ac_try_echo=$ac_try;;
3137 esac
3138 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3139 (eval "$ac_compile") 2>conftest.er1
3140 ac_status=$?
3141 grep -v '^ *+' conftest.er1 >conftest.err
3142 rm -f conftest.er1
3143 cat conftest.err >&5
3144 echo "$as_me:$LINENO: \$? = $ac_status" >&5
3145 (exit $ac_status); } &&
3146 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
3147 { (case "(($ac_try" in
3148 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3149 *) ac_try_echo=$ac_try;;
3150 esac
3151 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3152 (eval "$ac_try") 2>&5
3153 ac_status=$?
3154 echo "$as_me:$LINENO: \$? = $ac_status" >&5
3155 (exit $ac_status); }; } &&
3156 { ac_try='test -s conftest.$ac_objext'
3157 { (case "(($ac_try" in
3158 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3159 *) ac_try_echo=$ac_try;;
3160 esac
3161 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3162 (eval "$ac_try") 2>&5
3163 ac_status=$?
3164 echo "$as_me:$LINENO: \$? = $ac_status" >&5
3165 (exit $ac_status); }; }; then
3166 :
3167 else
3168 echo "$as_me: failed program was:" >&5
3169 sed 's/^/| /' conftest.$ac_ext >&5
3170
3171 ac_c_werror_flag=$ac_save_c_werror_flag
3172 CFLAGS="-g"
3173 cat >conftest.$ac_ext <<_ACEOF
3174 /* confdefs.h. */
3175 _ACEOF
3176 cat confdefs.h >>conftest.$ac_ext
3177 cat >>conftest.$ac_ext <<_ACEOF
3178 /* end confdefs.h. */
3179
3180 int
3181 main ()
3182 {
3183
3184 ;
3185 return 0;
3186 }
3187 _ACEOF
3188 rm -f conftest.$ac_objext
3189 if { (ac_try="$ac_compile"
3190 case "(($ac_try" in
3191 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3192 *) ac_try_echo=$ac_try;;
3193 esac
3194 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3195 (eval "$ac_compile") 2>conftest.er1
3196 ac_status=$?
3197 grep -v '^ *+' conftest.er1 >conftest.err
3198 rm -f conftest.er1
3199 cat conftest.err >&5
3200 echo "$as_me:$LINENO: \$? = $ac_status" >&5
3201 (exit $ac_status); } &&
3202 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
3203 { (case "(($ac_try" in
3204 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3205 *) ac_try_echo=$ac_try;;
3206 esac
3207 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3208 (eval "$ac_try") 2>&5
3209 ac_status=$?
3210 echo "$as_me:$LINENO: \$? = $ac_status" >&5
3211 (exit $ac_status); }; } &&
3212 { ac_try='test -s conftest.$ac_objext'
3213 { (case "(($ac_try" in
3214 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3215 *) ac_try_echo=$ac_try;;
3216 esac
3217 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3218 (eval "$ac_try") 2>&5
3219 ac_status=$?
3220 echo "$as_me:$LINENO: \$? = $ac_status" >&5
3221 (exit $ac_status); }; }; then
3222 ac_cv_prog_cc_g=yes
3223 else
3224 echo "$as_me: failed program was:" >&5
3225 sed 's/^/| /' conftest.$ac_ext >&5
3226
3227
3228 fi
3229
3230 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3231 fi
3232
3233 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3234 fi
3235
3236 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3237 ac_c_werror_flag=$ac_save_c_werror_flag
3238 fi
3239 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
3240 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
26213241 if test "$ac_test_CFLAGS" = set; then
26223242 CFLAGS=$ac_save_CFLAGS
26233243 elif test $ac_cv_prog_cc_g = yes; then
26333253 CFLAGS=
26343254 fi
26353255 fi
2636 echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
2637 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2638 if test "${ac_cv_prog_cc_stdc+set}" = set; then
3256 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
3257 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
3258 if test "${ac_cv_prog_cc_c89+set}" = set; then
26393259 echo $ECHO_N "(cached) $ECHO_C" >&6
26403260 else
2641 ac_cv_prog_cc_stdc=no
3261 ac_cv_prog_cc_c89=no
26423262 ac_save_CC=$CC
26433263 cat >conftest.$ac_ext <<_ACEOF
26443264 /* confdefs.h. */
26723292 /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
26733293 function prototypes and stuff, but not '\xHH' hex character constants.
26743294 These don't provoke an error unfortunately, instead are silently treated
2675 as 'x'. The following induces an error, until -std1 is added to get
3295 as 'x'. The following induces an error, until -std is added to get
26763296 proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
26773297 array size at least. It's necessary to write '\x00'==0 to get something
2678 that's true only with -std1. */
3298 that's true only with -std. */
26793299 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
3300
3301 /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
3302 inside strings and character constants. */
3303 #define FOO(x) 'x'
3304 int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
26803305
26813306 int test (int i, double x);
26823307 struct s1 {int (*f) (int a);};
26923317 return 0;
26933318 }
26943319 _ACEOF
2695 # Don't try gcc -ansi; that turns off useful extensions and
2696 # breaks some systems' header files.
2697 # AIX -qlanglvl=ansi
2698 # Ultrix and OSF/1 -std1
2699 # HP-UX 10.20 and later -Ae
2700 # HP-UX older versions -Aa -D_HPUX_SOURCE
2701 # SVR4 -Xc -D__EXTENSIONS__
2702 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3320 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
3321 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
27033322 do
27043323 CC="$ac_save_CC $ac_arg"
27053324 rm -f conftest.$ac_objext
2706 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
2707 (eval $ac_compile) 2>conftest.er1
3325 if { (ac_try="$ac_compile"
3326 case "(($ac_try" in
3327 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3328 *) ac_try_echo=$ac_try;;
3329 esac
3330 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3331 (eval "$ac_compile") 2>conftest.er1
27083332 ac_status=$?
27093333 grep -v '^ *+' conftest.er1 >conftest.err
27103334 rm -f conftest.er1
27113335 cat conftest.err >&5
27123336 echo "$as_me:$LINENO: \$? = $ac_status" >&5
27133337 (exit $ac_status); } &&
2714 { ac_try='test -z "$ac_c_werror_flag"
2715 || test ! -s conftest.err'
2716 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2717 (eval $ac_try) 2>&5
3338 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
3339 { (case "(($ac_try" in
3340 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3341 *) ac_try_echo=$ac_try;;
3342 esac
3343 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3344 (eval "$ac_try") 2>&5
27183345 ac_status=$?
27193346 echo "$as_me:$LINENO: \$? = $ac_status" >&5
27203347 (exit $ac_status); }; } &&
27213348 { ac_try='test -s conftest.$ac_objext'
2722 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2723 (eval $ac_try) 2>&5
3349 { (case "(($ac_try" in
3350 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3351 *) ac_try_echo=$ac_try;;
3352 esac
3353 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3354 (eval "$ac_try") 2>&5
27243355 ac_status=$?
27253356 echo "$as_me:$LINENO: \$? = $ac_status" >&5
27263357 (exit $ac_status); }; }; then
2727 ac_cv_prog_cc_stdc=$ac_arg
2728 break
3358 ac_cv_prog_cc_c89=$ac_arg
27293359 else
27303360 echo "$as_me: failed program was:" >&5
27313361 sed 's/^/| /' conftest.$ac_ext >&5
27323362
2733 fi
2734 rm -f conftest.err conftest.$ac_objext
3363
3364 fi
3365
3366 rm -f core conftest.err conftest.$ac_objext
3367 test "x$ac_cv_prog_cc_c89" != "xno" && break
27353368 done
2736 rm -f conftest.$ac_ext conftest.$ac_objext
3369 rm -f conftest.$ac_ext
27373370 CC=$ac_save_CC
27383371
27393372 fi
2740
2741 case "x$ac_cv_prog_cc_stdc" in
2742 x|xno)
2743 echo "$as_me:$LINENO: result: none needed" >&5
2744 echo "${ECHO_T}none needed" >&6 ;;
3373 # AC_CACHE_VAL
3374 case "x$ac_cv_prog_cc_c89" in
3375 x)
3376 { echo "$as_me:$LINENO: result: none needed" >&5
3377 echo "${ECHO_T}none needed" >&6; } ;;
3378 xno)
3379 { echo "$as_me:$LINENO: result: unsupported" >&5
3380 echo "${ECHO_T}unsupported" >&6; } ;;
27453381 *)
2746 echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
2747 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2748 CC="$CC $ac_cv_prog_cc_stdc" ;;
3382 CC="$CC $ac_cv_prog_cc_c89"
3383 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
3384 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
27493385 esac
27503386
2751 # Some people use a C++ compiler to compile C. Since we use `exit',
2752 # in C++ we need to declare it. In case someone uses the same compiler
2753 # for both compiling C and C++ we need to have the C++ compiler decide
2754 # the declaration of exit, since it's the most demanding environment.
2755 cat >conftest.$ac_ext <<_ACEOF
2756 #ifndef __cplusplus
2757 choke me
2758 #endif
2759 _ACEOF
2760 rm -f conftest.$ac_objext
2761 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
2762 (eval $ac_compile) 2>conftest.er1
2763 ac_status=$?
2764 grep -v '^ *+' conftest.er1 >conftest.err
2765 rm -f conftest.er1
2766 cat conftest.err >&5
2767 echo "$as_me:$LINENO: \$? = $ac_status" >&5
2768 (exit $ac_status); } &&
2769 { ac_try='test -z "$ac_c_werror_flag"
2770 || test ! -s conftest.err'
2771 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2772 (eval $ac_try) 2>&5
2773 ac_status=$?
2774 echo "$as_me:$LINENO: \$? = $ac_status" >&5
2775 (exit $ac_status); }; } &&
2776 { ac_try='test -s conftest.$ac_objext'
2777 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2778 (eval $ac_try) 2>&5
2779 ac_status=$?
2780 echo "$as_me:$LINENO: \$? = $ac_status" >&5
2781 (exit $ac_status); }; }; then
2782 for ac_declaration in \
2783 '' \
2784 'extern "C" void std::exit (int) throw (); using std::exit;' \
2785 'extern "C" void std::exit (int); using std::exit;' \
2786 'extern "C" void exit (int) throw ();' \
2787 'extern "C" void exit (int);' \
2788 'void exit (int);'
2789 do
2790 cat >conftest.$ac_ext <<_ACEOF
2791 /* confdefs.h. */
2792 _ACEOF
2793 cat confdefs.h >>conftest.$ac_ext
2794 cat >>conftest.$ac_ext <<_ACEOF
2795 /* end confdefs.h. */
2796 $ac_declaration
2797 #include <stdlib.h>
2798 int
2799 main ()
2800 {
2801 exit (42);
2802 ;
2803 return 0;
2804 }
2805 _ACEOF
2806 rm -f conftest.$ac_objext
2807 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
2808 (eval $ac_compile) 2>conftest.er1
2809 ac_status=$?
2810 grep -v '^ *+' conftest.er1 >conftest.err
2811 rm -f conftest.er1
2812 cat conftest.err >&5
2813 echo "$as_me:$LINENO: \$? = $ac_status" >&5
2814 (exit $ac_status); } &&
2815 { ac_try='test -z "$ac_c_werror_flag"
2816 || test ! -s conftest.err'
2817 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2818 (eval $ac_try) 2>&5
2819 ac_status=$?
2820 echo "$as_me:$LINENO: \$? = $ac_status" >&5
2821 (exit $ac_status); }; } &&
2822 { ac_try='test -s conftest.$ac_objext'
2823 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2824 (eval $ac_try) 2>&5
2825 ac_status=$?
2826 echo "$as_me:$LINENO: \$? = $ac_status" >&5
2827 (exit $ac_status); }; }; then
2828 :
2829 else
2830 echo "$as_me: failed program was:" >&5
2831 sed 's/^/| /' conftest.$ac_ext >&5
2832
2833 continue
2834 fi
2835 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
2836 cat >conftest.$ac_ext <<_ACEOF
2837 /* confdefs.h. */
2838 _ACEOF
2839 cat confdefs.h >>conftest.$ac_ext
2840 cat >>conftest.$ac_ext <<_ACEOF
2841 /* end confdefs.h. */
2842 $ac_declaration
2843 int
2844 main ()
2845 {
2846 exit (42);
2847 ;
2848 return 0;
2849 }
2850 _ACEOF
2851 rm -f conftest.$ac_objext
2852 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
2853 (eval $ac_compile) 2>conftest.er1
2854 ac_status=$?
2855 grep -v '^ *+' conftest.er1 >conftest.err
2856 rm -f conftest.er1
2857 cat conftest.err >&5
2858 echo "$as_me:$LINENO: \$? = $ac_status" >&5
2859 (exit $ac_status); } &&
2860 { ac_try='test -z "$ac_c_werror_flag"
2861 || test ! -s conftest.err'
2862 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2863 (eval $ac_try) 2>&5
2864 ac_status=$?
2865 echo "$as_me:$LINENO: \$? = $ac_status" >&5
2866 (exit $ac_status); }; } &&
2867 { ac_try='test -s conftest.$ac_objext'
2868 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2869 (eval $ac_try) 2>&5
2870 ac_status=$?
2871 echo "$as_me:$LINENO: \$? = $ac_status" >&5
2872 (exit $ac_status); }; }; then
2873 break
2874 else
2875 echo "$as_me: failed program was:" >&5
2876 sed 's/^/| /' conftest.$ac_ext >&5
2877
2878 fi
2879 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
2880 done
2881 rm -f conftest*
2882 if test -n "$ac_declaration"; then
2883 echo '#ifdef __cplusplus' >>confdefs.h
2884 echo $ac_declaration >>confdefs.h
2885 echo '#endif' >>confdefs.h
2886 fi
2887
2888 else
2889 echo "$as_me: failed program was:" >&5
2890 sed 's/^/| /' conftest.$ac_ext >&5
2891
2892 fi
2893 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
3387
28943388 ac_ext=c
28953389 ac_cpp='$CPP $CPPFLAGS'
28963390 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
28983392 ac_compiler_gnu=$ac_cv_c_compiler_gnu
28993393 DEPDIR="${am__leading_dot}deps"
29003394
2901 ac_config_commands="$ac_config_commands depfiles"
3395 ac_config_commands="$ac_config_commands depfiles"
29023396
29033397
29043398 am_make=${MAKE-make}
29083402 .PHONY: am__doit
29093403 END
29103404 # If we don't find an include directive, just comment out the code.
2911 echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
2912 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
3405 { echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
3406 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; }
29133407 am__include="#"
29143408 am__quote=
29153409 _am_result=none
29363430 fi
29373431
29383432
2939 echo "$as_me:$LINENO: result: $_am_result" >&5
2940 echo "${ECHO_T}$_am_result" >&6
3433 { echo "$as_me:$LINENO: result: $_am_result" >&5
3434 echo "${ECHO_T}$_am_result" >&6; }
29413435 rm -f confinc confmf
29423436
2943 # Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
3437 # Check whether --enable-dependency-tracking was given.
29443438 if test "${enable_dependency_tracking+set}" = set; then
2945 enableval="$enable_dependency_tracking"
2946
2947 fi;
3439 enableval=$enable_dependency_tracking;
3440 fi
3441
29483442 if test "x$enable_dependency_tracking" != xno; then
29493443 am_depcomp="$ac_aux_dir/depcomp"
29503444 AMDEPBACKSLASH='\'
29643458
29653459 depcc="$CC" am_compiler_list=
29663460
2967 echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
2968 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
3461 { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
3462 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
29693463 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
29703464 echo $ECHO_N "(cached) $ECHO_C" >&6
29713465 else
30543548 fi
30553549
30563550 fi
3057 echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
3058 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
3551 { echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
3552 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; }
30593553 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
30603554
30613555
30713565 fi
30723566
30733567
3074
3075 # GCC 4.x -fvisibility=hidden {
3076
3077 ac_ext=c
3078 ac_cpp='$CPP $CPPFLAGS'
3079 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3080 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3081 ac_compiler_gnu=$ac_cv_c_compiler_gnu
3082
3083 saved_CFLAGS="$CFLAGS"
3084 CFLAGS="$saved_CFLAGS -fvisibility=hidden"
3085 echo "$as_me:$LINENO: checking whether compiler accepts -fvisibility=hidden" >&5
3086 echo $ECHO_N "checking whether compiler accepts -fvisibility=hidden... $ECHO_C" >&6
3087 if test "${cv_fvisibility_hidden+set}" = set; then
3568 if test "x$CC" != xcc; then
3569 { echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
3570 echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6; }
3571 else
3572 { echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
3573 echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6; }
3574 fi
3575 set dummy $CC; ac_cc=`echo $2 |
3576 sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
3577 if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then
30883578 echo $ECHO_N "(cached) $ECHO_C" >&6
30893579 else
3090
3091 cat >conftest.$ac_ext <<_ACEOF
3580 cat >conftest.$ac_ext <<_ACEOF
30923581 /* confdefs.h. */
30933582 _ACEOF
30943583 cat confdefs.h >>conftest.$ac_ext
31033592 return 0;
31043593 }
31053594 _ACEOF
3106 rm -f conftest.$ac_objext
3107 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
3108 (eval $ac_compile) 2>conftest.er1
3595 # Make sure it works both with $CC and with simple cc.
3596 # We do the test twice because some compilers refuse to overwrite an
3597 # existing .o file with -o, though they will create one.
3598 ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
3599 rm -f conftest2.*
3600 if { (case "(($ac_try" in
3601 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3602 *) ac_try_echo=$ac_try;;
3603 esac
3604 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3605 (eval "$ac_try") 2>&5
31093606 ac_status=$?
3110 grep -v '^ *+' conftest.er1 >conftest.err
3111 rm -f conftest.er1
3112 cat conftest.err >&5
31133607 echo "$as_me:$LINENO: \$? = $ac_status" >&5
31143608 (exit $ac_status); } &&
3115 { ac_try='test -z "$ac_c_werror_flag"
3116 || test ! -s conftest.err'
3117 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3118 (eval $ac_try) 2>&5
3609 test -f conftest2.$ac_objext && { (case "(($ac_try" in
3610 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3611 *) ac_try_echo=$ac_try;;
3612 esac
3613 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3614 (eval "$ac_try") 2>&5
31193615 ac_status=$?
31203616 echo "$as_me:$LINENO: \$? = $ac_status" >&5
3121 (exit $ac_status); }; } &&
3122 { ac_try='test -s conftest.$ac_objext'
3123 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3124 (eval $ac_try) 2>&5
3617 (exit $ac_status); };
3618 then
3619 eval ac_cv_prog_cc_${ac_cc}_c_o=yes
3620 if test "x$CC" != xcc; then
3621 # Test first that cc exists at all.
3622 if { ac_try='cc -c conftest.$ac_ext >&5'
3623 { (case "(($ac_try" in
3624 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3625 *) ac_try_echo=$ac_try;;
3626 esac
3627 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3628 (eval "$ac_try") 2>&5
31253629 ac_status=$?
31263630 echo "$as_me:$LINENO: \$? = $ac_status" >&5
31273631 (exit $ac_status); }; }; then
3128 cv_fvisibility_hidden=yes
3129 else
3130 echo "$as_me: failed program was:" >&5
3131 sed 's/^/| /' conftest.$ac_ext >&5
3132
3133 cv_fvisibility_hidden=no
3134
3135 fi
3136 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
3137
3138 fi
3139 echo "$as_me:$LINENO: result: $cv_fvisibility_hidden" >&5
3140 echo "${ECHO_T}$cv_fvisibility_hidden" >&6
3141 if test "$cv_fvisibility_hidden" = "yes"; then
3632 ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
3633 rm -f conftest2.*
3634 if { (case "(($ac_try" in
3635 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3636 *) ac_try_echo=$ac_try;;
3637 esac
3638 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3639 (eval "$ac_try") 2>&5
3640 ac_status=$?
3641 echo "$as_me:$LINENO: \$? = $ac_status" >&5
3642 (exit $ac_status); } &&
3643 test -f conftest2.$ac_objext && { (case "(($ac_try" in
3644 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3645 *) ac_try_echo=$ac_try;;
3646 esac
3647 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3648 (eval "$ac_try") 2>&5
3649 ac_status=$?
3650 echo "$as_me:$LINENO: \$? = $ac_status" >&5
3651 (exit $ac_status); };
3652 then
3653 # cc works too.
3654 :
3655 else
3656 # cc exists but doesn't like -o.
3657 eval ac_cv_prog_cc_${ac_cc}_c_o=no
3658 fi
3659 fi
3660 fi
3661 else
3662 eval ac_cv_prog_cc_${ac_cc}_c_o=no
3663 fi
3664 rm -f core conftest*
3665
3666 fi
3667 if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
3668 { echo "$as_me:$LINENO: result: yes" >&5
3669 echo "${ECHO_T}yes" >&6; }
3670 else
3671 { echo "$as_me:$LINENO: result: no" >&5
3672 echo "${ECHO_T}no" >&6; }
31423673
31433674 cat >>confdefs.h <<\_ACEOF
3144 #define HAVE_VISIBILITY_HIDDEN
3675 #define NO_MINUS_C_MINUS_O 1
31453676 _ACEOF
31463677
3147 GCC_FVISIBILITY_HIDDEN=-fvisibility=hidden
3148
3149 fi
3150 CFLAGS="$saved_CFLAGS"
3151 ac_ext=c
3152 ac_cpp='$CPP $CPPFLAGS'
3153 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3154 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3155 ac_compiler_gnu=$ac_cv_c_compiler_gnu
3156
3157
3158 # }
3159
3160 # Find a good install program. We prefer a C program (faster),
3161 # so one script is as good as another. But avoid the broken or
3162 # incompatible versions:
3163 # SysV /etc/install, /usr/sbin/install
3164 # SunOS /usr/etc/install
3165 # IRIX /sbin/install
3166 # AIX /bin/install
3167 # AmigaOS /C/install, which installs bootblocks on floppy discs
3168 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
3169 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
3170 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
3171 # OS/2's system install, which has a completely different semantic
3172 # ./install, which can be erroneously created by make from ./install.sh.
3173 echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
3174 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
3175 if test -z "$INSTALL"; then
3176 if test "${ac_cv_path_install+set}" = set; then
3177 echo $ECHO_N "(cached) $ECHO_C" >&6
3178 else
3179 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3180 for as_dir in $PATH
3181 do
3182 IFS=$as_save_IFS
3183 test -z "$as_dir" && as_dir=.
3184 # Account for people who put trailing slashes in PATH elements.
3185 case $as_dir/ in
3186 ./ | .// | /cC/* | \
3187 /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
3188 ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
3189 /usr/ucb/* ) ;;
3190 *)
3191 # OSF1 and SCO ODT 3.0 have their own names for install.
3192 # Don't use installbsd from OSF since it installs stuff as root
3193 # by default.
3194 for ac_prog in ginstall scoinst install; do
3195 for ac_exec_ext in '' $ac_executable_extensions; do
3196 if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
3197 if test $ac_prog = install &&
3198 grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
3199 # AIX install. It has an incompatible calling convention.
3200 :
3201 elif test $ac_prog = install &&
3202 grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
3203 # program-specific install script used by HP pwplus--don't use.
3204 :
3205 else
3206 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
3207 break 3
3208 fi
3678 fi
3679
3680 # FIXME: we rely on the cache variable name because
3681 # there is no other way.
3682 set dummy $CC
3683 ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
3684 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
3685 # Losing compiler, so override with the script.
3686 # FIXME: It is wrong to rewrite CC.
3687 # But if we don't then we get into trouble of one sort or another.
3688 # A longer-term fix would be to have automake use am__CC in this case,
3689 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
3690 CC="$am_aux_dir/compile $CC"
3691 fi
3692
3693 # Check whether --enable-static was given.
3694 if test "${enable_static+set}" = set; then
3695 enableval=$enable_static; p=${PACKAGE-default}
3696 case $enableval in
3697 yes) enable_static=yes ;;
3698 no) enable_static=no ;;
3699 *)
3700 enable_static=no
3701 # Look at the argument we got. We use all the common list separators.
3702 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
3703 for pkg in $enableval; do
3704 IFS="$lt_save_ifs"
3705 if test "X$pkg" = "X$p"; then
3706 enable_static=yes
32093707 fi
32103708 done
3211 done
3212 ;;
3213 esac
3214 done
3215
3216
3217 fi
3218 if test "${ac_cv_path_install+set}" = set; then
3219 INSTALL=$ac_cv_path_install
3220 else
3221 # As a last resort, use the slow shell script. We don't cache a
3222 # path for INSTALL within a source directory, because that will
3223 # break other packages using the cache if that directory is
3224 # removed, or if the path is relative.
3225 INSTALL=$ac_install_sh
3226 fi
3227 fi
3228 echo "$as_me:$LINENO: result: $INSTALL" >&5
3229 echo "${ECHO_T}$INSTALL" >&6
3230
3231 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
3232 # It thinks the first close brace ends the variable substitution.
3233 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
3234
3235 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
3236
3237 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
3238
3239 # Check whether --enable-shared or --disable-shared was given.
3709 IFS="$lt_save_ifs"
3710 ;;
3711 esac
3712 else
3713 enable_static=no
3714 fi
3715
3716
3717
3718 # Check whether --enable-shared was given.
32403719 if test "${enable_shared+set}" = set; then
3241 enableval="$enable_shared"
3242 p=${PACKAGE-default}
3720 enableval=$enable_shared; p=${PACKAGE-default}
32433721 case $enableval in
32443722 yes) enable_shared=yes ;;
32453723 no) enable_shared=no ;;
32583736 esac
32593737 else
32603738 enable_shared=yes
3261 fi;
3262
3263 # Check whether --enable-static or --disable-static was given.
3264 if test "${enable_static+set}" = set; then
3265 enableval="$enable_static"
3266 p=${PACKAGE-default}
3267 case $enableval in
3268 yes) enable_static=yes ;;
3269 no) enable_static=no ;;
3270 *)
3271 enable_static=no
3272 # Look at the argument we got. We use all the common list separators.
3273 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
3274 for pkg in $enableval; do
3275 IFS="$lt_save_ifs"
3276 if test "X$pkg" = "X$p"; then
3277 enable_static=yes
3278 fi
3279 done
3280 IFS="$lt_save_ifs"
3281 ;;
3282 esac
3283 else
3284 enable_static=yes
3285 fi;
3286
3287 # Check whether --enable-fast-install or --disable-fast-install was given.
3739 fi
3740
3741
3742 # Check whether --enable-fast-install was given.
32883743 if test "${enable_fast_install+set}" = set; then
3289 enableval="$enable_fast_install"
3290 p=${PACKAGE-default}
3744 enableval=$enable_fast_install; p=${PACKAGE-default}
32913745 case $enableval in
32923746 yes) enable_fast_install=yes ;;
32933747 no) enable_fast_install=no ;;
33063760 esac
33073761 else
33083762 enable_fast_install=yes
3309 fi;
3763 fi
3764
33103765
33113766 # Make sure we can run config.sub.
3312 $ac_config_sub sun4 >/dev/null 2>&1 ||
3313 { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
3314 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
3767 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
3768 { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
3769 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
33153770 { (exit 1); exit 1; }; }
33163771
3317 echo "$as_me:$LINENO: checking build system type" >&5
3318 echo $ECHO_N "checking build system type... $ECHO_C" >&6
3772 { echo "$as_me:$LINENO: checking build system type" >&5
3773 echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
33193774 if test "${ac_cv_build+set}" = set; then
33203775 echo $ECHO_N "(cached) $ECHO_C" >&6
33213776 else
3322 ac_cv_build_alias=$build_alias
3323 test -z "$ac_cv_build_alias" &&
3324 ac_cv_build_alias=`$ac_config_guess`
3325 test -z "$ac_cv_build_alias" &&
3777 ac_build_alias=$build_alias
3778 test "x$ac_build_alias" = x &&
3779 ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
3780 test "x$ac_build_alias" = x &&
33263781 { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
33273782 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
33283783 { (exit 1); exit 1; }; }
3329 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
3330 { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
3331 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
3784 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
3785 { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
3786 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
33323787 { (exit 1); exit 1; }; }
33333788
33343789 fi
3335 echo "$as_me:$LINENO: result: $ac_cv_build" >&5
3336 echo "${ECHO_T}$ac_cv_build" >&6
3790 { echo "$as_me:$LINENO: result: $ac_cv_build" >&5
3791 echo "${ECHO_T}$ac_cv_build" >&6; }
3792 case $ac_cv_build in
3793 *-*-*) ;;
3794 *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
3795 echo "$as_me: error: invalid value of canonical build" >&2;}
3796 { (exit 1); exit 1; }; };;
3797 esac
33373798 build=$ac_cv_build
3338 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
3339 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
3340 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
3341
3342
3343 echo "$as_me:$LINENO: checking host system type" >&5
3344 echo $ECHO_N "checking host system type... $ECHO_C" >&6
3799 ac_save_IFS=$IFS; IFS='-'
3800 set x $ac_cv_build
3801 shift
3802 build_cpu=$1
3803 build_vendor=$2
3804 shift; shift
3805 # Remember, the first character of IFS is used to create $*,
3806 # except with old shells:
3807 build_os=$*
3808 IFS=$ac_save_IFS
3809 case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
3810
3811
3812 { echo "$as_me:$LINENO: checking host system type" >&5
3813 echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
33453814 if test "${ac_cv_host+set}" = set; then
33463815 echo $ECHO_N "(cached) $ECHO_C" >&6
33473816 else
3348 ac_cv_host_alias=$host_alias
3349 test -z "$ac_cv_host_alias" &&
3350 ac_cv_host_alias=$ac_cv_build_alias
3351 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
3352 { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
3353 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
3817 if test "x$host_alias" = x; then
3818 ac_cv_host=$ac_cv_build
3819 else
3820 ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
3821 { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
3822 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
33543823 { (exit 1); exit 1; }; }
3355
3356 fi
3357 echo "$as_me:$LINENO: result: $ac_cv_host" >&5
3358 echo "${ECHO_T}$ac_cv_host" >&6
3824 fi
3825
3826 fi
3827 { echo "$as_me:$LINENO: result: $ac_cv_host" >&5
3828 echo "${ECHO_T}$ac_cv_host" >&6; }
3829 case $ac_cv_host in
3830 *-*-*) ;;
3831 *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
3832 echo "$as_me: error: invalid value of canonical host" >&2;}
3833 { (exit 1); exit 1; }; };;
3834 esac
33593835 host=$ac_cv_host
3360 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
3361 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
3362 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
3363
3364
3365 echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
3366 echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6
3836 ac_save_IFS=$IFS; IFS='-'
3837 set x $ac_cv_host
3838 shift
3839 host_cpu=$1
3840 host_vendor=$2
3841 shift; shift
3842 # Remember, the first character of IFS is used to create $*,
3843 # except with old shells:
3844 host_os=$*
3845 IFS=$ac_save_IFS
3846 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
3847
3848
3849 { echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
3850 echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; }
33673851 if test "${lt_cv_path_SED+set}" = set; then
33683852 echo $ECHO_N "(cached) $ECHO_C" >&6
33693853 else
34163900 fi
34173901
34183902 SED=$lt_cv_path_SED
3419 echo "$as_me:$LINENO: result: $SED" >&5
3420 echo "${ECHO_T}$SED" >&6
3421
3422 echo "$as_me:$LINENO: checking for egrep" >&5
3423 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
3424 if test "${ac_cv_prog_egrep+set}" = set; then
3903 { echo "$as_me:$LINENO: result: $SED" >&5
3904 echo "${ECHO_T}$SED" >&6; }
3905
3906 { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
3907 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
3908 if test "${ac_cv_path_GREP+set}" = set; then
34253909 echo $ECHO_N "(cached) $ECHO_C" >&6
34263910 else
3427 if echo a | (grep -E '(a|b)') >/dev/null 2>&1
3428 then ac_cv_prog_egrep='grep -E'
3429 else ac_cv_prog_egrep='egrep'
3911 # Extract the first word of "grep ggrep" to use in msg output
3912 if test -z "$GREP"; then
3913 set dummy grep ggrep; ac_prog_name=$2
3914 if test "${ac_cv_path_GREP+set}" = set; then
3915 echo $ECHO_N "(cached) $ECHO_C" >&6
3916 else
3917 ac_path_GREP_found=false
3918 # Loop through the user's path and test for each of PROGNAME-LIST
3919 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3920 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
3921 do
3922 IFS=$as_save_IFS
3923 test -z "$as_dir" && as_dir=.
3924 for ac_prog in grep ggrep; do
3925 for ac_exec_ext in '' $ac_executable_extensions; do
3926 ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
3927 { test -f "$ac_path_GREP" && $as_executable_p "$ac_path_GREP"; } || continue
3928 # Check for GNU ac_path_GREP and select it if it is found.
3929 # Check for GNU $ac_path_GREP
3930 case `"$ac_path_GREP" --version 2>&1` in
3931 *GNU*)
3932 ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
3933 *)
3934 ac_count=0
3935 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
3936 while :
3937 do
3938 cat "conftest.in" "conftest.in" >"conftest.tmp"
3939 mv "conftest.tmp" "conftest.in"
3940 cp "conftest.in" "conftest.nl"
3941 echo 'GREP' >> "conftest.nl"
3942 "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
3943 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
3944 ac_count=`expr $ac_count + 1`
3945 if test $ac_count -gt ${ac_path_GREP_max-0}; then
3946 # Best one so far, save it but keep looking for a better one
3947 ac_cv_path_GREP="$ac_path_GREP"
3948 ac_path_GREP_max=$ac_count
34303949 fi
3431 fi
3432 echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
3433 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
3434 EGREP=$ac_cv_prog_egrep
3435
3436
3437
3438 # Check whether --with-gnu-ld or --without-gnu-ld was given.
3950 # 10*(2^10) chars as input seems more than enough
3951 test $ac_count -gt 10 && break
3952 done
3953 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
3954 esac
3955
3956
3957 $ac_path_GREP_found && break 3
3958 done
3959 done
3960
3961 done
3962 IFS=$as_save_IFS
3963
3964
3965 fi
3966
3967 GREP="$ac_cv_path_GREP"
3968 if test -z "$GREP"; then
3969 { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
3970 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
3971 { (exit 1); exit 1; }; }
3972 fi
3973
3974 else
3975 ac_cv_path_GREP=$GREP
3976 fi
3977
3978
3979 fi
3980 { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
3981 echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
3982 GREP="$ac_cv_path_GREP"
3983
3984
3985 { echo "$as_me:$LINENO: checking for egrep" >&5
3986 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
3987 if test "${ac_cv_path_EGREP+set}" = set; then
3988 echo $ECHO_N "(cached) $ECHO_C" >&6
3989 else
3990 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
3991 then ac_cv_path_EGREP="$GREP -E"
3992 else
3993 # Extract the first word of "egrep" to use in msg output
3994 if test -z "$EGREP"; then
3995 set dummy egrep; ac_prog_name=$2
3996 if test "${ac_cv_path_EGREP+set}" = set; then
3997 echo $ECHO_N "(cached) $ECHO_C" >&6
3998 else
3999 ac_path_EGREP_found=false
4000 # Loop through the user's path and test for each of PROGNAME-LIST
4001 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4002 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4003 do
4004 IFS=$as_save_IFS
4005 test -z "$as_dir" && as_dir=.
4006 for ac_prog in egrep; do
4007 for ac_exec_ext in '' $ac_executable_extensions; do
4008 ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
4009 { test -f "$ac_path_EGREP" && $as_executable_p "$ac_path_EGREP"; } || continue
4010 # Check for GNU ac_path_EGREP and select it if it is found.
4011 # Check for GNU $ac_path_EGREP
4012 case `"$ac_path_EGREP" --version 2>&1` in
4013 *GNU*)
4014 ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
4015 *)
4016 ac_count=0
4017 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
4018 while :
4019 do
4020 cat "conftest.in" "conftest.in" >"conftest.tmp"
4021 mv "conftest.tmp" "conftest.in"
4022 cp "conftest.in" "conftest.nl"
4023 echo 'EGREP' >> "conftest.nl"
4024 "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
4025 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4026 ac_count=`expr $ac_count + 1`
4027 if test $ac_count -gt ${ac_path_EGREP_max-0}; then
4028 # Best one so far, save it but keep looking for a better one
4029 ac_cv_path_EGREP="$ac_path_EGREP"
4030 ac_path_EGREP_max=$ac_count
4031 fi
4032 # 10*(2^10) chars as input seems more than enough
4033 test $ac_count -gt 10 && break
4034 done
4035 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4036 esac
4037
4038
4039 $ac_path_EGREP_found && break 3
4040 done
4041 done
4042
4043 done
4044 IFS=$as_save_IFS
4045
4046
4047 fi
4048
4049 EGREP="$ac_cv_path_EGREP"
4050 if test -z "$EGREP"; then
4051 { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
4052 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
4053 { (exit 1); exit 1; }; }
4054 fi
4055
4056 else
4057 ac_cv_path_EGREP=$EGREP
4058 fi
4059
4060
4061 fi
4062 fi
4063 { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
4064 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
4065 EGREP="$ac_cv_path_EGREP"
4066
4067
4068
4069 # Check whether --with-gnu-ld was given.
34394070 if test "${with_gnu_ld+set}" = set; then
3440 withval="$with_gnu_ld"
3441 test "$withval" = no || with_gnu_ld=yes
4071 withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
34424072 else
34434073 with_gnu_ld=no
3444 fi;
4074 fi
4075
34454076 ac_prog=ld
34464077 if test "$GCC" = yes; then
34474078 # Check if gcc -print-prog-name=ld gives a path.
3448 echo "$as_me:$LINENO: checking for ld used by $CC" >&5
3449 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
4079 { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
4080 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
34504081 case $host in
34514082 *-*-mingw*)
34524083 # gcc leaves a trailing carriage return which upsets mingw
34754106 ;;
34764107 esac
34774108 elif test "$with_gnu_ld" = yes; then
3478 echo "$as_me:$LINENO: checking for GNU ld" >&5
3479 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
3480 else
3481 echo "$as_me:$LINENO: checking for non-GNU ld" >&5
3482 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
4109 { echo "$as_me:$LINENO: checking for GNU ld" >&5
4110 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
4111 else
4112 { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
4113 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
34834114 fi
34844115 if test "${lt_cv_path_LD+set}" = set; then
34854116 echo $ECHO_N "(cached) $ECHO_C" >&6
35124143
35134144 LD="$lt_cv_path_LD"
35144145 if test -n "$LD"; then
3515 echo "$as_me:$LINENO: result: $LD" >&5
3516 echo "${ECHO_T}$LD" >&6
3517 else
3518 echo "$as_me:$LINENO: result: no" >&5
3519 echo "${ECHO_T}no" >&6
4146 { echo "$as_me:$LINENO: result: $LD" >&5
4147 echo "${ECHO_T}$LD" >&6; }
4148 else
4149 { echo "$as_me:$LINENO: result: no" >&5
4150 echo "${ECHO_T}no" >&6; }
35204151 fi
35214152 test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
35224153 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
35234154 { (exit 1); exit 1; }; }
3524 echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
3525 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
4155 { echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
4156 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
35264157 if test "${lt_cv_prog_gnu_ld+set}" = set; then
35274158 echo $ECHO_N "(cached) $ECHO_C" >&6
35284159 else
35364167 ;;
35374168 esac
35384169 fi
3539 echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
3540 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
4170 { echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
4171 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
35414172 with_gnu_ld=$lt_cv_prog_gnu_ld
35424173
35434174
3544 echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
3545 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6
4175 { echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
4176 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; }
35464177 if test "${lt_cv_ld_reload_flag+set}" = set; then
35474178 echo $ECHO_N "(cached) $ECHO_C" >&6
35484179 else
35494180 lt_cv_ld_reload_flag='-r'
35504181 fi
3551 echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
3552 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6
4182 { echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
4183 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; }
35534184 reload_flag=$lt_cv_ld_reload_flag
35544185 case $reload_flag in
35554186 "" | " "*) ;;
35664197 ;;
35674198 esac
35684199
3569 echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
3570 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
4200 { echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
4201 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; }
35714202 if test "${lt_cv_path_NM+set}" = set; then
35724203 echo $ECHO_N "(cached) $ECHO_C" >&6
35734204 else
36154246 test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
36164247 fi
36174248 fi
3618 echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
3619 echo "${ECHO_T}$lt_cv_path_NM" >&6
4249 { echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
4250 echo "${ECHO_T}$lt_cv_path_NM" >&6; }
36204251 NM="$lt_cv_path_NM"
36214252
3622 echo "$as_me:$LINENO: checking whether ln -s works" >&5
3623 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
4253 { echo "$as_me:$LINENO: checking whether ln -s works" >&5
4254 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
36244255 LN_S=$as_ln_s
36254256 if test "$LN_S" = "ln -s"; then
3626 echo "$as_me:$LINENO: result: yes" >&5
3627 echo "${ECHO_T}yes" >&6
3628 else
3629 echo "$as_me:$LINENO: result: no, using $LN_S" >&5
3630 echo "${ECHO_T}no, using $LN_S" >&6
3631 fi
3632
3633 echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
3634 echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6
4257 { echo "$as_me:$LINENO: result: yes" >&5
4258 echo "${ECHO_T}yes" >&6; }
4259 else
4260 { echo "$as_me:$LINENO: result: no, using $LN_S" >&5
4261 echo "${ECHO_T}no, using $LN_S" >&6; }
4262 fi
4263
4264 { echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
4265 echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; }
36354266 if test "${lt_cv_deplibs_check_method+set}" = set; then
36364267 echo $ECHO_N "(cached) $ECHO_C" >&6
36374268 else
38064437 esac
38074438
38084439 fi
3809 echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
3810 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6
4440 { echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
4441 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; }
38114442 file_magic_cmd=$lt_cv_file_magic_cmd
38124443 deplibs_check_method=$lt_cv_deplibs_check_method
38134444 test -z "$deplibs_check_method" && deplibs_check_method=unknown
38244455 # Allow CC to be a program name with arguments.
38254456 compiler=$CC
38264457
3827 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
4458
4459 # Check whether --enable-libtool-lock was given.
38284460 if test "${enable_libtool_lock+set}" = set; then
3829 enableval="$enable_libtool_lock"
3830
3831 fi;
4461 enableval=$enable_libtool_lock;
4462 fi
4463
38324464 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
38334465
38344466 # Some flags need to be propagated to the compiler or linker for good
38554487 ;;
38564488 *-*-irix6*)
38574489 # Find out which ABI we are using.
3858 echo '#line 3859 "configure"' > conftest.$ac_ext
4490 echo '#line 4491 "configure"' > conftest.$ac_ext
38594491 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
38604492 (eval $ac_compile) 2>&5
38614493 ac_status=$?
39404572 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
39414573 SAVE_CFLAGS="$CFLAGS"
39424574 CFLAGS="$CFLAGS -belf"
3943 echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
3944 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
4575 { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
4576 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; }
39454577 if test "${lt_cv_cc_needs_belf+set}" = set; then
39464578 echo $ECHO_N "(cached) $ECHO_C" >&6
39474579 else
39674599 }
39684600 _ACEOF
39694601 rm -f conftest.$ac_objext conftest$ac_exeext
3970 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
3971 (eval $ac_link) 2>conftest.er1
4602 if { (ac_try="$ac_link"
4603 case "(($ac_try" in
4604 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4605 *) ac_try_echo=$ac_try;;
4606 esac
4607 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
4608 (eval "$ac_link") 2>conftest.er1
39724609 ac_status=$?
39734610 grep -v '^ *+' conftest.er1 >conftest.err
39744611 rm -f conftest.er1
39754612 cat conftest.err >&5
39764613 echo "$as_me:$LINENO: \$? = $ac_status" >&5
39774614 (exit $ac_status); } &&
3978 { ac_try='test -z "$ac_c_werror_flag"
3979 || test ! -s conftest.err'
3980 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3981 (eval $ac_try) 2>&5
4615 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
4616 { (case "(($ac_try" in
4617 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4618 *) ac_try_echo=$ac_try;;
4619 esac
4620 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
4621 (eval "$ac_try") 2>&5
39824622 ac_status=$?
39834623 echo "$as_me:$LINENO: \$? = $ac_status" >&5
39844624 (exit $ac_status); }; } &&
39854625 { ac_try='test -s conftest$ac_exeext'
3986 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3987 (eval $ac_try) 2>&5
4626 { (case "(($ac_try" in
4627 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4628 *) ac_try_echo=$ac_try;;
4629 esac
4630 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
4631 (eval "$ac_try") 2>&5
39884632 ac_status=$?
39894633 echo "$as_me:$LINENO: \$? = $ac_status" >&5
39904634 (exit $ac_status); }; }; then
39934637 echo "$as_me: failed program was:" >&5
39944638 sed 's/^/| /' conftest.$ac_ext >&5
39954639
3996 lt_cv_cc_needs_belf=no
3997 fi
3998 rm -f conftest.err conftest.$ac_objext \
4640 lt_cv_cc_needs_belf=no
4641 fi
4642
4643 rm -f core conftest.err conftest.$ac_objext \
39994644 conftest$ac_exeext conftest.$ac_ext
40004645 ac_ext=c
40014646 ac_cpp='$CPP $CPPFLAGS'
40044649 ac_compiler_gnu=$ac_cv_c_compiler_gnu
40054650
40064651 fi
4007 echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
4008 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6
4652 { echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
4653 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; }
40094654 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
40104655 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
40114656 CFLAGS="$SAVE_CFLAGS"
40424687 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
40434688 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
40444689 ac_compiler_gnu=$ac_cv_c_compiler_gnu
4045 echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
4046 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
4690 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
4691 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
40474692 # On Suns, sometimes $CPP names a directory.
40484693 if test -n "$CPP" && test -d "$CPP"; then
40494694 CPP=
40774722 #endif
40784723 Syntax error
40794724 _ACEOF
4080 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
4081 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4725 if { (ac_try="$ac_cpp conftest.$ac_ext"
4726 case "(($ac_try" in
4727 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4728 *) ac_try_echo=$ac_try;;
4729 esac
4730 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
4731 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
40824732 ac_status=$?
40834733 grep -v '^ *+' conftest.er1 >conftest.err
40844734 rm -f conftest.er1
41034753 # Broken: fails on valid input.
41044754 continue
41054755 fi
4756
41064757 rm -f conftest.err conftest.$ac_ext
41074758
4108 # OK, works on sane cases. Now check whether non-existent headers
4759 # OK, works on sane cases. Now check whether nonexistent headers
41094760 # can be detected and how.
41104761 cat >conftest.$ac_ext <<_ACEOF
41114762 /* confdefs.h. */
41154766 /* end confdefs.h. */
41164767 #include <ac_nonexistent.h>
41174768 _ACEOF
4118 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
4119 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4769 if { (ac_try="$ac_cpp conftest.$ac_ext"
4770 case "(($ac_try" in
4771 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4772 *) ac_try_echo=$ac_try;;
4773 esac
4774 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
4775 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
41204776 ac_status=$?
41214777 grep -v '^ *+' conftest.er1 >conftest.err
41224778 rm -f conftest.er1
41434799 ac_preproc_ok=:
41444800 break
41454801 fi
4802
41464803 rm -f conftest.err conftest.$ac_ext
41474804
41484805 done
41604817 else
41614818 ac_cv_prog_CPP=$CPP
41624819 fi
4163 echo "$as_me:$LINENO: result: $CPP" >&5
4164 echo "${ECHO_T}$CPP" >&6
4820 { echo "$as_me:$LINENO: result: $CPP" >&5
4821 echo "${ECHO_T}$CPP" >&6; }
41654822 ac_preproc_ok=false
41664823 for ac_c_preproc_warn_flag in '' yes
41674824 do
41844841 #endif
41854842 Syntax error
41864843 _ACEOF
4187 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
4188 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4844 if { (ac_try="$ac_cpp conftest.$ac_ext"
4845 case "(($ac_try" in
4846 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4847 *) ac_try_echo=$ac_try;;
4848 esac
4849 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
4850 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
41894851 ac_status=$?
41904852 grep -v '^ *+' conftest.er1 >conftest.err
41914853 rm -f conftest.er1
42104872 # Broken: fails on valid input.
42114873 continue
42124874 fi
4875
42134876 rm -f conftest.err conftest.$ac_ext
42144877
4215 # OK, works on sane cases. Now check whether non-existent headers
4878 # OK, works on sane cases. Now check whether nonexistent headers
42164879 # can be detected and how.
42174880 cat >conftest.$ac_ext <<_ACEOF
42184881 /* confdefs.h. */
42224885 /* end confdefs.h. */
42234886 #include <ac_nonexistent.h>
42244887 _ACEOF
4225 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
4226 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4888 if { (ac_try="$ac_cpp conftest.$ac_ext"
4889 case "(($ac_try" in
4890 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4891 *) ac_try_echo=$ac_try;;
4892 esac
4893 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
4894 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
42274895 ac_status=$?
42284896 grep -v '^ *+' conftest.er1 >conftest.err
42294897 rm -f conftest.er1
42504918 ac_preproc_ok=:
42514919 break
42524920 fi
4921
42534922 rm -f conftest.err conftest.$ac_ext
42544923
42554924 done
42724941 ac_compiler_gnu=$ac_cv_c_compiler_gnu
42734942
42744943
4275 echo "$as_me:$LINENO: checking for ANSI C header files" >&5
4276 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
4944 { echo "$as_me:$LINENO: checking for ANSI C header files" >&5
4945 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
42774946 if test "${ac_cv_header_stdc+set}" = set; then
42784947 echo $ECHO_N "(cached) $ECHO_C" >&6
42794948 else
42974966 }
42984967 _ACEOF
42994968 rm -f conftest.$ac_objext
4300 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
4301 (eval $ac_compile) 2>conftest.er1
4969 if { (ac_try="$ac_compile"
4970 case "(($ac_try" in
4971 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4972 *) ac_try_echo=$ac_try;;
4973 esac
4974 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
4975 (eval "$ac_compile") 2>conftest.er1
43024976 ac_status=$?
43034977 grep -v '^ *+' conftest.er1 >conftest.err
43044978 rm -f conftest.er1
43054979 cat conftest.err >&5
43064980 echo "$as_me:$LINENO: \$? = $ac_status" >&5
43074981 (exit $ac_status); } &&
4308 { ac_try='test -z "$ac_c_werror_flag"
4309 || test ! -s conftest.err'
4310 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4311 (eval $ac_try) 2>&5
4982 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
4983 { (case "(($ac_try" in
4984 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4985 *) ac_try_echo=$ac_try;;
4986 esac
4987 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
4988 (eval "$ac_try") 2>&5
43124989 ac_status=$?
43134990 echo "$as_me:$LINENO: \$? = $ac_status" >&5
43144991 (exit $ac_status); }; } &&
43154992 { ac_try='test -s conftest.$ac_objext'
4316 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4317 (eval $ac_try) 2>&5
4993 { (case "(($ac_try" in
4994 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4995 *) ac_try_echo=$ac_try;;
4996 esac
4997 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
4998 (eval "$ac_try") 2>&5
43184999 ac_status=$?
43195000 echo "$as_me:$LINENO: \$? = $ac_status" >&5
43205001 (exit $ac_status); }; }; then
43235004 echo "$as_me: failed program was:" >&5
43245005 sed 's/^/| /' conftest.$ac_ext >&5
43255006
4326 ac_cv_header_stdc=no
4327 fi
4328 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
5007 ac_cv_header_stdc=no
5008 fi
5009
5010 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
43295011
43305012 if test $ac_cv_header_stdc = yes; then
43315013 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
43815063 cat >>conftest.$ac_ext <<_ACEOF
43825064 /* end confdefs.h. */
43835065 #include <ctype.h>
5066 #include <stdlib.h>
43845067 #if ((' ' & 0x0FF) == 0x020)
43855068 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
43865069 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
44005083 for (i = 0; i < 256; i++)
44015084 if (XOR (islower (i), ISLOWER (i))
44025085 || toupper (i) != TOUPPER (i))
4403 exit(2);
4404 exit (0);
5086 return 2;
5087 return 0;
44055088 }
44065089 _ACEOF
44075090 rm -f conftest$ac_exeext
4408 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
4409 (eval $ac_link) 2>&5
5091 if { (ac_try="$ac_link"
5092 case "(($ac_try" in
5093 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5094 *) ac_try_echo=$ac_try;;
5095 esac
5096 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
5097 (eval "$ac_link") 2>&5
44105098 ac_status=$?
44115099 echo "$as_me:$LINENO: \$? = $ac_status" >&5
44125100 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4413 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4414 (eval $ac_try) 2>&5
5101 { (case "(($ac_try" in
5102 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5103 *) ac_try_echo=$ac_try;;
5104 esac
5105 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
5106 (eval "$ac_try") 2>&5
44155107 ac_status=$?
44165108 echo "$as_me:$LINENO: \$? = $ac_status" >&5
44175109 (exit $ac_status); }; }; then
44245116 ( exit $ac_status )
44255117 ac_cv_header_stdc=no
44265118 fi
4427 rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4428 fi
4429 fi
4430 fi
4431 echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
4432 echo "${ECHO_T}$ac_cv_header_stdc" >&6
5119 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5120 fi
5121
5122
5123 fi
5124 fi
5125 { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
5126 echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
44335127 if test $ac_cv_header_stdc = yes; then
44345128
44355129 cat >>confdefs.h <<\_ACEOF
44525146 inttypes.h stdint.h unistd.h
44535147 do
44545148 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4455 echo "$as_me:$LINENO: checking for $ac_header" >&5
4456 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4457 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5149 { echo "$as_me:$LINENO: checking for $ac_header" >&5
5150 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
5151 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
44585152 echo $ECHO_N "(cached) $ECHO_C" >&6
44595153 else
44605154 cat >conftest.$ac_ext <<_ACEOF
44685162 #include <$ac_header>
44695163 _ACEOF
44705164 rm -f conftest.$ac_objext
4471 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
4472 (eval $ac_compile) 2>conftest.er1
5165 if { (ac_try="$ac_compile"
5166 case "(($ac_try" in
5167 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5168 *) ac_try_echo=$ac_try;;
5169 esac
5170 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
5171 (eval "$ac_compile") 2>conftest.er1
44735172 ac_status=$?
44745173 grep -v '^ *+' conftest.er1 >conftest.err
44755174 rm -f conftest.er1
44765175 cat conftest.err >&5
44775176 echo "$as_me:$LINENO: \$? = $ac_status" >&5
44785177 (exit $ac_status); } &&
4479 { ac_try='test -z "$ac_c_werror_flag"
4480 || test ! -s conftest.err'
4481 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4482 (eval $ac_try) 2>&5
5178 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
5179 { (case "(($ac_try" in
5180 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5181 *) ac_try_echo=$ac_try;;
5182 esac
5183 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
5184 (eval "$ac_try") 2>&5
44835185 ac_status=$?
44845186 echo "$as_me:$LINENO: \$? = $ac_status" >&5
44855187 (exit $ac_status); }; } &&
44865188 { ac_try='test -s conftest.$ac_objext'
4487 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4488 (eval $ac_try) 2>&5
5189 { (case "(($ac_try" in
5190 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5191 *) ac_try_echo=$ac_try;;
5192 esac
5193 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
5194 (eval "$ac_try") 2>&5
44895195 ac_status=$?
44905196 echo "$as_me:$LINENO: \$? = $ac_status" >&5
44915197 (exit $ac_status); }; }; then
44945200 echo "$as_me: failed program was:" >&5
44955201 sed 's/^/| /' conftest.$ac_ext >&5
44965202
4497 eval "$as_ac_Header=no"
4498 fi
4499 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
4500 fi
4501 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
4502 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5203 eval "$as_ac_Header=no"
5204 fi
5205
5206 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5207 fi
5208 ac_res=`eval echo '${'$as_ac_Header'}'`
5209 { echo "$as_me:$LINENO: result: $ac_res" >&5
5210 echo "${ECHO_T}$ac_res" >&6; }
45035211 if test `eval echo '${'$as_ac_Header'}'` = yes; then
45045212 cat >>confdefs.h <<_ACEOF
45055213 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
45145222 for ac_header in dlfcn.h
45155223 do
45165224 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4517 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4518 echo "$as_me:$LINENO: checking for $ac_header" >&5
4519 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4520 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5225 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
5226 { echo "$as_me:$LINENO: checking for $ac_header" >&5
5227 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
5228 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
45215229 echo $ECHO_N "(cached) $ECHO_C" >&6
45225230 fi
4523 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
4524 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5231 ac_res=`eval echo '${'$as_ac_Header'}'`
5232 { echo "$as_me:$LINENO: result: $ac_res" >&5
5233 echo "${ECHO_T}$ac_res" >&6; }
45255234 else
45265235 # Is the header compilable?
4527 echo "$as_me:$LINENO: checking $ac_header usability" >&5
4528 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
5236 { echo "$as_me:$LINENO: checking $ac_header usability" >&5
5237 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
45295238 cat >conftest.$ac_ext <<_ACEOF
45305239 /* confdefs.h. */
45315240 _ACEOF
45365245 #include <$ac_header>
45375246 _ACEOF
45385247 rm -f conftest.$ac_objext
4539 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
4540 (eval $ac_compile) 2>conftest.er1
5248 if { (ac_try="$ac_compile"
5249 case "(($ac_try" in
5250 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5251 *) ac_try_echo=$ac_try;;
5252 esac
5253 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
5254 (eval "$ac_compile") 2>conftest.er1
45415255 ac_status=$?
45425256 grep -v '^ *+' conftest.er1 >conftest.err
45435257 rm -f conftest.er1
45445258 cat conftest.err >&5
45455259 echo "$as_me:$LINENO: \$? = $ac_status" >&5
45465260 (exit $ac_status); } &&
4547 { ac_try='test -z "$ac_c_werror_flag"
4548 || test ! -s conftest.err'
4549 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4550 (eval $ac_try) 2>&5
5261 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
5262 { (case "(($ac_try" in
5263 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5264 *) ac_try_echo=$ac_try;;
5265 esac
5266 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
5267 (eval "$ac_try") 2>&5
45515268 ac_status=$?
45525269 echo "$as_me:$LINENO: \$? = $ac_status" >&5
45535270 (exit $ac_status); }; } &&
45545271 { ac_try='test -s conftest.$ac_objext'
4555 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4556 (eval $ac_try) 2>&5
5272 { (case "(($ac_try" in
5273 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5274 *) ac_try_echo=$ac_try;;
5275 esac
5276 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
5277 (eval "$ac_try") 2>&5
45575278 ac_status=$?
45585279 echo "$as_me:$LINENO: \$? = $ac_status" >&5
45595280 (exit $ac_status); }; }; then
45625283 echo "$as_me: failed program was:" >&5
45635284 sed 's/^/| /' conftest.$ac_ext >&5
45645285
4565 ac_header_compiler=no
4566 fi
4567 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
4568 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
4569 echo "${ECHO_T}$ac_header_compiler" >&6
5286 ac_header_compiler=no
5287 fi
5288
5289 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5290 { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
5291 echo "${ECHO_T}$ac_header_compiler" >&6; }
45705292
45715293 # Is the header present?
4572 echo "$as_me:$LINENO: checking $ac_header presence" >&5
4573 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
5294 { echo "$as_me:$LINENO: checking $ac_header presence" >&5
5295 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
45745296 cat >conftest.$ac_ext <<_ACEOF
45755297 /* confdefs.h. */
45765298 _ACEOF
45795301 /* end confdefs.h. */
45805302 #include <$ac_header>
45815303 _ACEOF
4582 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
4583 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5304 if { (ac_try="$ac_cpp conftest.$ac_ext"
5305 case "(($ac_try" in
5306 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5307 *) ac_try_echo=$ac_try;;
5308 esac
5309 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
5310 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
45845311 ac_status=$?
45855312 grep -v '^ *+' conftest.er1 >conftest.err
45865313 rm -f conftest.er1
46045331
46055332 ac_header_preproc=no
46065333 fi
5334
46075335 rm -f conftest.err conftest.$ac_ext
4608 echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
4609 echo "${ECHO_T}$ac_header_preproc" >&6
5336 { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
5337 echo "${ECHO_T}$ac_header_preproc" >&6; }
46105338
46115339 # So? What about this header?
46125340 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
46305358 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
46315359 { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
46325360 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
4633 (
4634 cat <<\_ASBOX
4635 ## ------------------------------------------ ##
4636 ## Report this to the AC_PACKAGE_NAME lists. ##
4637 ## ------------------------------------------ ##
4638 _ASBOX
4639 ) |
4640 sed "s/^/$as_me: WARNING: /" >&2
5361
46415362 ;;
46425363 esac
4643 echo "$as_me:$LINENO: checking for $ac_header" >&5
4644 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4645 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5364 { echo "$as_me:$LINENO: checking for $ac_header" >&5
5365 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
5366 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
46465367 echo $ECHO_N "(cached) $ECHO_C" >&6
46475368 else
46485369 eval "$as_ac_Header=\$ac_header_preproc"
46495370 fi
4650 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
4651 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5371 ac_res=`eval echo '${'$as_ac_Header'}'`
5372 { echo "$as_me:$LINENO: result: $ac_res" >&5
5373 echo "${ECHO_T}$ac_res" >&6; }
46525374
46535375 fi
46545376 if test `eval echo '${'$as_ac_Header'}'` = yes; then
46605382
46615383 done
46625384
4663 ac_ext=cc
5385 ac_ext=cpp
46645386 ac_cpp='$CXXCPP $CPPFLAGS'
46655387 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
46665388 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
46675389 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
4668 if test -n "$ac_tool_prefix"; then
4669 for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
5390 if test -z "$CXX"; then
5391 if test -n "$CCC"; then
5392 CXX=$CCC
5393 else
5394 if test -n "$ac_tool_prefix"; then
5395 for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
46705396 do
46715397 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
46725398 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4673 echo "$as_me:$LINENO: checking for $ac_word" >&5
4674 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5399 { echo "$as_me:$LINENO: checking for $ac_word" >&5
5400 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
46755401 if test "${ac_cv_prog_CXX+set}" = set; then
46765402 echo $ECHO_N "(cached) $ECHO_C" >&6
46775403 else
46845410 IFS=$as_save_IFS
46855411 test -z "$as_dir" && as_dir=.
46865412 for ac_exec_ext in '' $ac_executable_extensions; do
4687 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5413 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
46885414 ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
46895415 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
46905416 break 2
46915417 fi
46925418 done
46935419 done
5420 IFS=$as_save_IFS
46945421
46955422 fi
46965423 fi
46975424 CXX=$ac_cv_prog_CXX
46985425 if test -n "$CXX"; then
4699 echo "$as_me:$LINENO: result: $CXX" >&5
4700 echo "${ECHO_T}$CXX" >&6
4701 else
4702 echo "$as_me:$LINENO: result: no" >&5
4703 echo "${ECHO_T}no" >&6
4704 fi
5426 { echo "$as_me:$LINENO: result: $CXX" >&5
5427 echo "${ECHO_T}$CXX" >&6; }
5428 else
5429 { echo "$as_me:$LINENO: result: no" >&5
5430 echo "${ECHO_T}no" >&6; }
5431 fi
5432
47055433
47065434 test -n "$CXX" && break
47075435 done
47085436 fi
47095437 if test -z "$CXX"; then
47105438 ac_ct_CXX=$CXX
4711 for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
5439 for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
47125440 do
47135441 # Extract the first word of "$ac_prog", so it can be a program name with args.
47145442 set dummy $ac_prog; ac_word=$2
4715 echo "$as_me:$LINENO: checking for $ac_word" >&5
4716 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5443 { echo "$as_me:$LINENO: checking for $ac_word" >&5
5444 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
47175445 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
47185446 echo $ECHO_N "(cached) $ECHO_C" >&6
47195447 else
47265454 IFS=$as_save_IFS
47275455 test -z "$as_dir" && as_dir=.
47285456 for ac_exec_ext in '' $ac_executable_extensions; do
4729 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5457 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
47305458 ac_cv_prog_ac_ct_CXX="$ac_prog"
47315459 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
47325460 break 2
47335461 fi
47345462 done
47355463 done
5464 IFS=$as_save_IFS
47365465
47375466 fi
47385467 fi
47395468 ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
47405469 if test -n "$ac_ct_CXX"; then
4741 echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
4742 echo "${ECHO_T}$ac_ct_CXX" >&6
4743 else
4744 echo "$as_me:$LINENO: result: no" >&5
4745 echo "${ECHO_T}no" >&6
4746 fi
5470 { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
5471 echo "${ECHO_T}$ac_ct_CXX" >&6; }
5472 else
5473 { echo "$as_me:$LINENO: result: no" >&5
5474 echo "${ECHO_T}no" >&6; }
5475 fi
5476
47475477
47485478 test -n "$ac_ct_CXX" && break
47495479 done
4750 test -n "$ac_ct_CXX" || ac_ct_CXX="g++"
4751
4752 CXX=$ac_ct_CXX
4753 fi
4754
4755
5480
5481 if test "x$ac_ct_CXX" = x; then
5482 CXX="g++"
5483 else
5484 case $cross_compiling:$ac_tool_warned in
5485 yes:)
5486 { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
5487 whose name does not start with the host triplet. If you think this
5488 configuration is useful to you, please write to autoconf@gnu.org." >&5
5489 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
5490 whose name does not start with the host triplet. If you think this
5491 configuration is useful to you, please write to autoconf@gnu.org." >&2;}
5492 ac_tool_warned=yes ;;
5493 esac
5494 CXX=$ac_ct_CXX
5495 fi
5496 fi
5497
5498 fi
5499 fi
47565500 # Provide some information about the compiler.
4757 echo "$as_me:$LINENO:" \
4758 "checking for C++ compiler version" >&5
5501 echo "$as_me:$LINENO: checking for C++ compiler version" >&5
47595502 ac_compiler=`set X $ac_compile; echo $2`
4760 { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
4761 (eval $ac_compiler --version </dev/null >&5) 2>&5
5503 { (ac_try="$ac_compiler --version >&5"
5504 case "(($ac_try" in
5505 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5506 *) ac_try_echo=$ac_try;;
5507 esac
5508 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
5509 (eval "$ac_compiler --version >&5") 2>&5
47625510 ac_status=$?
47635511 echo "$as_me:$LINENO: \$? = $ac_status" >&5
47645512 (exit $ac_status); }
4765 { (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
4766 (eval $ac_compiler -v </dev/null >&5) 2>&5
5513 { (ac_try="$ac_compiler -v >&5"
5514 case "(($ac_try" in
5515 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5516 *) ac_try_echo=$ac_try;;
5517 esac
5518 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
5519 (eval "$ac_compiler -v >&5") 2>&5
47675520 ac_status=$?
47685521 echo "$as_me:$LINENO: \$? = $ac_status" >&5
47695522 (exit $ac_status); }
4770 { (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
4771 (eval $ac_compiler -V </dev/null >&5) 2>&5
5523 { (ac_try="$ac_compiler -V >&5"
5524 case "(($ac_try" in
5525 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5526 *) ac_try_echo=$ac_try;;
5527 esac
5528 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
5529 (eval "$ac_compiler -V >&5") 2>&5
47725530 ac_status=$?
47735531 echo "$as_me:$LINENO: \$? = $ac_status" >&5
47745532 (exit $ac_status); }
47755533
4776 echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
4777 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
5534 { echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
5535 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; }
47785536 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
47795537 echo $ECHO_N "(cached) $ECHO_C" >&6
47805538 else
47975555 }
47985556 _ACEOF
47995557 rm -f conftest.$ac_objext
4800 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
4801 (eval $ac_compile) 2>conftest.er1
5558 if { (ac_try="$ac_compile"
5559 case "(($ac_try" in
5560 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5561 *) ac_try_echo=$ac_try;;
5562 esac
5563 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
5564 (eval "$ac_compile") 2>conftest.er1
48025565 ac_status=$?
48035566 grep -v '^ *+' conftest.er1 >conftest.err
48045567 rm -f conftest.er1
48055568 cat conftest.err >&5
48065569 echo "$as_me:$LINENO: \$? = $ac_status" >&5
48075570 (exit $ac_status); } &&
4808 { ac_try='test -z "$ac_cxx_werror_flag"
4809 || test ! -s conftest.err'
4810 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4811 (eval $ac_try) 2>&5
5571 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
5572 { (case "(($ac_try" in
5573 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5574 *) ac_try_echo=$ac_try;;
5575 esac
5576 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
5577 (eval "$ac_try") 2>&5
48125578 ac_status=$?
48135579 echo "$as_me:$LINENO: \$? = $ac_status" >&5
48145580 (exit $ac_status); }; } &&
48155581 { ac_try='test -s conftest.$ac_objext'
4816 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4817 (eval $ac_try) 2>&5
5582 { (case "(($ac_try" in
5583 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5584 *) ac_try_echo=$ac_try;;
5585 esac
5586 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
5587 (eval "$ac_try") 2>&5
48185588 ac_status=$?
48195589 echo "$as_me:$LINENO: \$? = $ac_status" >&5
48205590 (exit $ac_status); }; }; then
48235593 echo "$as_me: failed program was:" >&5
48245594 sed 's/^/| /' conftest.$ac_ext >&5
48255595
4826 ac_compiler_gnu=no
4827 fi
4828 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
5596 ac_compiler_gnu=no
5597 fi
5598
5599 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
48295600 ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
48305601
48315602 fi
4832 echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
4833 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
5603 { echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
5604 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; }
48345605 GXX=`test $ac_compiler_gnu = yes && echo yes`
48355606 ac_test_CXXFLAGS=${CXXFLAGS+set}
48365607 ac_save_CXXFLAGS=$CXXFLAGS
4837 CXXFLAGS="-g"
4838 echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
4839 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
5608 { echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
5609 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; }
48405610 if test "${ac_cv_prog_cxx_g+set}" = set; then
48415611 echo $ECHO_N "(cached) $ECHO_C" >&6
48425612 else
4843 cat >conftest.$ac_ext <<_ACEOF
5613 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
5614 ac_cxx_werror_flag=yes
5615 ac_cv_prog_cxx_g=no
5616 CXXFLAGS="-g"
5617 cat >conftest.$ac_ext <<_ACEOF
48445618 /* confdefs.h. */
48455619 _ACEOF
48465620 cat confdefs.h >>conftest.$ac_ext
48565630 }
48575631 _ACEOF
48585632 rm -f conftest.$ac_objext
4859 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
4860 (eval $ac_compile) 2>conftest.er1
5633 if { (ac_try="$ac_compile"
5634 case "(($ac_try" in
5635 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5636 *) ac_try_echo=$ac_try;;
5637 esac
5638 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
5639 (eval "$ac_compile") 2>conftest.er1
48615640 ac_status=$?
48625641 grep -v '^ *+' conftest.er1 >conftest.err
48635642 rm -f conftest.er1
48645643 cat conftest.err >&5
48655644 echo "$as_me:$LINENO: \$? = $ac_status" >&5
48665645 (exit $ac_status); } &&
4867 { ac_try='test -z "$ac_cxx_werror_flag"
4868 || test ! -s conftest.err'
4869 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4870 (eval $ac_try) 2>&5
5646 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
5647 { (case "(($ac_try" in
5648 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5649 *) ac_try_echo=$ac_try;;
5650 esac
5651 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
5652 (eval "$ac_try") 2>&5
48715653 ac_status=$?
48725654 echo "$as_me:$LINENO: \$? = $ac_status" >&5
48735655 (exit $ac_status); }; } &&
48745656 { ac_try='test -s conftest.$ac_objext'
4875 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4876 (eval $ac_try) 2>&5
5657 { (case "(($ac_try" in
5658 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5659 *) ac_try_echo=$ac_try;;
5660 esac
5661 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
5662 (eval "$ac_try") 2>&5
48775663 ac_status=$?
48785664 echo "$as_me:$LINENO: \$? = $ac_status" >&5
48795665 (exit $ac_status); }; }; then
48825668 echo "$as_me: failed program was:" >&5
48835669 sed 's/^/| /' conftest.$ac_ext >&5
48845670
4885 ac_cv_prog_cxx_g=no
4886 fi
4887 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
4888 fi
4889 echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
4890 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
5671 CXXFLAGS=""
5672 cat >conftest.$ac_ext <<_ACEOF
5673 /* confdefs.h. */
5674 _ACEOF
5675 cat confdefs.h >>conftest.$ac_ext
5676 cat >>conftest.$ac_ext <<_ACEOF
5677 /* end confdefs.h. */
5678
5679 int
5680 main ()
5681 {
5682
5683 ;
5684 return 0;
5685 }
5686 _ACEOF
5687 rm -f conftest.$ac_objext
5688 if { (ac_try="$ac_compile"
5689 case "(($ac_try" in
5690 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5691 *) ac_try_echo=$ac_try;;
5692 esac
5693 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
5694 (eval "$ac_compile") 2>conftest.er1
5695 ac_status=$?
5696 grep -v '^ *+' conftest.er1 >conftest.err
5697 rm -f conftest.er1
5698 cat conftest.err >&5
5699 echo "$as_me:$LINENO: \$? = $ac_status" >&5
5700 (exit $ac_status); } &&
5701 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
5702 { (case "(($ac_try" in
5703 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5704 *) ac_try_echo=$ac_try;;
5705 esac
5706 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
5707 (eval "$ac_try") 2>&5
5708 ac_status=$?
5709 echo "$as_me:$LINENO: \$? = $ac_status" >&5
5710 (exit $ac_status); }; } &&
5711 { ac_try='test -s conftest.$ac_objext'
5712 { (case "(($ac_try" in
5713 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5714 *) ac_try_echo=$ac_try;;
5715 esac
5716 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
5717 (eval "$ac_try") 2>&5
5718 ac_status=$?
5719 echo "$as_me:$LINENO: \$? = $ac_status" >&5
5720 (exit $ac_status); }; }; then
5721 :
5722 else
5723 echo "$as_me: failed program was:" >&5
5724 sed 's/^/| /' conftest.$ac_ext >&5
5725
5726 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
5727 CXXFLAGS="-g"
5728 cat >conftest.$ac_ext <<_ACEOF
5729 /* confdefs.h. */
5730 _ACEOF
5731 cat confdefs.h >>conftest.$ac_ext
5732 cat >>conftest.$ac_ext <<_ACEOF
5733 /* end confdefs.h. */
5734
5735 int
5736 main ()
5737 {
5738
5739 ;
5740 return 0;
5741 }
5742 _ACEOF
5743 rm -f conftest.$ac_objext
5744 if { (ac_try="$ac_compile"
5745 case "(($ac_try" in
5746 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5747 *) ac_try_echo=$ac_try;;
5748 esac
5749 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
5750 (eval "$ac_compile") 2>conftest.er1
5751 ac_status=$?
5752 grep -v '^ *+' conftest.er1 >conftest.err
5753 rm -f conftest.er1
5754 cat conftest.err >&5
5755 echo "$as_me:$LINENO: \$? = $ac_status" >&5
5756 (exit $ac_status); } &&
5757 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
5758 { (case "(($ac_try" in
5759 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5760 *) ac_try_echo=$ac_try;;
5761 esac
5762 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
5763 (eval "$ac_try") 2>&5
5764 ac_status=$?
5765 echo "$as_me:$LINENO: \$? = $ac_status" >&5
5766 (exit $ac_status); }; } &&
5767 { ac_try='test -s conftest.$ac_objext'
5768 { (case "(($ac_try" in
5769 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5770 *) ac_try_echo=$ac_try;;
5771 esac
5772 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
5773 (eval "$ac_try") 2>&5
5774 ac_status=$?
5775 echo "$as_me:$LINENO: \$? = $ac_status" >&5
5776 (exit $ac_status); }; }; then
5777 ac_cv_prog_cxx_g=yes
5778 else
5779 echo "$as_me: failed program was:" >&5
5780 sed 's/^/| /' conftest.$ac_ext >&5
5781
5782
5783 fi
5784
5785 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5786 fi
5787
5788 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5789 fi
5790
5791 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5792 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
5793 fi
5794 { echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
5795 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; }
48915796 if test "$ac_test_CXXFLAGS" = set; then
48925797 CXXFLAGS=$ac_save_CXXFLAGS
48935798 elif test $ac_cv_prog_cxx_g = yes; then
49035808 CXXFLAGS=
49045809 fi
49055810 fi
4906 for ac_declaration in \
4907 '' \
4908 'extern "C" void std::exit (int) throw (); using std::exit;' \
4909 'extern "C" void std::exit (int); using std::exit;' \
4910 'extern "C" void exit (int) throw ();' \
4911 'extern "C" void exit (int);' \
4912 'void exit (int);'
4913 do
4914 cat >conftest.$ac_ext <<_ACEOF
4915 /* confdefs.h. */
4916 _ACEOF
4917 cat confdefs.h >>conftest.$ac_ext
4918 cat >>conftest.$ac_ext <<_ACEOF
4919 /* end confdefs.h. */
4920 $ac_declaration
4921 #include <stdlib.h>
4922 int
4923 main ()
4924 {
4925 exit (42);
4926 ;
4927 return 0;
4928 }
4929 _ACEOF
4930 rm -f conftest.$ac_objext
4931 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
4932 (eval $ac_compile) 2>conftest.er1
4933 ac_status=$?
4934 grep -v '^ *+' conftest.er1 >conftest.err
4935 rm -f conftest.er1
4936 cat conftest.err >&5
4937 echo "$as_me:$LINENO: \$? = $ac_status" >&5
4938 (exit $ac_status); } &&
4939 { ac_try='test -z "$ac_cxx_werror_flag"
4940 || test ! -s conftest.err'
4941 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4942 (eval $ac_try) 2>&5
4943 ac_status=$?
4944 echo "$as_me:$LINENO: \$? = $ac_status" >&5
4945 (exit $ac_status); }; } &&
4946 { ac_try='test -s conftest.$ac_objext'
4947 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4948 (eval $ac_try) 2>&5
4949 ac_status=$?
4950 echo "$as_me:$LINENO: \$? = $ac_status" >&5
4951 (exit $ac_status); }; }; then
4952 :
4953 else
4954 echo "$as_me: failed program was:" >&5
4955 sed 's/^/| /' conftest.$ac_ext >&5
4956
4957 continue
4958 fi
4959 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
4960 cat >conftest.$ac_ext <<_ACEOF
4961 /* confdefs.h. */
4962 _ACEOF
4963 cat confdefs.h >>conftest.$ac_ext
4964 cat >>conftest.$ac_ext <<_ACEOF
4965 /* end confdefs.h. */
4966 $ac_declaration
4967 int
4968 main ()
4969 {
4970 exit (42);
4971 ;
4972 return 0;
4973 }
4974 _ACEOF
4975 rm -f conftest.$ac_objext
4976 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
4977 (eval $ac_compile) 2>conftest.er1
4978 ac_status=$?
4979 grep -v '^ *+' conftest.er1 >conftest.err
4980 rm -f conftest.er1
4981 cat conftest.err >&5
4982 echo "$as_me:$LINENO: \$? = $ac_status" >&5
4983 (exit $ac_status); } &&
4984 { ac_try='test -z "$ac_cxx_werror_flag"
4985 || test ! -s conftest.err'
4986 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4987 (eval $ac_try) 2>&5
4988 ac_status=$?
4989 echo "$as_me:$LINENO: \$? = $ac_status" >&5
4990 (exit $ac_status); }; } &&
4991 { ac_try='test -s conftest.$ac_objext'
4992 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4993 (eval $ac_try) 2>&5
4994 ac_status=$?
4995 echo "$as_me:$LINENO: \$? = $ac_status" >&5
4996 (exit $ac_status); }; }; then
4997 break
4998 else
4999 echo "$as_me: failed program was:" >&5
5000 sed 's/^/| /' conftest.$ac_ext >&5
5001
5002 fi
5003 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
5004 done
5005 rm -f conftest*
5006 if test -n "$ac_declaration"; then
5007 echo '#ifdef __cplusplus' >>confdefs.h
5008 echo $ac_declaration >>confdefs.h
5009 echo '#endif' >>confdefs.h
5010 fi
5011
5012 ac_ext=cc
5811 ac_ext=cpp
50135812 ac_cpp='$CXXCPP $CPPFLAGS'
50145813 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
50155814 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
50175816
50185817 depcc="$CXX" am_compiler_list=
50195818
5020 echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
5021 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
5819 { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
5820 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
50225821 if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
50235822 echo $ECHO_N "(cached) $ECHO_C" >&6
50245823 else
51075906 fi
51085907
51095908 fi
5110 echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
5111 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6
5909 { echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
5910 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; }
51125911 CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
51135912
51145913
51295928 if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
51305929 ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
51315930 (test "X$CXX" != "Xg++"))) ; then
5132 ac_ext=cc
5931 ac_ext=cpp
51335932 ac_cpp='$CXXCPP $CPPFLAGS'
51345933 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
51355934 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
51365935 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
5137 echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
5138 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6
5936 { echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
5937 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; }
51395938 if test -z "$CXXCPP"; then
51405939 if test "${ac_cv_prog_CXXCPP+set}" = set; then
51415940 echo $ECHO_N "(cached) $ECHO_C" >&6
51655964 #endif
51665965 Syntax error
51675966 _ACEOF
5168 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
5169 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5967 if { (ac_try="$ac_cpp conftest.$ac_ext"
5968 case "(($ac_try" in
5969 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5970 *) ac_try_echo=$ac_try;;
5971 esac
5972 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
5973 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
51705974 ac_status=$?
51715975 grep -v '^ *+' conftest.er1 >conftest.err
51725976 rm -f conftest.er1
51915995 # Broken: fails on valid input.
51925996 continue
51935997 fi
5998
51945999 rm -f conftest.err conftest.$ac_ext
51956000
5196 # OK, works on sane cases. Now check whether non-existent headers
6001 # OK, works on sane cases. Now check whether nonexistent headers
51976002 # can be detected and how.
51986003 cat >conftest.$ac_ext <<_ACEOF
51996004 /* confdefs.h. */
52036008 /* end confdefs.h. */
52046009 #include <ac_nonexistent.h>
52056010 _ACEOF
5206 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
5207 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6011 if { (ac_try="$ac_cpp conftest.$ac_ext"
6012 case "(($ac_try" in
6013 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
6014 *) ac_try_echo=$ac_try;;
6015 esac
6016 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
6017 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
52086018 ac_status=$?
52096019 grep -v '^ *+' conftest.er1 >conftest.err
52106020 rm -f conftest.er1
52316041 ac_preproc_ok=:
52326042 break
52336043 fi
6044
52346045 rm -f conftest.err conftest.$ac_ext
52356046
52366047 done
52486059 else
52496060 ac_cv_prog_CXXCPP=$CXXCPP
52506061 fi
5251 echo "$as_me:$LINENO: result: $CXXCPP" >&5
5252 echo "${ECHO_T}$CXXCPP" >&6
6062 { echo "$as_me:$LINENO: result: $CXXCPP" >&5
6063 echo "${ECHO_T}$CXXCPP" >&6; }
52536064 ac_preproc_ok=false
52546065 for ac_cxx_preproc_warn_flag in '' yes
52556066 do
52726083 #endif
52736084 Syntax error
52746085 _ACEOF
5275 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
5276 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6086 if { (ac_try="$ac_cpp conftest.$ac_ext"
6087 case "(($ac_try" in
6088 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
6089 *) ac_try_echo=$ac_try;;
6090 esac
6091 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
6092 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
52776093 ac_status=$?
52786094 grep -v '^ *+' conftest.er1 >conftest.err
52796095 rm -f conftest.er1
52986114 # Broken: fails on valid input.
52996115 continue
53006116 fi
6117
53016118 rm -f conftest.err conftest.$ac_ext
53026119
5303 # OK, works on sane cases. Now check whether non-existent headers
6120 # OK, works on sane cases. Now check whether nonexistent headers
53046121 # can be detected and how.
53056122 cat >conftest.$ac_ext <<_ACEOF
53066123 /* confdefs.h. */
53106127 /* end confdefs.h. */
53116128 #include <ac_nonexistent.h>
53126129 _ACEOF
5313 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
5314 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6130 if { (ac_try="$ac_cpp conftest.$ac_ext"
6131 case "(($ac_try" in
6132 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
6133 *) ac_try_echo=$ac_try;;
6134 esac
6135 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
6136 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
53156137 ac_status=$?
53166138 grep -v '^ *+' conftest.er1 >conftest.err
53176139 rm -f conftest.er1
53386160 ac_preproc_ok=:
53396161 break
53406162 fi
6163
53416164 rm -f conftest.err conftest.$ac_ext
53426165
53436166 done
53536176 { (exit 1); exit 1; }; }
53546177 fi
53556178
5356 ac_ext=cc
6179 ac_ext=cpp
53576180 ac_cpp='$CXXCPP $CPPFLAGS'
53586181 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
53596182 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
53676190 ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
53686191 ac_compiler_gnu=$ac_cv_f77_compiler_gnu
53696192 if test -n "$ac_tool_prefix"; then
5370 for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
6193 for ac_prog in g77 f77 xlf frt pgf77 cf77 fort77 fl32 af77 f90 xlf90 pgf90 pghpf epcf90 gfortran g95 f95 fort xlf95 ifort ifc efc pgf95 lf95 ftn
53716194 do
53726195 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
53736196 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5374 echo "$as_me:$LINENO: checking for $ac_word" >&5
5375 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6197 { echo "$as_me:$LINENO: checking for $ac_word" >&5
6198 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
53766199 if test "${ac_cv_prog_F77+set}" = set; then
53776200 echo $ECHO_N "(cached) $ECHO_C" >&6
53786201 else
53856208 IFS=$as_save_IFS
53866209 test -z "$as_dir" && as_dir=.
53876210 for ac_exec_ext in '' $ac_executable_extensions; do
5388 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6211 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
53896212 ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
53906213 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
53916214 break 2
53926215 fi
53936216 done
53946217 done
6218 IFS=$as_save_IFS
53956219
53966220 fi
53976221 fi
53986222 F77=$ac_cv_prog_F77
53996223 if test -n "$F77"; then
5400 echo "$as_me:$LINENO: result: $F77" >&5
5401 echo "${ECHO_T}$F77" >&6
5402 else
5403 echo "$as_me:$LINENO: result: no" >&5
5404 echo "${ECHO_T}no" >&6
5405 fi
6224 { echo "$as_me:$LINENO: result: $F77" >&5
6225 echo "${ECHO_T}$F77" >&6; }
6226 else
6227 { echo "$as_me:$LINENO: result: no" >&5
6228 echo "${ECHO_T}no" >&6; }
6229 fi
6230
54066231
54076232 test -n "$F77" && break
54086233 done
54096234 fi
54106235 if test -z "$F77"; then
54116236 ac_ct_F77=$F77
5412 for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
6237 for ac_prog in g77 f77 xlf frt pgf77 cf77 fort77 fl32 af77 f90 xlf90 pgf90 pghpf epcf90 gfortran g95 f95 fort xlf95 ifort ifc efc pgf95 lf95 ftn
54136238 do
54146239 # Extract the first word of "$ac_prog", so it can be a program name with args.
54156240 set dummy $ac_prog; ac_word=$2
5416 echo "$as_me:$LINENO: checking for $ac_word" >&5
5417 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6241 { echo "$as_me:$LINENO: checking for $ac_word" >&5
6242 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
54186243 if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
54196244 echo $ECHO_N "(cached) $ECHO_C" >&6
54206245 else
54276252 IFS=$as_save_IFS
54286253 test -z "$as_dir" && as_dir=.
54296254 for ac_exec_ext in '' $ac_executable_extensions; do
5430 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6255 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
54316256 ac_cv_prog_ac_ct_F77="$ac_prog"
54326257 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
54336258 break 2
54346259 fi
54356260 done
54366261 done
6262 IFS=$as_save_IFS
54376263
54386264 fi
54396265 fi
54406266 ac_ct_F77=$ac_cv_prog_ac_ct_F77
54416267 if test -n "$ac_ct_F77"; then
5442 echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
5443 echo "${ECHO_T}$ac_ct_F77" >&6
5444 else
5445 echo "$as_me:$LINENO: result: no" >&5
5446 echo "${ECHO_T}no" >&6
5447 fi
6268 { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
6269 echo "${ECHO_T}$ac_ct_F77" >&6; }
6270 else
6271 { echo "$as_me:$LINENO: result: no" >&5
6272 echo "${ECHO_T}no" >&6; }
6273 fi
6274
54486275
54496276 test -n "$ac_ct_F77" && break
54506277 done
54516278
5452 F77=$ac_ct_F77
6279 if test "x$ac_ct_F77" = x; then
6280 F77=""
6281 else
6282 case $cross_compiling:$ac_tool_warned in
6283 yes:)
6284 { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
6285 whose name does not start with the host triplet. If you think this
6286 configuration is useful to you, please write to autoconf@gnu.org." >&5
6287 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
6288 whose name does not start with the host triplet. If you think this
6289 configuration is useful to you, please write to autoconf@gnu.org." >&2;}
6290 ac_tool_warned=yes ;;
6291 esac
6292 F77=$ac_ct_F77
6293 fi
54536294 fi
54546295
54556296
54566297 # Provide some information about the compiler.
5457 echo "$as_me:5458:" \
5458 "checking for Fortran 77 compiler version" >&5
6298 echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
54596299 ac_compiler=`set X $ac_compile; echo $2`
5460 { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
5461 (eval $ac_compiler --version </dev/null >&5) 2>&5
6300 { (ac_try="$ac_compiler --version >&5"
6301 case "(($ac_try" in
6302 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
6303 *) ac_try_echo=$ac_try;;
6304 esac
6305 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
6306 (eval "$ac_compiler --version >&5") 2>&5
54626307 ac_status=$?
54636308 echo "$as_me:$LINENO: \$? = $ac_status" >&5
54646309 (exit $ac_status); }
5465 { (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
5466 (eval $ac_compiler -v </dev/null >&5) 2>&5
6310 { (ac_try="$ac_compiler -v >&5"
6311 case "(($ac_try" in
6312 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
6313 *) ac_try_echo=$ac_try;;
6314 esac
6315 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
6316 (eval "$ac_compiler -v >&5") 2>&5
54676317 ac_status=$?
54686318 echo "$as_me:$LINENO: \$? = $ac_status" >&5
54696319 (exit $ac_status); }
5470 { (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
5471 (eval $ac_compiler -V </dev/null >&5) 2>&5
6320 { (ac_try="$ac_compiler -V >&5"
6321 case "(($ac_try" in
6322 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
6323 *) ac_try_echo=$ac_try;;
6324 esac
6325 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
6326 (eval "$ac_compiler -V >&5") 2>&5
54726327 ac_status=$?
54736328 echo "$as_me:$LINENO: \$? = $ac_status" >&5
54746329 (exit $ac_status); }
54786333 # input file. (Note that this only needs to work for GNU compilers.)
54796334 ac_save_ext=$ac_ext
54806335 ac_ext=F
5481 echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
5482 echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6
6336 { echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
6337 echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; }
54836338 if test "${ac_cv_f77_compiler_gnu+set}" = set; then
54846339 echo $ECHO_N "(cached) $ECHO_C" >&6
54856340 else
54926347 end
54936348 _ACEOF
54946349 rm -f conftest.$ac_objext
5495 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
5496 (eval $ac_compile) 2>conftest.er1
6350 if { (ac_try="$ac_compile"
6351 case "(($ac_try" in
6352 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
6353 *) ac_try_echo=$ac_try;;
6354 esac
6355 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
6356 (eval "$ac_compile") 2>conftest.er1
54976357 ac_status=$?
54986358 grep -v '^ *+' conftest.er1 >conftest.err
54996359 rm -f conftest.er1
55006360 cat conftest.err >&5
55016361 echo "$as_me:$LINENO: \$? = $ac_status" >&5
55026362 (exit $ac_status); } &&
5503 { ac_try='test -z "$ac_f77_werror_flag"
5504 || test ! -s conftest.err'
5505 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
5506 (eval $ac_try) 2>&5
6363 { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err'
6364 { (case "(($ac_try" in
6365 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
6366 *) ac_try_echo=$ac_try;;
6367 esac
6368 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
6369 (eval "$ac_try") 2>&5
55076370 ac_status=$?
55086371 echo "$as_me:$LINENO: \$? = $ac_status" >&5
55096372 (exit $ac_status); }; } &&
55106373 { ac_try='test -s conftest.$ac_objext'
5511 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
5512 (eval $ac_try) 2>&5
6374 { (case "(($ac_try" in
6375 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
6376 *) ac_try_echo=$ac_try;;
6377 esac
6378 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
6379 (eval "$ac_try") 2>&5
55136380 ac_status=$?
55146381 echo "$as_me:$LINENO: \$? = $ac_status" >&5
55156382 (exit $ac_status); }; }; then
55186385 echo "$as_me: failed program was:" >&5
55196386 sed 's/^/| /' conftest.$ac_ext >&5
55206387
5521 ac_compiler_gnu=no
5522 fi
5523 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
6388 ac_compiler_gnu=no
6389 fi
6390
6391 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
55246392 ac_cv_f77_compiler_gnu=$ac_compiler_gnu
55256393
55266394 fi
5527 echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
5528 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6
6395 { echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
6396 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; }
55296397 ac_ext=$ac_save_ext
55306398 ac_test_FFLAGS=${FFLAGS+set}
55316399 ac_save_FFLAGS=$FFLAGS
55326400 FFLAGS=
5533 echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
5534 echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6
6401 { echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
6402 echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; }
55356403 if test "${ac_cv_prog_f77_g+set}" = set; then
55366404 echo $ECHO_N "(cached) $ECHO_C" >&6
55376405 else
55426410 end
55436411 _ACEOF
55446412 rm -f conftest.$ac_objext
5545 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
5546 (eval $ac_compile) 2>conftest.er1
6413 if { (ac_try="$ac_compile"
6414 case "(($ac_try" in
6415 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
6416 *) ac_try_echo=$ac_try;;
6417 esac
6418 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
6419 (eval "$ac_compile") 2>conftest.er1
55476420 ac_status=$?
55486421 grep -v '^ *+' conftest.er1 >conftest.err
55496422 rm -f conftest.er1
55506423 cat conftest.err >&5
55516424 echo "$as_me:$LINENO: \$? = $ac_status" >&5
55526425 (exit $ac_status); } &&
5553 { ac_try='test -z "$ac_f77_werror_flag"
5554 || test ! -s conftest.err'
5555 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
5556 (eval $ac_try) 2>&5
6426 { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err'
6427 { (case "(($ac_try" in
6428 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
6429 *) ac_try_echo=$ac_try;;
6430 esac
6431 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
6432 (eval "$ac_try") 2>&5
55576433 ac_status=$?
55586434 echo "$as_me:$LINENO: \$? = $ac_status" >&5
55596435 (exit $ac_status); }; } &&
55606436 { ac_try='test -s conftest.$ac_objext'
5561 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
5562 (eval $ac_try) 2>&5
6437 { (case "(($ac_try" in
6438 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
6439 *) ac_try_echo=$ac_try;;
6440 esac
6441 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
6442 (eval "$ac_try") 2>&5
55636443 ac_status=$?
55646444 echo "$as_me:$LINENO: \$? = $ac_status" >&5
55656445 (exit $ac_status); }; }; then
55686448 echo "$as_me: failed program was:" >&5
55696449 sed 's/^/| /' conftest.$ac_ext >&5
55706450
5571 ac_cv_prog_f77_g=no
5572 fi
5573 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
5574
5575 fi
5576 echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
5577 echo "${ECHO_T}$ac_cv_prog_f77_g" >&6
6451 ac_cv_prog_f77_g=no
6452 fi
6453
6454 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6455
6456 fi
6457 { echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
6458 echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; }
55786459 if test "$ac_test_FFLAGS" = set; then
55796460 FFLAGS=$ac_save_FFLAGS
55806461 elif test $ac_cv_prog_f77_g = yes; then
56036484 # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
56046485
56056486 # find the maximum length of command line arguments
5606 echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
5607 echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6
6487 { echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
6488 echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; }
56086489 if test "${lt_cv_sys_max_cmd_len+set}" = set; then
56096490 echo $ECHO_N "(cached) $ECHO_C" >&6
56106491 else
57126593 fi
57136594
57146595 if test -n $lt_cv_sys_max_cmd_len ; then
5715 echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
5716 echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6
5717 else
5718 echo "$as_me:$LINENO: result: none" >&5
5719 echo "${ECHO_T}none" >&6
6596 { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
6597 echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; }
6598 else
6599 { echo "$as_me:$LINENO: result: none" >&5
6600 echo "${ECHO_T}none" >&6; }
57206601 fi
57216602
57226603
57236604
57246605
57256606 # Check for command to grab the raw symbol name followed by C symbol from nm.
5726 echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
5727 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6
6607 { echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
6608 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; }
57286609 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
57296610 echo $ECHO_N "(cached) $ECHO_C" >&6
57306611 else
59286809 lt_cv_sys_global_symbol_to_cdecl=
59296810 fi
59306811 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
5931 echo "$as_me:$LINENO: result: failed" >&5
5932 echo "${ECHO_T}failed" >&6
5933 else
5934 echo "$as_me:$LINENO: result: ok" >&5
5935 echo "${ECHO_T}ok" >&6
5936 fi
5937
5938 echo "$as_me:$LINENO: checking for objdir" >&5
5939 echo $ECHO_N "checking for objdir... $ECHO_C" >&6
6812 { echo "$as_me:$LINENO: result: failed" >&5
6813 echo "${ECHO_T}failed" >&6; }
6814 else
6815 { echo "$as_me:$LINENO: result: ok" >&5
6816 echo "${ECHO_T}ok" >&6; }
6817 fi
6818
6819 { echo "$as_me:$LINENO: checking for objdir" >&5
6820 echo $ECHO_N "checking for objdir... $ECHO_C" >&6; }
59406821 if test "${lt_cv_objdir+set}" = set; then
59416822 echo $ECHO_N "(cached) $ECHO_C" >&6
59426823 else
59506831 fi
59516832 rmdir .libs 2>/dev/null
59526833 fi
5953 echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
5954 echo "${ECHO_T}$lt_cv_objdir" >&6
6834 { echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
6835 echo "${ECHO_T}$lt_cv_objdir" >&6; }
59556836 objdir=$lt_cv_objdir
59566837
59576838
60026883 if test -n "$ac_tool_prefix"; then
60036884 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
60046885 set dummy ${ac_tool_prefix}ar; ac_word=$2
6005 echo "$as_me:$LINENO: checking for $ac_word" >&5
6006 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6886 { echo "$as_me:$LINENO: checking for $ac_word" >&5
6887 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
60076888 if test "${ac_cv_prog_AR+set}" = set; then
60086889 echo $ECHO_N "(cached) $ECHO_C" >&6
60096890 else
60166897 IFS=$as_save_IFS
60176898 test -z "$as_dir" && as_dir=.
60186899 for ac_exec_ext in '' $ac_executable_extensions; do
6019 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6900 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
60206901 ac_cv_prog_AR="${ac_tool_prefix}ar"
60216902 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
60226903 break 2
60236904 fi
60246905 done
60256906 done
6907 IFS=$as_save_IFS
60266908
60276909 fi
60286910 fi
60296911 AR=$ac_cv_prog_AR
60306912 if test -n "$AR"; then
6031 echo "$as_me:$LINENO: result: $AR" >&5
6032 echo "${ECHO_T}$AR" >&6
6033 else
6034 echo "$as_me:$LINENO: result: no" >&5
6035 echo "${ECHO_T}no" >&6
6036 fi
6913 { echo "$as_me:$LINENO: result: $AR" >&5
6914 echo "${ECHO_T}$AR" >&6; }
6915 else
6916 { echo "$as_me:$LINENO: result: no" >&5
6917 echo "${ECHO_T}no" >&6; }
6918 fi
6919
60376920
60386921 fi
60396922 if test -z "$ac_cv_prog_AR"; then
60406923 ac_ct_AR=$AR
60416924 # Extract the first word of "ar", so it can be a program name with args.
60426925 set dummy ar; ac_word=$2
6043 echo "$as_me:$LINENO: checking for $ac_word" >&5
6044 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6926 { echo "$as_me:$LINENO: checking for $ac_word" >&5
6927 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
60456928 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
60466929 echo $ECHO_N "(cached) $ECHO_C" >&6
60476930 else
60546937 IFS=$as_save_IFS
60556938 test -z "$as_dir" && as_dir=.
60566939 for ac_exec_ext in '' $ac_executable_extensions; do
6057 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6940 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
60586941 ac_cv_prog_ac_ct_AR="ar"
60596942 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
60606943 break 2
60616944 fi
60626945 done
60636946 done
6064
6065 test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false"
6947 IFS=$as_save_IFS
6948
60666949 fi
60676950 fi
60686951 ac_ct_AR=$ac_cv_prog_ac_ct_AR
60696952 if test -n "$ac_ct_AR"; then
6070 echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
6071 echo "${ECHO_T}$ac_ct_AR" >&6
6072 else
6073 echo "$as_me:$LINENO: result: no" >&5
6074 echo "${ECHO_T}no" >&6
6075 fi
6076
6077 AR=$ac_ct_AR
6953 { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
6954 echo "${ECHO_T}$ac_ct_AR" >&6; }
6955 else
6956 { echo "$as_me:$LINENO: result: no" >&5
6957 echo "${ECHO_T}no" >&6; }
6958 fi
6959
6960 if test "x$ac_ct_AR" = x; then
6961 AR="false"
6962 else
6963 case $cross_compiling:$ac_tool_warned in
6964 yes:)
6965 { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
6966 whose name does not start with the host triplet. If you think this
6967 configuration is useful to you, please write to autoconf@gnu.org." >&5
6968 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
6969 whose name does not start with the host triplet. If you think this
6970 configuration is useful to you, please write to autoconf@gnu.org." >&2;}
6971 ac_tool_warned=yes ;;
6972 esac
6973 AR=$ac_ct_AR
6974 fi
60786975 else
60796976 AR="$ac_cv_prog_AR"
60806977 fi
60826979 if test -n "$ac_tool_prefix"; then
60836980 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
60846981 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
6085 echo "$as_me:$LINENO: checking for $ac_word" >&5
6086 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6982 { echo "$as_me:$LINENO: checking for $ac_word" >&5
6983 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
60876984 if test "${ac_cv_prog_RANLIB+set}" = set; then
60886985 echo $ECHO_N "(cached) $ECHO_C" >&6
60896986 else
60966993 IFS=$as_save_IFS
60976994 test -z "$as_dir" && as_dir=.
60986995 for ac_exec_ext in '' $ac_executable_extensions; do
6099 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6996 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
61006997 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
61016998 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
61026999 break 2
61037000 fi
61047001 done
61057002 done
7003 IFS=$as_save_IFS
61067004
61077005 fi
61087006 fi
61097007 RANLIB=$ac_cv_prog_RANLIB
61107008 if test -n "$RANLIB"; then
6111 echo "$as_me:$LINENO: result: $RANLIB" >&5
6112 echo "${ECHO_T}$RANLIB" >&6
6113 else
6114 echo "$as_me:$LINENO: result: no" >&5
6115 echo "${ECHO_T}no" >&6
6116 fi
7009 { echo "$as_me:$LINENO: result: $RANLIB" >&5
7010 echo "${ECHO_T}$RANLIB" >&6; }
7011 else
7012 { echo "$as_me:$LINENO: result: no" >&5
7013 echo "${ECHO_T}no" >&6; }
7014 fi
7015
61177016
61187017 fi
61197018 if test -z "$ac_cv_prog_RANLIB"; then
61207019 ac_ct_RANLIB=$RANLIB
61217020 # Extract the first word of "ranlib", so it can be a program name with args.
61227021 set dummy ranlib; ac_word=$2
6123 echo "$as_me:$LINENO: checking for $ac_word" >&5
6124 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7022 { echo "$as_me:$LINENO: checking for $ac_word" >&5
7023 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
61257024 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
61267025 echo $ECHO_N "(cached) $ECHO_C" >&6
61277026 else
61347033 IFS=$as_save_IFS
61357034 test -z "$as_dir" && as_dir=.
61367035 for ac_exec_ext in '' $ac_executable_extensions; do
6137 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7036 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
61387037 ac_cv_prog_ac_ct_RANLIB="ranlib"
61397038 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
61407039 break 2
61417040 fi
61427041 done
61437042 done
6144
6145 test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
7043 IFS=$as_save_IFS
7044
61467045 fi
61477046 fi
61487047 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
61497048 if test -n "$ac_ct_RANLIB"; then
6150 echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
6151 echo "${ECHO_T}$ac_ct_RANLIB" >&6
6152 else
6153 echo "$as_me:$LINENO: result: no" >&5
6154 echo "${ECHO_T}no" >&6
6155 fi
6156
6157 RANLIB=$ac_ct_RANLIB
7049 { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
7050 echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
7051 else
7052 { echo "$as_me:$LINENO: result: no" >&5
7053 echo "${ECHO_T}no" >&6; }
7054 fi
7055
7056 if test "x$ac_ct_RANLIB" = x; then
7057 RANLIB=":"
7058 else
7059 case $cross_compiling:$ac_tool_warned in
7060 yes:)
7061 { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
7062 whose name does not start with the host triplet. If you think this
7063 configuration is useful to you, please write to autoconf@gnu.org." >&5
7064 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
7065 whose name does not start with the host triplet. If you think this
7066 configuration is useful to you, please write to autoconf@gnu.org." >&2;}
7067 ac_tool_warned=yes ;;
7068 esac
7069 RANLIB=$ac_ct_RANLIB
7070 fi
61587071 else
61597072 RANLIB="$ac_cv_prog_RANLIB"
61607073 fi
61627075 if test -n "$ac_tool_prefix"; then
61637076 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
61647077 set dummy ${ac_tool_prefix}strip; ac_word=$2
6165 echo "$as_me:$LINENO: checking for $ac_word" >&5
6166 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7078 { echo "$as_me:$LINENO: checking for $ac_word" >&5
7079 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
61677080 if test "${ac_cv_prog_STRIP+set}" = set; then
61687081 echo $ECHO_N "(cached) $ECHO_C" >&6
61697082 else
61767089 IFS=$as_save_IFS
61777090 test -z "$as_dir" && as_dir=.
61787091 for ac_exec_ext in '' $ac_executable_extensions; do
6179 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7092 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
61807093 ac_cv_prog_STRIP="${ac_tool_prefix}strip"
61817094 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
61827095 break 2
61837096 fi
61847097 done
61857098 done
7099 IFS=$as_save_IFS
61867100
61877101 fi
61887102 fi
61897103 STRIP=$ac_cv_prog_STRIP
61907104 if test -n "$STRIP"; then
6191 echo "$as_me:$LINENO: result: $STRIP" >&5
6192 echo "${ECHO_T}$STRIP" >&6
6193 else
6194 echo "$as_me:$LINENO: result: no" >&5
6195 echo "${ECHO_T}no" >&6
6196 fi
7105 { echo "$as_me:$LINENO: result: $STRIP" >&5
7106 echo "${ECHO_T}$STRIP" >&6; }
7107 else
7108 { echo "$as_me:$LINENO: result: no" >&5
7109 echo "${ECHO_T}no" >&6; }
7110 fi
7111
61977112
61987113 fi
61997114 if test -z "$ac_cv_prog_STRIP"; then
62007115 ac_ct_STRIP=$STRIP
62017116 # Extract the first word of "strip", so it can be a program name with args.
62027117 set dummy strip; ac_word=$2
6203 echo "$as_me:$LINENO: checking for $ac_word" >&5
6204 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7118 { echo "$as_me:$LINENO: checking for $ac_word" >&5
7119 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
62057120 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
62067121 echo $ECHO_N "(cached) $ECHO_C" >&6
62077122 else
62147129 IFS=$as_save_IFS
62157130 test -z "$as_dir" && as_dir=.
62167131 for ac_exec_ext in '' $ac_executable_extensions; do
6217 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7132 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
62187133 ac_cv_prog_ac_ct_STRIP="strip"
62197134 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
62207135 break 2
62217136 fi
62227137 done
62237138 done
6224
6225 test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
7139 IFS=$as_save_IFS
7140
62267141 fi
62277142 fi
62287143 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
62297144 if test -n "$ac_ct_STRIP"; then
6230 echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
6231 echo "${ECHO_T}$ac_ct_STRIP" >&6
6232 else
6233 echo "$as_me:$LINENO: result: no" >&5
6234 echo "${ECHO_T}no" >&6
6235 fi
6236
6237 STRIP=$ac_ct_STRIP
7145 { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
7146 echo "${ECHO_T}$ac_ct_STRIP" >&6; }
7147 else
7148 { echo "$as_me:$LINENO: result: no" >&5
7149 echo "${ECHO_T}no" >&6; }
7150 fi
7151
7152 if test "x$ac_ct_STRIP" = x; then
7153 STRIP=":"
7154 else
7155 case $cross_compiling:$ac_tool_warned in
7156 yes:)
7157 { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
7158 whose name does not start with the host triplet. If you think this
7159 configuration is useful to you, please write to autoconf@gnu.org." >&5
7160 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
7161 whose name does not start with the host triplet. If you think this
7162 configuration is useful to you, please write to autoconf@gnu.org." >&2;}
7163 ac_tool_warned=yes ;;
7164 esac
7165 STRIP=$ac_ct_STRIP
7166 fi
62387167 else
62397168 STRIP="$ac_cv_prog_STRIP"
62407169 fi
62937222 case $deplibs_check_method in
62947223 file_magic*)
62957224 if test "$file_magic_cmd" = '$MAGIC_CMD'; then
6296 echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
6297 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
7225 { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
7226 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; }
62987227 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
62997228 echo $ECHO_N "(cached) $ECHO_C" >&6
63007229 else
63467275
63477276 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
63487277 if test -n "$MAGIC_CMD"; then
6349 echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
6350 echo "${ECHO_T}$MAGIC_CMD" >&6
6351 else
6352 echo "$as_me:$LINENO: result: no" >&5
6353 echo "${ECHO_T}no" >&6
7278 { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
7279 echo "${ECHO_T}$MAGIC_CMD" >&6; }
7280 else
7281 { echo "$as_me:$LINENO: result: no" >&5
7282 echo "${ECHO_T}no" >&6; }
63547283 fi
63557284
63567285 if test -z "$lt_cv_path_MAGIC_CMD"; then
63577286 if test -n "$ac_tool_prefix"; then
6358 echo "$as_me:$LINENO: checking for file" >&5
6359 echo $ECHO_N "checking for file... $ECHO_C" >&6
7287 { echo "$as_me:$LINENO: checking for file" >&5
7288 echo $ECHO_N "checking for file... $ECHO_C" >&6; }
63607289 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
63617290 echo $ECHO_N "(cached) $ECHO_C" >&6
63627291 else
64087337
64097338 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
64107339 if test -n "$MAGIC_CMD"; then
6411 echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
6412 echo "${ECHO_T}$MAGIC_CMD" >&6
6413 else
6414 echo "$as_me:$LINENO: result: no" >&5
6415 echo "${ECHO_T}no" >&6
7340 { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
7341 echo "${ECHO_T}$MAGIC_CMD" >&6; }
7342 else
7343 { echo "$as_me:$LINENO: result: no" >&5
7344 echo "${ECHO_T}no" >&6; }
64167345 fi
64177346
64187347 else
64277356 enable_dlopen=no
64287357 enable_win32_dll=no
64297358
6430 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
7359 # Check whether --enable-libtool-lock was given.
64317360 if test "${enable_libtool_lock+set}" = set; then
6432 enableval="$enable_libtool_lock"
6433
6434 fi;
7361 enableval=$enable_libtool_lock;
7362 fi
7363
64357364 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
64367365
64377366
6438 # Check whether --with-pic or --without-pic was given.
7367 # Check whether --with-pic was given.
64397368 if test "${with_pic+set}" = set; then
6440 withval="$with_pic"
6441 pic_mode="$withval"
7369 withval=$with_pic; pic_mode="$withval"
64427370 else
64437371 pic_mode=default
6444 fi;
7372 fi
7373
64457374 test -z "$pic_mode" && pic_mode=default
64467375
64477376 # Use C for the default configuration in the libtool script
64997428 lt_prog_compiler_no_builtin_flag=' -fno-builtin'
65007429
65017430
6502 echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
6503 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
7431 { echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
7432 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
65047433 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
65057434 echo $ECHO_N "(cached) $ECHO_C" >&6
65067435 else
65177446 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
65187447 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
65197448 -e 's:$: $lt_compiler_flag:'`
6520 (eval echo "\"\$as_me:6521: $lt_compile\"" >&5)
7449 (eval echo "\"\$as_me:7450: $lt_compile\"" >&5)
65217450 (eval "$lt_compile" 2>conftest.err)
65227451 ac_status=$?
65237452 cat conftest.err >&5
6524 echo "$as_me:6525: \$? = $ac_status" >&5
7453 echo "$as_me:7454: \$? = $ac_status" >&5
65257454 if (exit $ac_status) && test -s "$ac_outfile"; then
65267455 # The compiler can only warn and ignore the option if not recognized
65277456 # So say no if there are warnings other than the usual output.
65347463 $rm conftest*
65357464
65367465 fi
6537 echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
6538 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
7466 { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
7467 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
65397468
65407469 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
65417470 lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
65497478 lt_prog_compiler_pic=
65507479 lt_prog_compiler_static=
65517480
6552 echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
6553 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
7481 { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
7482 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
65547483
65557484 if test "$GCC" = yes; then
65567485 lt_prog_compiler_wl='-Wl,'
67597688 esac
67607689 fi
67617690
6762 echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
6763 echo "${ECHO_T}$lt_prog_compiler_pic" >&6
7691 { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
7692 echo "${ECHO_T}$lt_prog_compiler_pic" >&6; }
67647693
67657694 #
67667695 # Check to make sure the PIC flag actually works.
67677696 #
67687697 if test -n "$lt_prog_compiler_pic"; then
67697698
6770 echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
6771 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6
7699 { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
7700 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; }
67727701 if test "${lt_prog_compiler_pic_works+set}" = set; then
67737702 echo $ECHO_N "(cached) $ECHO_C" >&6
67747703 else
67857714 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
67867715 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
67877716 -e 's:$: $lt_compiler_flag:'`
6788 (eval echo "\"\$as_me:6789: $lt_compile\"" >&5)
7717 (eval echo "\"\$as_me:7718: $lt_compile\"" >&5)
67897718 (eval "$lt_compile" 2>conftest.err)
67907719 ac_status=$?
67917720 cat conftest.err >&5
6792 echo "$as_me:6793: \$? = $ac_status" >&5
7721 echo "$as_me:7722: \$? = $ac_status" >&5
67937722 if (exit $ac_status) && test -s "$ac_outfile"; then
67947723 # The compiler can only warn and ignore the option if not recognized
67957724 # So say no if there are warnings other than the usual output.
68027731 $rm conftest*
68037732
68047733 fi
6805 echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
6806 echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6
7734 { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
7735 echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; }
68077736
68087737 if test x"$lt_prog_compiler_pic_works" = xyes; then
68097738 case $lt_prog_compiler_pic in
68307759 # Check to make sure the static flag actually works.
68317760 #
68327761 wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
6833 echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
6834 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
7762 { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
7763 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
68357764 if test "${lt_prog_compiler_static_works+set}" = set; then
68367765 echo $ECHO_N "(cached) $ECHO_C" >&6
68377766 else
68587787 LDFLAGS="$save_LDFLAGS"
68597788
68607789 fi
6861 echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
6862 echo "${ECHO_T}$lt_prog_compiler_static_works" >&6
7790 { echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
7791 echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; }
68637792
68647793 if test x"$lt_prog_compiler_static_works" = xyes; then
68657794 :
68687797 fi
68697798
68707799
6871 echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
6872 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
7800 { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
7801 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
68737802 if test "${lt_cv_prog_compiler_c_o+set}" = set; then
68747803 echo $ECHO_N "(cached) $ECHO_C" >&6
68757804 else
68897818 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
68907819 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
68917820 -e 's:$: $lt_compiler_flag:'`
6892 (eval echo "\"\$as_me:6893: $lt_compile\"" >&5)
7821 (eval echo "\"\$as_me:7822: $lt_compile\"" >&5)
68937822 (eval "$lt_compile" 2>out/conftest.err)
68947823 ac_status=$?
68957824 cat out/conftest.err >&5
6896 echo "$as_me:6897: \$? = $ac_status" >&5
7825 echo "$as_me:7826: \$? = $ac_status" >&5
68977826 if (exit $ac_status) && test -s out/conftest2.$ac_objext
68987827 then
68997828 # The compiler can only warn and ignore the option if not recognized
69157844 $rm conftest*
69167845
69177846 fi
6918 echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
6919 echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6
7847 { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
7848 echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; }
69207849
69217850
69227851 hard_links="nottested"
69237852 if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
69247853 # do not overwrite the value of need_locks provided by the user
6925 echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
6926 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
7854 { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
7855 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
69277856 hard_links=yes
69287857 $rm conftest*
69297858 ln conftest.a conftest.b 2>/dev/null && hard_links=no
69307859 touch conftest.a
69317860 ln conftest.a conftest.b 2>&5 || hard_links=no
69327861 ln conftest.a conftest.b 2>/dev/null && hard_links=no
6933 echo "$as_me:$LINENO: result: $hard_links" >&5
6934 echo "${ECHO_T}$hard_links" >&6
7862 { echo "$as_me:$LINENO: result: $hard_links" >&5
7863 echo "${ECHO_T}$hard_links" >&6; }
69357864 if test "$hard_links" = no; then
69367865 { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
69377866 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
69417870 need_locks=no
69427871 fi
69437872
6944 echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
6945 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
7873 { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
7874 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
69467875
69477876 runpath_var=
69487877 allow_undefined_flag=
73578286 }
73588287 _ACEOF
73598288 rm -f conftest.$ac_objext conftest$ac_exeext
7360 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
7361 (eval $ac_link) 2>conftest.er1
8289 if { (ac_try="$ac_link"
8290 case "(($ac_try" in
8291 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8292 *) ac_try_echo=$ac_try;;
8293 esac
8294 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
8295 (eval "$ac_link") 2>conftest.er1
73628296 ac_status=$?
73638297 grep -v '^ *+' conftest.er1 >conftest.err
73648298 rm -f conftest.er1
73658299 cat conftest.err >&5
73668300 echo "$as_me:$LINENO: \$? = $ac_status" >&5
73678301 (exit $ac_status); } &&
7368 { ac_try='test -z "$ac_c_werror_flag"
7369 || test ! -s conftest.err'
7370 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
7371 (eval $ac_try) 2>&5
8302 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
8303 { (case "(($ac_try" in
8304 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8305 *) ac_try_echo=$ac_try;;
8306 esac
8307 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
8308 (eval "$ac_try") 2>&5
73728309 ac_status=$?
73738310 echo "$as_me:$LINENO: \$? = $ac_status" >&5
73748311 (exit $ac_status); }; } &&
73758312 { ac_try='test -s conftest$ac_exeext'
7376 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
7377 (eval $ac_try) 2>&5
8313 { (case "(($ac_try" in
8314 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8315 *) ac_try_echo=$ac_try;;
8316 esac
8317 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
8318 (eval "$ac_try") 2>&5
73788319 ac_status=$?
73798320 echo "$as_me:$LINENO: \$? = $ac_status" >&5
73808321 (exit $ac_status); }; }; then
73888329 echo "$as_me: failed program was:" >&5
73898330 sed 's/^/| /' conftest.$ac_ext >&5
73908331
7391 fi
7392 rm -f conftest.err conftest.$ac_objext \
8332
8333 fi
8334
8335 rm -f core conftest.err conftest.$ac_objext \
73938336 conftest$ac_exeext conftest.$ac_ext
73948337 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
73958338
74188361 }
74198362 _ACEOF
74208363 rm -f conftest.$ac_objext conftest$ac_exeext
7421 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
7422 (eval $ac_link) 2>conftest.er1
8364 if { (ac_try="$ac_link"
8365 case "(($ac_try" in
8366 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8367 *) ac_try_echo=$ac_try;;
8368 esac
8369 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
8370 (eval "$ac_link") 2>conftest.er1
74238371 ac_status=$?
74248372 grep -v '^ *+' conftest.er1 >conftest.err
74258373 rm -f conftest.er1
74268374 cat conftest.err >&5
74278375 echo "$as_me:$LINENO: \$? = $ac_status" >&5
74288376 (exit $ac_status); } &&
7429 { ac_try='test -z "$ac_c_werror_flag"
7430 || test ! -s conftest.err'
7431 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
7432 (eval $ac_try) 2>&5
8377 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
8378 { (case "(($ac_try" in
8379 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8380 *) ac_try_echo=$ac_try;;
8381 esac
8382 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
8383 (eval "$ac_try") 2>&5
74338384 ac_status=$?
74348385 echo "$as_me:$LINENO: \$? = $ac_status" >&5
74358386 (exit $ac_status); }; } &&
74368387 { ac_try='test -s conftest$ac_exeext'
7437 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
7438 (eval $ac_try) 2>&5
8388 { (case "(($ac_try" in
8389 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8390 *) ac_try_echo=$ac_try;;
8391 esac
8392 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
8393 (eval "$ac_try") 2>&5
74398394 ac_status=$?
74408395 echo "$as_me:$LINENO: \$? = $ac_status" >&5
74418396 (exit $ac_status); }; }; then
74498404 echo "$as_me: failed program was:" >&5
74508405 sed 's/^/| /' conftest.$ac_ext >&5
74518406
7452 fi
7453 rm -f conftest.err conftest.$ac_objext \
8407
8408 fi
8409
8410 rm -f core conftest.err conftest.$ac_objext \
74548411 conftest$ac_exeext conftest.$ac_ext
74558412 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
74568413
78998856 esac
79008857 fi
79018858
7902 echo "$as_me:$LINENO: result: $ld_shlibs" >&5
7903 echo "${ECHO_T}$ld_shlibs" >&6
8859 { echo "$as_me:$LINENO: result: $ld_shlibs" >&5
8860 echo "${ECHO_T}$ld_shlibs" >&6; }
79048861 test "$ld_shlibs" = no && can_build_shared=no
79058862
79068863 #
79208877 # Test whether the compiler implicitly links with -lc since on some
79218878 # systems, -lgcc has to come before -lc. If gcc already passes -lc
79228879 # to ld, don't add -lc before -lgcc.
7923 echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
7924 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
8880 { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
8881 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
79258882 $rm conftest*
79268883 printf "$lt_simple_compile_test_code" > conftest.$ac_ext
79278884
79588915 cat conftest.err 1>&5
79598916 fi
79608917 $rm conftest*
7961 echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
7962 echo "${ECHO_T}$archive_cmds_need_lc" >&6
8918 { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
8919 echo "${ECHO_T}$archive_cmds_need_lc" >&6; }
79638920 ;;
79648921 esac
79658922 fi
79668923 ;;
79678924 esac
79688925
7969 echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
7970 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
8926 { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
8927 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
79718928 library_names_spec=
79728929 libname_spec='lib$name'
79738930 soname_spec=
85549511 dynamic_linker=no
85559512 ;;
85569513 esac
8557 echo "$as_me:$LINENO: result: $dynamic_linker" >&5
8558 echo "${ECHO_T}$dynamic_linker" >&6
9514 { echo "$as_me:$LINENO: result: $dynamic_linker" >&5
9515 echo "${ECHO_T}$dynamic_linker" >&6; }
85599516 test "$dynamic_linker" = no && can_build_shared=no
85609517
85619518 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
85639520 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
85649521 fi
85659522
8566 echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
8567 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
9523 { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
9524 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
85689525 hardcode_action=
85699526 if test -n "$hardcode_libdir_flag_spec" || \
85709527 test -n "$runpath_var" || \
85889545 # directories.
85899546 hardcode_action=unsupported
85909547 fi
8591 echo "$as_me:$LINENO: result: $hardcode_action" >&5
8592 echo "${ECHO_T}$hardcode_action" >&6
9548 { echo "$as_me:$LINENO: result: $hardcode_action" >&5
9549 echo "${ECHO_T}$hardcode_action" >&6; }
85939550
85949551 if test "$hardcode_action" = relink; then
85959552 # Fast installation is not supported
86029559
86039560 striplib=
86049561 old_striplib=
8605 echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
8606 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
9562 { echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
9563 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
86079564 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
86089565 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
86099566 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
8610 echo "$as_me:$LINENO: result: yes" >&5
8611 echo "${ECHO_T}yes" >&6
9567 { echo "$as_me:$LINENO: result: yes" >&5
9568 echo "${ECHO_T}yes" >&6; }
86129569 else
86139570 # FIXME - insert some real tests, host_os isn't really good enough
86149571 case $host_os in
86159572 darwin*)
86169573 if test -n "$STRIP" ; then
86179574 striplib="$STRIP -x"
8618 echo "$as_me:$LINENO: result: yes" >&5
8619 echo "${ECHO_T}yes" >&6
9575 { echo "$as_me:$LINENO: result: yes" >&5
9576 echo "${ECHO_T}yes" >&6; }
86209577 else
8621 echo "$as_me:$LINENO: result: no" >&5
8622 echo "${ECHO_T}no" >&6
9578 { echo "$as_me:$LINENO: result: no" >&5
9579 echo "${ECHO_T}no" >&6; }
86239580 fi
86249581 ;;
86259582 *)
8626 echo "$as_me:$LINENO: result: no" >&5
8627 echo "${ECHO_T}no" >&6
9583 { echo "$as_me:$LINENO: result: no" >&5
9584 echo "${ECHO_T}no" >&6; }
86289585 ;;
86299586 esac
86309587 fi
86569613
86579614 darwin*)
86589615 # if libdl is installed we need to link against it
8659 echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
8660 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
9616 { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
9617 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
86619618 if test "${ac_cv_lib_dl_dlopen+set}" = set; then
86629619 echo $ECHO_N "(cached) $ECHO_C" >&6
86639620 else
86709627 cat >>conftest.$ac_ext <<_ACEOF
86719628 /* end confdefs.h. */
86729629
8673 /* Override any gcc2 internal prototype to avoid an error. */
9630 /* Override any GCC internal prototype to avoid an error.
9631 Use char because int might match the return type of a GCC
9632 builtin and then its argument prototype would still apply. */
86749633 #ifdef __cplusplus
86759634 extern "C"
86769635 #endif
8677 /* We use char because int might match the return type of a gcc2
8678 builtin and then its argument prototype would still apply. */
86799636 char dlopen ();
86809637 int
86819638 main ()
86829639 {
8683 dlopen ();
9640 return dlopen ();
86849641 ;
86859642 return 0;
86869643 }
86879644 _ACEOF
86889645 rm -f conftest.$ac_objext conftest$ac_exeext
8689 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
8690 (eval $ac_link) 2>conftest.er1
9646 if { (ac_try="$ac_link"
9647 case "(($ac_try" in
9648 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9649 *) ac_try_echo=$ac_try;;
9650 esac
9651 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
9652 (eval "$ac_link") 2>conftest.er1
86919653 ac_status=$?
86929654 grep -v '^ *+' conftest.er1 >conftest.err
86939655 rm -f conftest.er1
86949656 cat conftest.err >&5
86959657 echo "$as_me:$LINENO: \$? = $ac_status" >&5
86969658 (exit $ac_status); } &&
8697 { ac_try='test -z "$ac_c_werror_flag"
8698 || test ! -s conftest.err'
8699 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
8700 (eval $ac_try) 2>&5
9659 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
9660 { (case "(($ac_try" in
9661 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9662 *) ac_try_echo=$ac_try;;
9663 esac
9664 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
9665 (eval "$ac_try") 2>&5
87019666 ac_status=$?
87029667 echo "$as_me:$LINENO: \$? = $ac_status" >&5
87039668 (exit $ac_status); }; } &&
87049669 { ac_try='test -s conftest$ac_exeext'
8705 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
8706 (eval $ac_try) 2>&5
9670 { (case "(($ac_try" in
9671 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9672 *) ac_try_echo=$ac_try;;
9673 esac
9674 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
9675 (eval "$ac_try") 2>&5
87079676 ac_status=$?
87089677 echo "$as_me:$LINENO: \$? = $ac_status" >&5
87099678 (exit $ac_status); }; }; then
87129681 echo "$as_me: failed program was:" >&5
87139682 sed 's/^/| /' conftest.$ac_ext >&5
87149683
8715 ac_cv_lib_dl_dlopen=no
8716 fi
8717 rm -f conftest.err conftest.$ac_objext \
9684 ac_cv_lib_dl_dlopen=no
9685 fi
9686
9687 rm -f core conftest.err conftest.$ac_objext \
87189688 conftest$ac_exeext conftest.$ac_ext
87199689 LIBS=$ac_check_lib_save_LIBS
87209690 fi
8721 echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
8722 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
9691 { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
9692 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
87239693 if test $ac_cv_lib_dl_dlopen = yes; then
87249694 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
87259695 else
87339703 ;;
87349704
87359705 *)
8736 echo "$as_me:$LINENO: checking for shl_load" >&5
8737 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
9706 { echo "$as_me:$LINENO: checking for shl_load" >&5
9707 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
87389708 if test "${ac_cv_func_shl_load+set}" = set; then
87399709 echo $ECHO_N "(cached) $ECHO_C" >&6
87409710 else
87619731
87629732 #undef shl_load
87639733
8764 /* Override any gcc2 internal prototype to avoid an error. */
9734 /* Override any GCC internal prototype to avoid an error.
9735 Use char because int might match the return type of a GCC
9736 builtin and then its argument prototype would still apply. */
87659737 #ifdef __cplusplus
87669738 extern "C"
8767 {
87689739 #endif
8769 /* We use char because int might match the return type of a gcc2
8770 builtin and then its argument prototype would still apply. */
87719740 char shl_load ();
87729741 /* The GNU C library defines this for functions which it implements
87739742 to always fail with ENOSYS. Some functions are actually named
87749743 something starting with __ and the normal name is an alias. */
8775 #if defined (__stub_shl_load) || defined (__stub___shl_load)
9744 #if defined __stub_shl_load || defined __stub___shl_load
87769745 choke me
8777 #else
8778 char (*f) () = shl_load;
8779 #endif
8780 #ifdef __cplusplus
8781 }
87829746 #endif
87839747
87849748 int
87859749 main ()
87869750 {
8787 return f != shl_load;
9751 return shl_load ();
87889752 ;
87899753 return 0;
87909754 }
87919755 _ACEOF
87929756 rm -f conftest.$ac_objext conftest$ac_exeext
8793 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
8794 (eval $ac_link) 2>conftest.er1
9757 if { (ac_try="$ac_link"
9758 case "(($ac_try" in
9759 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9760 *) ac_try_echo=$ac_try;;
9761 esac
9762 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
9763 (eval "$ac_link") 2>conftest.er1
87959764 ac_status=$?
87969765 grep -v '^ *+' conftest.er1 >conftest.err
87979766 rm -f conftest.er1
87989767 cat conftest.err >&5
87999768 echo "$as_me:$LINENO: \$? = $ac_status" >&5
88009769 (exit $ac_status); } &&
8801 { ac_try='test -z "$ac_c_werror_flag"
8802 || test ! -s conftest.err'
8803 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
8804 (eval $ac_try) 2>&5
9770 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
9771 { (case "(($ac_try" in
9772 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9773 *) ac_try_echo=$ac_try;;
9774 esac
9775 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
9776 (eval "$ac_try") 2>&5
88059777 ac_status=$?
88069778 echo "$as_me:$LINENO: \$? = $ac_status" >&5
88079779 (exit $ac_status); }; } &&
88089780 { ac_try='test -s conftest$ac_exeext'
8809 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
8810 (eval $ac_try) 2>&5
9781 { (case "(($ac_try" in
9782 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9783 *) ac_try_echo=$ac_try;;
9784 esac
9785 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
9786 (eval "$ac_try") 2>&5
88119787 ac_status=$?
88129788 echo "$as_me:$LINENO: \$? = $ac_status" >&5
88139789 (exit $ac_status); }; }; then
88169792 echo "$as_me: failed program was:" >&5
88179793 sed 's/^/| /' conftest.$ac_ext >&5
88189794
8819 ac_cv_func_shl_load=no
8820 fi
8821 rm -f conftest.err conftest.$ac_objext \
9795 ac_cv_func_shl_load=no
9796 fi
9797
9798 rm -f core conftest.err conftest.$ac_objext \
88229799 conftest$ac_exeext conftest.$ac_ext
88239800 fi
8824 echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
8825 echo "${ECHO_T}$ac_cv_func_shl_load" >&6
9801 { echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
9802 echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
88269803 if test $ac_cv_func_shl_load = yes; then
88279804 lt_cv_dlopen="shl_load"
88289805 else
8829 echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
8830 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
9806 { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
9807 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
88319808 if test "${ac_cv_lib_dld_shl_load+set}" = set; then
88329809 echo $ECHO_N "(cached) $ECHO_C" >&6
88339810 else
88409817 cat >>conftest.$ac_ext <<_ACEOF
88419818 /* end confdefs.h. */
88429819
8843 /* Override any gcc2 internal prototype to avoid an error. */
9820 /* Override any GCC internal prototype to avoid an error.
9821 Use char because int might match the return type of a GCC
9822 builtin and then its argument prototype would still apply. */
88449823 #ifdef __cplusplus
88459824 extern "C"
88469825 #endif
8847 /* We use char because int might match the return type of a gcc2
8848 builtin and then its argument prototype would still apply. */
88499826 char shl_load ();
88509827 int
88519828 main ()
88529829 {
8853 shl_load ();
9830 return shl_load ();
88549831 ;
88559832 return 0;
88569833 }
88579834 _ACEOF
88589835 rm -f conftest.$ac_objext conftest$ac_exeext
8859 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
8860 (eval $ac_link) 2>conftest.er1
9836 if { (ac_try="$ac_link"
9837 case "(($ac_try" in
9838 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9839 *) ac_try_echo=$ac_try;;
9840 esac
9841 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
9842 (eval "$ac_link") 2>conftest.er1
88619843 ac_status=$?
88629844 grep -v '^ *+' conftest.er1 >conftest.err
88639845 rm -f conftest.er1
88649846 cat conftest.err >&5
88659847 echo "$as_me:$LINENO: \$? = $ac_status" >&5
88669848 (exit $ac_status); } &&
8867 { ac_try='test -z "$ac_c_werror_flag"
8868 || test ! -s conftest.err'
8869 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
8870 (eval $ac_try) 2>&5
9849 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
9850 { (case "(($ac_try" in
9851 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9852 *) ac_try_echo=$ac_try;;
9853 esac
9854 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
9855 (eval "$ac_try") 2>&5
88719856 ac_status=$?
88729857 echo "$as_me:$LINENO: \$? = $ac_status" >&5
88739858 (exit $ac_status); }; } &&
88749859 { ac_try='test -s conftest$ac_exeext'
8875 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
8876 (eval $ac_try) 2>&5
9860 { (case "(($ac_try" in
9861 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9862 *) ac_try_echo=$ac_try;;
9863 esac
9864 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
9865 (eval "$ac_try") 2>&5
88779866 ac_status=$?
88789867 echo "$as_me:$LINENO: \$? = $ac_status" >&5
88799868 (exit $ac_status); }; }; then
88829871 echo "$as_me: failed program was:" >&5
88839872 sed 's/^/| /' conftest.$ac_ext >&5
88849873
8885 ac_cv_lib_dld_shl_load=no
8886 fi
8887 rm -f conftest.err conftest.$ac_objext \
9874 ac_cv_lib_dld_shl_load=no
9875 fi
9876
9877 rm -f core conftest.err conftest.$ac_objext \
88889878 conftest$ac_exeext conftest.$ac_ext
88899879 LIBS=$ac_check_lib_save_LIBS
88909880 fi
8891 echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
8892 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
9881 { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
9882 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
88939883 if test $ac_cv_lib_dld_shl_load = yes; then
88949884 lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
88959885 else
8896 echo "$as_me:$LINENO: checking for dlopen" >&5
8897 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
9886 { echo "$as_me:$LINENO: checking for dlopen" >&5
9887 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
88989888 if test "${ac_cv_func_dlopen+set}" = set; then
88999889 echo $ECHO_N "(cached) $ECHO_C" >&6
89009890 else
89219911
89229912 #undef dlopen
89239913
8924 /* Override any gcc2 internal prototype to avoid an error. */
9914 /* Override any GCC internal prototype to avoid an error.
9915 Use char because int might match the return type of a GCC
9916 builtin and then its argument prototype would still apply. */
89259917 #ifdef __cplusplus
89269918 extern "C"
8927 {
89289919 #endif
8929 /* We use char because int might match the return type of a gcc2
8930 builtin and then its argument prototype would still apply. */
89319920 char dlopen ();
89329921 /* The GNU C library defines this for functions which it implements
89339922 to always fail with ENOSYS. Some functions are actually named
89349923 something starting with __ and the normal name is an alias. */
8935 #if defined (__stub_dlopen) || defined (__stub___dlopen)
9924 #if defined __stub_dlopen || defined __stub___dlopen
89369925 choke me
8937 #else
8938 char (*f) () = dlopen;
8939 #endif
8940 #ifdef __cplusplus
8941 }
89429926 #endif
89439927
89449928 int
89459929 main ()
89469930 {
8947 return f != dlopen;
9931 return dlopen ();
89489932 ;
89499933 return 0;
89509934 }
89519935 _ACEOF
89529936 rm -f conftest.$ac_objext conftest$ac_exeext
8953 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
8954 (eval $ac_link) 2>conftest.er1
9937 if { (ac_try="$ac_link"
9938 case "(($ac_try" in
9939 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9940 *) ac_try_echo=$ac_try;;
9941 esac
9942 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
9943 (eval "$ac_link") 2>conftest.er1
89559944 ac_status=$?
89569945 grep -v '^ *+' conftest.er1 >conftest.err
89579946 rm -f conftest.er1
89589947 cat conftest.err >&5
89599948 echo "$as_me:$LINENO: \$? = $ac_status" >&5
89609949 (exit $ac_status); } &&
8961 { ac_try='test -z "$ac_c_werror_flag"
8962 || test ! -s conftest.err'
8963 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
8964 (eval $ac_try) 2>&5
9950 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
9951 { (case "(($ac_try" in
9952 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9953 *) ac_try_echo=$ac_try;;
9954 esac
9955 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
9956 (eval "$ac_try") 2>&5
89659957 ac_status=$?
89669958 echo "$as_me:$LINENO: \$? = $ac_status" >&5
89679959 (exit $ac_status); }; } &&
89689960 { ac_try='test -s conftest$ac_exeext'
8969 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
8970 (eval $ac_try) 2>&5
9961 { (case "(($ac_try" in
9962 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9963 *) ac_try_echo=$ac_try;;
9964 esac
9965 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
9966 (eval "$ac_try") 2>&5
89719967 ac_status=$?
89729968 echo "$as_me:$LINENO: \$? = $ac_status" >&5
89739969 (exit $ac_status); }; }; then
89769972 echo "$as_me: failed program was:" >&5
89779973 sed 's/^/| /' conftest.$ac_ext >&5
89789974
8979 ac_cv_func_dlopen=no
8980 fi
8981 rm -f conftest.err conftest.$ac_objext \
9975 ac_cv_func_dlopen=no
9976 fi
9977
9978 rm -f core conftest.err conftest.$ac_objext \
89829979 conftest$ac_exeext conftest.$ac_ext
89839980 fi
8984 echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
8985 echo "${ECHO_T}$ac_cv_func_dlopen" >&6
9981 { echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
9982 echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
89869983 if test $ac_cv_func_dlopen = yes; then
89879984 lt_cv_dlopen="dlopen"
89889985 else
8989 echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
8990 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
9986 { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
9987 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
89919988 if test "${ac_cv_lib_dl_dlopen+set}" = set; then
89929989 echo $ECHO_N "(cached) $ECHO_C" >&6
89939990 else
90009997 cat >>conftest.$ac_ext <<_ACEOF
90019998 /* end confdefs.h. */
90029999
9003 /* Override any gcc2 internal prototype to avoid an error. */
10000 /* Override any GCC internal prototype to avoid an error.
10001 Use char because int might match the return type of a GCC
10002 builtin and then its argument prototype would still apply. */
900410003 #ifdef __cplusplus
900510004 extern "C"
900610005 #endif
9007 /* We use char because int might match the return type of a gcc2
9008 builtin and then its argument prototype would still apply. */
900910006 char dlopen ();
901010007 int
901110008 main ()
901210009 {
9013 dlopen ();
10010 return dlopen ();
901410011 ;
901510012 return 0;
901610013 }
901710014 _ACEOF
901810015 rm -f conftest.$ac_objext conftest$ac_exeext
9019 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
9020 (eval $ac_link) 2>conftest.er1
10016 if { (ac_try="$ac_link"
10017 case "(($ac_try" in
10018 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10019 *) ac_try_echo=$ac_try;;
10020 esac
10021 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
10022 (eval "$ac_link") 2>conftest.er1
902110023 ac_status=$?
902210024 grep -v '^ *+' conftest.er1 >conftest.err
902310025 rm -f conftest.er1
902410026 cat conftest.err >&5
902510027 echo "$as_me:$LINENO: \$? = $ac_status" >&5
902610028 (exit $ac_status); } &&
9027 { ac_try='test -z "$ac_c_werror_flag"
9028 || test ! -s conftest.err'
9029 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9030 (eval $ac_try) 2>&5
10029 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
10030 { (case "(($ac_try" in
10031 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10032 *) ac_try_echo=$ac_try;;
10033 esac
10034 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
10035 (eval "$ac_try") 2>&5
903110036 ac_status=$?
903210037 echo "$as_me:$LINENO: \$? = $ac_status" >&5
903310038 (exit $ac_status); }; } &&
903410039 { ac_try='test -s conftest$ac_exeext'
9035 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9036 (eval $ac_try) 2>&5
10040 { (case "(($ac_try" in
10041 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10042 *) ac_try_echo=$ac_try;;
10043 esac
10044 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
10045 (eval "$ac_try") 2>&5
903710046 ac_status=$?
903810047 echo "$as_me:$LINENO: \$? = $ac_status" >&5
903910048 (exit $ac_status); }; }; then
904210051 echo "$as_me: failed program was:" >&5
904310052 sed 's/^/| /' conftest.$ac_ext >&5
904410053
9045 ac_cv_lib_dl_dlopen=no
9046 fi
9047 rm -f conftest.err conftest.$ac_objext \
10054 ac_cv_lib_dl_dlopen=no
10055 fi
10056
10057 rm -f core conftest.err conftest.$ac_objext \
904810058 conftest$ac_exeext conftest.$ac_ext
904910059 LIBS=$ac_check_lib_save_LIBS
905010060 fi
9051 echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
9052 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
10061 { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
10062 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
905310063 if test $ac_cv_lib_dl_dlopen = yes; then
905410064 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
905510065 else
9056 echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
9057 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
10066 { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
10067 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
905810068 if test "${ac_cv_lib_svld_dlopen+set}" = set; then
905910069 echo $ECHO_N "(cached) $ECHO_C" >&6
906010070 else
906710077 cat >>conftest.$ac_ext <<_ACEOF
906810078 /* end confdefs.h. */
906910079
9070 /* Override any gcc2 internal prototype to avoid an error. */
10080 /* Override any GCC internal prototype to avoid an error.
10081 Use char because int might match the return type of a GCC
10082 builtin and then its argument prototype would still apply. */
907110083 #ifdef __cplusplus
907210084 extern "C"
907310085 #endif
9074 /* We use char because int might match the return type of a gcc2
9075 builtin and then its argument prototype would still apply. */
907610086 char dlopen ();
907710087 int
907810088 main ()
907910089 {
9080 dlopen ();
10090 return dlopen ();
908110091 ;
908210092 return 0;
908310093 }
908410094 _ACEOF
908510095 rm -f conftest.$ac_objext conftest$ac_exeext
9086 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
9087 (eval $ac_link) 2>conftest.er1
10096 if { (ac_try="$ac_link"
10097 case "(($ac_try" in
10098 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10099 *) ac_try_echo=$ac_try;;
10100 esac
10101 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
10102 (eval "$ac_link") 2>conftest.er1
908810103 ac_status=$?
908910104 grep -v '^ *+' conftest.er1 >conftest.err
909010105 rm -f conftest.er1
909110106 cat conftest.err >&5
909210107 echo "$as_me:$LINENO: \$? = $ac_status" >&5
909310108 (exit $ac_status); } &&
9094 { ac_try='test -z "$ac_c_werror_flag"
9095 || test ! -s conftest.err'
9096 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9097 (eval $ac_try) 2>&5
10109 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
10110 { (case "(($ac_try" in
10111 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10112 *) ac_try_echo=$ac_try;;
10113 esac
10114 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
10115 (eval "$ac_try") 2>&5
909810116 ac_status=$?
909910117 echo "$as_me:$LINENO: \$? = $ac_status" >&5
910010118 (exit $ac_status); }; } &&
910110119 { ac_try='test -s conftest$ac_exeext'
9102 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9103 (eval $ac_try) 2>&5
10120 { (case "(($ac_try" in
10121 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10122 *) ac_try_echo=$ac_try;;
10123 esac
10124 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
10125 (eval "$ac_try") 2>&5
910410126 ac_status=$?
910510127 echo "$as_me:$LINENO: \$? = $ac_status" >&5
910610128 (exit $ac_status); }; }; then
910910131 echo "$as_me: failed program was:" >&5
911010132 sed 's/^/| /' conftest.$ac_ext >&5
911110133
9112 ac_cv_lib_svld_dlopen=no
9113 fi
9114 rm -f conftest.err conftest.$ac_objext \
10134 ac_cv_lib_svld_dlopen=no
10135 fi
10136
10137 rm -f core conftest.err conftest.$ac_objext \
911510138 conftest$ac_exeext conftest.$ac_ext
911610139 LIBS=$ac_check_lib_save_LIBS
911710140 fi
9118 echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
9119 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
10141 { echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
10142 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
912010143 if test $ac_cv_lib_svld_dlopen = yes; then
912110144 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
912210145 else
9123 echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
9124 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
10146 { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
10147 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
912510148 if test "${ac_cv_lib_dld_dld_link+set}" = set; then
912610149 echo $ECHO_N "(cached) $ECHO_C" >&6
912710150 else
913410157 cat >>conftest.$ac_ext <<_ACEOF
913510158 /* end confdefs.h. */
913610159
9137 /* Override any gcc2 internal prototype to avoid an error. */
10160 /* Override any GCC internal prototype to avoid an error.
10161 Use char because int might match the return type of a GCC
10162 builtin and then its argument prototype would still apply. */
913810163 #ifdef __cplusplus
913910164 extern "C"
914010165 #endif
9141 /* We use char because int might match the return type of a gcc2
9142 builtin and then its argument prototype would still apply. */
914310166 char dld_link ();
914410167 int
914510168 main ()
914610169 {
9147 dld_link ();
10170 return dld_link ();
914810171 ;
914910172 return 0;
915010173 }
915110174 _ACEOF
915210175 rm -f conftest.$ac_objext conftest$ac_exeext
9153 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
9154 (eval $ac_link) 2>conftest.er1
10176 if { (ac_try="$ac_link"
10177 case "(($ac_try" in
10178 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10179 *) ac_try_echo=$ac_try;;
10180 esac
10181 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
10182 (eval "$ac_link") 2>conftest.er1
915510183 ac_status=$?
915610184 grep -v '^ *+' conftest.er1 >conftest.err
915710185 rm -f conftest.er1
915810186 cat conftest.err >&5
915910187 echo "$as_me:$LINENO: \$? = $ac_status" >&5
916010188 (exit $ac_status); } &&
9161 { ac_try='test -z "$ac_c_werror_flag"
9162 || test ! -s conftest.err'
9163 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9164 (eval $ac_try) 2>&5
10189 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
10190 { (case "(($ac_try" in
10191 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10192 *) ac_try_echo=$ac_try;;
10193 esac
10194 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
10195 (eval "$ac_try") 2>&5
916510196 ac_status=$?
916610197 echo "$as_me:$LINENO: \$? = $ac_status" >&5
916710198 (exit $ac_status); }; } &&
916810199 { ac_try='test -s conftest$ac_exeext'
9169 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9170 (eval $ac_try) 2>&5
10200 { (case "(($ac_try" in
10201 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10202 *) ac_try_echo=$ac_try;;
10203 esac
10204 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
10205 (eval "$ac_try") 2>&5
917110206 ac_status=$?
917210207 echo "$as_me:$LINENO: \$? = $ac_status" >&5
917310208 (exit $ac_status); }; }; then
917610211 echo "$as_me: failed program was:" >&5
917710212 sed 's/^/| /' conftest.$ac_ext >&5
917810213
9179 ac_cv_lib_dld_dld_link=no
9180 fi
9181 rm -f conftest.err conftest.$ac_objext \
10214 ac_cv_lib_dld_dld_link=no
10215 fi
10216
10217 rm -f core conftest.err conftest.$ac_objext \
918210218 conftest$ac_exeext conftest.$ac_ext
918310219 LIBS=$ac_check_lib_save_LIBS
918410220 fi
9185 echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
9186 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
10221 { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
10222 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
918710223 if test $ac_cv_lib_dld_dld_link = yes; then
918810224 lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
918910225 fi
922310259 save_LIBS="$LIBS"
922410260 LIBS="$lt_cv_dlopen_libs $LIBS"
922510261
9226 echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
9227 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
10262 { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
10263 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
922810264 if test "${lt_cv_dlopen_self+set}" = set; then
922910265 echo $ECHO_N "(cached) $ECHO_C" >&6
923010266 else
923410270 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
923510271 lt_status=$lt_dlunknown
923610272 cat > conftest.$ac_ext <<EOF
9237 #line 9238 "configure"
10273 #line 10274 "configure"
923810274 #include "confdefs.h"
923910275
924010276 #if HAVE_DLFCN_H
931810354
931910355
932010356 fi
9321 echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
9322 echo "${ECHO_T}$lt_cv_dlopen_self" >&6
10357 { echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
10358 echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
932310359
932410360 if test "x$lt_cv_dlopen_self" = xyes; then
932510361 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
9326 echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
9327 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
10362 { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
10363 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
932810364 if test "${lt_cv_dlopen_self_static+set}" = set; then
932910365 echo $ECHO_N "(cached) $ECHO_C" >&6
933010366 else
933410370 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
933510371 lt_status=$lt_dlunknown
933610372 cat > conftest.$ac_ext <<EOF
9337 #line 9338 "configure"
10373 #line 10374 "configure"
933810374 #include "confdefs.h"
933910375
934010376 #if HAVE_DLFCN_H
941810454
941910455
942010456 fi
9421 echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
9422 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
10457 { echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
10458 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
942310459 fi
942410460
942510461 CPPFLAGS="$save_CPPFLAGS"
944110477
944210478
944310479 # Report which library types will actually be built
9444 echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
9445 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
9446 echo "$as_me:$LINENO: result: $can_build_shared" >&5
9447 echo "${ECHO_T}$can_build_shared" >&6
9448
9449 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
9450 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
10480 { echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
10481 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
10482 { echo "$as_me:$LINENO: result: $can_build_shared" >&5
10483 echo "${ECHO_T}$can_build_shared" >&6; }
10484
10485 { echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
10486 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
945110487 test "$can_build_shared" = "no" && enable_shared=no
945210488
945310489 # On AIX, shared libraries and static libraries use the same namespace, and
946710503 fi
946810504 ;;
946910505 esac
9470 echo "$as_me:$LINENO: result: $enable_shared" >&5
9471 echo "${ECHO_T}$enable_shared" >&6
9472
9473 echo "$as_me:$LINENO: checking whether to build static libraries" >&5
9474 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
10506 { echo "$as_me:$LINENO: result: $enable_shared" >&5
10507 echo "${ECHO_T}$enable_shared" >&6; }
10508
10509 { echo "$as_me:$LINENO: checking whether to build static libraries" >&5
10510 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
947510511 # Make sure either enable_shared or enable_static is yes.
947610512 test "$enable_shared" = yes || enable_static=yes
9477 echo "$as_me:$LINENO: result: $enable_static" >&5
9478 echo "${ECHO_T}$enable_static" >&6
10513 { echo "$as_me:$LINENO: result: $enable_static" >&5
10514 echo "${ECHO_T}$enable_static" >&6; }
947910515
948010516 # The else clause should only fire when bootstrapping the
948110517 # libtool distribution, otherwise you forgot to ship ltmain.sh
996711003 CC="$lt_save_CC"
996811004
996911005
9970 # Check whether --with-tags or --without-tags was given.
11006 # Check whether --with-tags was given.
997111007 if test "${with_tags+set}" = set; then
9972 withval="$with_tags"
9973 tagnames="$withval"
9974 fi;
11008 withval=$with_tags; tagnames="$withval"
11009 fi
11010
997511011
997611012 if test -f "$ltmain" && test -n "$tagnames"; then
997711013 if test ! -f "${ofile}"; then
1002511061 if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
1002611062 ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
1002711063 (test "X$CXX" != "Xg++"))) ; then
10028 ac_ext=cc
11064 ac_ext=cpp
1002911065 ac_cpp='$CXXCPP $CPPFLAGS'
1003011066 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1003111067 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1014411180 # Set up default GNU C++ configuration
1014511181
1014611182
10147 # Check whether --with-gnu-ld or --without-gnu-ld was given.
11183 # Check whether --with-gnu-ld was given.
1014811184 if test "${with_gnu_ld+set}" = set; then
10149 withval="$with_gnu_ld"
10150 test "$withval" = no || with_gnu_ld=yes
11185 withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
1015111186 else
1015211187 with_gnu_ld=no
10153 fi;
11188 fi
11189
1015411190 ac_prog=ld
1015511191 if test "$GCC" = yes; then
1015611192 # Check if gcc -print-prog-name=ld gives a path.
10157 echo "$as_me:$LINENO: checking for ld used by $CC" >&5
10158 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
11193 { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
11194 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
1015911195 case $host in
1016011196 *-*-mingw*)
1016111197 # gcc leaves a trailing carriage return which upsets mingw
1018411220 ;;
1018511221 esac
1018611222 elif test "$with_gnu_ld" = yes; then
10187 echo "$as_me:$LINENO: checking for GNU ld" >&5
10188 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
10189 else
10190 echo "$as_me:$LINENO: checking for non-GNU ld" >&5
10191 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
11223 { echo "$as_me:$LINENO: checking for GNU ld" >&5
11224 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
11225 else
11226 { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
11227 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
1019211228 fi
1019311229 if test "${lt_cv_path_LD+set}" = set; then
1019411230 echo $ECHO_N "(cached) $ECHO_C" >&6
1022111257
1022211258 LD="$lt_cv_path_LD"
1022311259 if test -n "$LD"; then
10224 echo "$as_me:$LINENO: result: $LD" >&5
10225 echo "${ECHO_T}$LD" >&6
10226 else
10227 echo "$as_me:$LINENO: result: no" >&5
10228 echo "${ECHO_T}no" >&6
11260 { echo "$as_me:$LINENO: result: $LD" >&5
11261 echo "${ECHO_T}$LD" >&6; }
11262 else
11263 { echo "$as_me:$LINENO: result: no" >&5
11264 echo "${ECHO_T}no" >&6; }
1022911265 fi
1023011266 test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
1023111267 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
1023211268 { (exit 1); exit 1; }; }
10233 echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
10234 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
11269 { echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
11270 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
1023511271 if test "${lt_cv_prog_gnu_ld+set}" = set; then
1023611272 echo $ECHO_N "(cached) $ECHO_C" >&6
1023711273 else
1024511281 ;;
1024611282 esac
1024711283 fi
10248 echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
10249 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
11284 { echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
11285 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
1025011286 with_gnu_ld=$lt_cv_prog_gnu_ld
1025111287
1025211288
1029611332 fi
1029711333
1029811334 # PORTME: fill in a description of your system's C++ link characteristics
10299 echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
10300 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
11335 { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
11336 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
1030111337 ld_shlibs_CXX=yes
1030211338 case $host_os in
1030311339 aix3*)
1040911445 }
1041011446 _ACEOF
1041111447 rm -f conftest.$ac_objext conftest$ac_exeext
10412 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
10413 (eval $ac_link) 2>conftest.er1
11448 if { (ac_try="$ac_link"
11449 case "(($ac_try" in
11450 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
11451 *) ac_try_echo=$ac_try;;
11452 esac
11453 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
11454 (eval "$ac_link") 2>conftest.er1
1041411455 ac_status=$?
1041511456 grep -v '^ *+' conftest.er1 >conftest.err
1041611457 rm -f conftest.er1
1041711458 cat conftest.err >&5
1041811459 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1041911460 (exit $ac_status); } &&
10420 { ac_try='test -z "$ac_cxx_werror_flag"
10421 || test ! -s conftest.err'
10422 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10423 (eval $ac_try) 2>&5
11461 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
11462 { (case "(($ac_try" in
11463 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
11464 *) ac_try_echo=$ac_try;;
11465 esac
11466 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
11467 (eval "$ac_try") 2>&5
1042411468 ac_status=$?
1042511469 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1042611470 (exit $ac_status); }; } &&
1042711471 { ac_try='test -s conftest$ac_exeext'
10428 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10429 (eval $ac_try) 2>&5
11472 { (case "(($ac_try" in
11473 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
11474 *) ac_try_echo=$ac_try;;
11475 esac
11476 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
11477 (eval "$ac_try") 2>&5
1043011478 ac_status=$?
1043111479 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1043211480 (exit $ac_status); }; }; then
1044011488 echo "$as_me: failed program was:" >&5
1044111489 sed 's/^/| /' conftest.$ac_ext >&5
1044211490
10443 fi
10444 rm -f conftest.err conftest.$ac_objext \
11491
11492 fi
11493
11494 rm -f core conftest.err conftest.$ac_objext \
1044511495 conftest$ac_exeext conftest.$ac_ext
1044611496 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
1044711497
1047111521 }
1047211522 _ACEOF
1047311523 rm -f conftest.$ac_objext conftest$ac_exeext
10474 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
10475 (eval $ac_link) 2>conftest.er1
11524 if { (ac_try="$ac_link"
11525 case "(($ac_try" in
11526 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
11527 *) ac_try_echo=$ac_try;;
11528 esac
11529 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
11530 (eval "$ac_link") 2>conftest.er1
1047611531 ac_status=$?
1047711532 grep -v '^ *+' conftest.er1 >conftest.err
1047811533 rm -f conftest.er1
1047911534 cat conftest.err >&5
1048011535 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1048111536 (exit $ac_status); } &&
10482 { ac_try='test -z "$ac_cxx_werror_flag"
10483 || test ! -s conftest.err'
10484 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10485 (eval $ac_try) 2>&5
11537 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
11538 { (case "(($ac_try" in
11539 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
11540 *) ac_try_echo=$ac_try;;
11541 esac
11542 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
11543 (eval "$ac_try") 2>&5
1048611544 ac_status=$?
1048711545 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1048811546 (exit $ac_status); }; } &&
1048911547 { ac_try='test -s conftest$ac_exeext'
10490 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10491 (eval $ac_try) 2>&5
11548 { (case "(($ac_try" in
11549 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
11550 *) ac_try_echo=$ac_try;;
11551 esac
11552 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
11553 (eval "$ac_try") 2>&5
1049211554 ac_status=$?
1049311555 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1049411556 (exit $ac_status); }; }; then
1050211564 echo "$as_me: failed program was:" >&5
1050311565 sed 's/^/| /' conftest.$ac_ext >&5
1050411566
10505 fi
10506 rm -f conftest.err conftest.$ac_objext \
11567
11568 fi
11569
11570 rm -f core conftest.err conftest.$ac_objext \
1050711571 conftest$ac_exeext conftest.$ac_ext
1050811572 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
1050911573
1123412298 ld_shlibs_CXX=no
1123512299 ;;
1123612300 esac
11237 echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
11238 echo "${ECHO_T}$ld_shlibs_CXX" >&6
12301 { echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
12302 echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
1123912303 test "$ld_shlibs_CXX" = no && can_build_shared=no
1124012304
1124112305 GCC_CXX="$GXX"
1137412438 lt_prog_compiler_pic_CXX=
1137512439 lt_prog_compiler_static_CXX=
1137612440
11377 echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
11378 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
12441 { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
12442 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
1137912443
1138012444 # C++ specific cases for pic, static, wl, etc.
1138112445 if test "$GXX" = yes; then
1164812712 esac
1164912713 fi
1165012714
11651 echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
11652 echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6
12715 { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
12716 echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; }
1165312717
1165412718 #
1165512719 # Check to make sure the PIC flag actually works.
1165612720 #
1165712721 if test -n "$lt_prog_compiler_pic_CXX"; then
1165812722
11659 echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
11660 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6
12723 { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
12724 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; }
1166112725 if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
1166212726 echo $ECHO_N "(cached) $ECHO_C" >&6
1166312727 else
1167412738 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1167512739 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1167612740 -e 's:$: $lt_compiler_flag:'`
11677 (eval echo "\"\$as_me:11678: $lt_compile\"" >&5)
12741 (eval echo "\"\$as_me:12742: $lt_compile\"" >&5)
1167812742 (eval "$lt_compile" 2>conftest.err)
1167912743 ac_status=$?
1168012744 cat conftest.err >&5
11681 echo "$as_me:11682: \$? = $ac_status" >&5
12745 echo "$as_me:12746: \$? = $ac_status" >&5
1168212746 if (exit $ac_status) && test -s "$ac_outfile"; then
1168312747 # The compiler can only warn and ignore the option if not recognized
1168412748 # So say no if there are warnings other than the usual output.
1169112755 $rm conftest*
1169212756
1169312757 fi
11694 echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
11695 echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6
12758 { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
12759 echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; }
1169612760
1169712761 if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
1169812762 case $lt_prog_compiler_pic_CXX in
1171912783 # Check to make sure the static flag actually works.
1172012784 #
1172112785 wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
11722 echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
11723 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
12786 { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
12787 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
1172412788 if test "${lt_prog_compiler_static_works_CXX+set}" = set; then
1172512789 echo $ECHO_N "(cached) $ECHO_C" >&6
1172612790 else
1174712811 LDFLAGS="$save_LDFLAGS"
1174812812
1174912813 fi
11750 echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5
11751 echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6
12814 { echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5
12815 echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6; }
1175212816
1175312817 if test x"$lt_prog_compiler_static_works_CXX" = xyes; then
1175412818 :
1175712821 fi
1175812822
1175912823
11760 echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
11761 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
12824 { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
12825 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
1176212826 if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
1176312827 echo $ECHO_N "(cached) $ECHO_C" >&6
1176412828 else
1177812842 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1177912843 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1178012844 -e 's:$: $lt_compiler_flag:'`
11781 (eval echo "\"\$as_me:11782: $lt_compile\"" >&5)
12845 (eval echo "\"\$as_me:12846: $lt_compile\"" >&5)
1178212846 (eval "$lt_compile" 2>out/conftest.err)
1178312847 ac_status=$?
1178412848 cat out/conftest.err >&5
11785 echo "$as_me:11786: \$? = $ac_status" >&5
12849 echo "$as_me:12850: \$? = $ac_status" >&5
1178612850 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1178712851 then
1178812852 # The compiler can only warn and ignore the option if not recognized
1180412868 $rm conftest*
1180512869
1180612870 fi
11807 echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
11808 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6
12871 { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
12872 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; }
1180912873
1181012874
1181112875 hard_links="nottested"
1181212876 if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
1181312877 # do not overwrite the value of need_locks provided by the user
11814 echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
11815 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
12878 { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
12879 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
1181612880 hard_links=yes
1181712881 $rm conftest*
1181812882 ln conftest.a conftest.b 2>/dev/null && hard_links=no
1181912883 touch conftest.a
1182012884 ln conftest.a conftest.b 2>&5 || hard_links=no
1182112885 ln conftest.a conftest.b 2>/dev/null && hard_links=no
11822 echo "$as_me:$LINENO: result: $hard_links" >&5
11823 echo "${ECHO_T}$hard_links" >&6
12886 { echo "$as_me:$LINENO: result: $hard_links" >&5
12887 echo "${ECHO_T}$hard_links" >&6; }
1182412888 if test "$hard_links" = no; then
1182512889 { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
1182612890 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
1183012894 need_locks=no
1183112895 fi
1183212896
11833 echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
11834 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
12897 { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
12898 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
1183512899
1183612900 export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
1183712901 case $host_os in
1185512919 ;;
1185612920 esac
1185712921
11858 echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
11859 echo "${ECHO_T}$ld_shlibs_CXX" >&6
12922 { echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
12923 echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
1186012924 test "$ld_shlibs_CXX" = no && can_build_shared=no
1186112925
1186212926 #
1187612940 # Test whether the compiler implicitly links with -lc since on some
1187712941 # systems, -lgcc has to come before -lc. If gcc already passes -lc
1187812942 # to ld, don't add -lc before -lgcc.
11879 echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
11880 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
12943 { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
12944 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
1188112945 $rm conftest*
1188212946 printf "$lt_simple_compile_test_code" > conftest.$ac_ext
1188312947
1191412978 cat conftest.err 1>&5
1191512979 fi
1191612980 $rm conftest*
11917 echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
11918 echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6
12981 { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
12982 echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; }
1191912983 ;;
1192012984 esac
1192112985 fi
1192212986 ;;
1192312987 esac
1192412988
11925 echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
11926 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
12989 { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
12990 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
1192712991 library_names_spec=
1192812992 libname_spec='lib$name'
1192912993 soname_spec=
1251013574 dynamic_linker=no
1251113575 ;;
1251213576 esac
12513 echo "$as_me:$LINENO: result: $dynamic_linker" >&5
12514 echo "${ECHO_T}$dynamic_linker" >&6
13577 { echo "$as_me:$LINENO: result: $dynamic_linker" >&5
13578 echo "${ECHO_T}$dynamic_linker" >&6; }
1251513579 test "$dynamic_linker" = no && can_build_shared=no
1251613580
1251713581 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
1251913583 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
1252013584 fi
1252113585
12522 echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
12523 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
13586 { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
13587 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
1252413588 hardcode_action_CXX=
1252513589 if test -n "$hardcode_libdir_flag_spec_CXX" || \
1252613590 test -n "$runpath_var_CXX" || \
1254413608 # directories.
1254513609 hardcode_action_CXX=unsupported
1254613610 fi
12547 echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
12548 echo "${ECHO_T}$hardcode_action_CXX" >&6
13611 { echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
13612 echo "${ECHO_T}$hardcode_action_CXX" >&6; }
1254913613
1255013614 if test "$hardcode_action_CXX" = relink; then
1255113615 # Fast installation is not supported
1307014134 cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
1307114135
1307214136
13073 echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
13074 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
13075 echo "$as_me:$LINENO: result: $can_build_shared" >&5
13076 echo "${ECHO_T}$can_build_shared" >&6
13077
13078 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
13079 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
14137 { echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
14138 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
14139 { echo "$as_me:$LINENO: result: $can_build_shared" >&5
14140 echo "${ECHO_T}$can_build_shared" >&6; }
14141
14142 { echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
14143 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
1308014144 test "$can_build_shared" = "no" && enable_shared=no
1308114145
1308214146 # On AIX, shared libraries and static libraries use the same namespace, and
1309514159 fi
1309614160 ;;
1309714161 esac
13098 echo "$as_me:$LINENO: result: $enable_shared" >&5
13099 echo "${ECHO_T}$enable_shared" >&6
13100
13101 echo "$as_me:$LINENO: checking whether to build static libraries" >&5
13102 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
14162 { echo "$as_me:$LINENO: result: $enable_shared" >&5
14163 echo "${ECHO_T}$enable_shared" >&6; }
14164
14165 { echo "$as_me:$LINENO: checking whether to build static libraries" >&5
14166 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
1310314167 # Make sure either enable_shared or enable_static is yes.
1310414168 test "$enable_shared" = yes || enable_static=yes
13105 echo "$as_me:$LINENO: result: $enable_static" >&5
13106 echo "${ECHO_T}$enable_static" >&6
14169 { echo "$as_me:$LINENO: result: $enable_static" >&5
14170 echo "${ECHO_T}$enable_static" >&6; }
1310714171
1310814172 GCC_F77="$G77"
1310914173 LD_F77="$LD"
1311214176 lt_prog_compiler_pic_F77=
1311314177 lt_prog_compiler_static_F77=
1311414178
13115 echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
13116 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
14179 { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
14180 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
1311714181
1311814182 if test "$GCC" = yes; then
1311914183 lt_prog_compiler_wl_F77='-Wl,'
1332214386 esac
1332314387 fi
1332414388
13325 echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
13326 echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6
14389 { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
14390 echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; }
1332714391
1332814392 #
1332914393 # Check to make sure the PIC flag actually works.
1333014394 #
1333114395 if test -n "$lt_prog_compiler_pic_F77"; then
1333214396
13333 echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
13334 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6
14397 { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
14398 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; }
1333514399 if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
1333614400 echo $ECHO_N "(cached) $ECHO_C" >&6
1333714401 else
1334814412 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1334914413 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1335014414 -e 's:$: $lt_compiler_flag:'`
13351 (eval echo "\"\$as_me:13352: $lt_compile\"" >&5)
14415 (eval echo "\"\$as_me:14416: $lt_compile\"" >&5)
1335214416 (eval "$lt_compile" 2>conftest.err)
1335314417 ac_status=$?
1335414418 cat conftest.err >&5
13355 echo "$as_me:13356: \$? = $ac_status" >&5
14419 echo "$as_me:14420: \$? = $ac_status" >&5
1335614420 if (exit $ac_status) && test -s "$ac_outfile"; then
1335714421 # The compiler can only warn and ignore the option if not recognized
1335814422 # So say no if there are warnings other than the usual output.
1336514429 $rm conftest*
1336614430
1336714431 fi
13368 echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
13369 echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6
14432 { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
14433 echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; }
1337014434
1337114435 if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
1337214436 case $lt_prog_compiler_pic_F77 in
1339314457 # Check to make sure the static flag actually works.
1339414458 #
1339514459 wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\"
13396 echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
13397 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
14460 { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
14461 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
1339814462 if test "${lt_prog_compiler_static_works_F77+set}" = set; then
1339914463 echo $ECHO_N "(cached) $ECHO_C" >&6
1340014464 else
1342114485 LDFLAGS="$save_LDFLAGS"
1342214486
1342314487 fi
13424 echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5
13425 echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6
14488 { echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5
14489 echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6; }
1342614490
1342714491 if test x"$lt_prog_compiler_static_works_F77" = xyes; then
1342814492 :
1343114495 fi
1343214496
1343314497
13434 echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
13435 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
14498 { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
14499 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
1343614500 if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
1343714501 echo $ECHO_N "(cached) $ECHO_C" >&6
1343814502 else
1345214516 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1345314517 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1345414518 -e 's:$: $lt_compiler_flag:'`
13455 (eval echo "\"\$as_me:13456: $lt_compile\"" >&5)
14519 (eval echo "\"\$as_me:14520: $lt_compile\"" >&5)
1345614520 (eval "$lt_compile" 2>out/conftest.err)
1345714521 ac_status=$?
1345814522 cat out/conftest.err >&5
13459 echo "$as_me:13460: \$? = $ac_status" >&5
14523 echo "$as_me:14524: \$? = $ac_status" >&5
1346014524 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1346114525 then
1346214526 # The compiler can only warn and ignore the option if not recognized
1347814542 $rm conftest*
1347914543
1348014544 fi
13481 echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
13482 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6
14545 { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
14546 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; }
1348314547
1348414548
1348514549 hard_links="nottested"
1348614550 if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
1348714551 # do not overwrite the value of need_locks provided by the user
13488 echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
13489 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
14552 { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
14553 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
1349014554 hard_links=yes
1349114555 $rm conftest*
1349214556 ln conftest.a conftest.b 2>/dev/null && hard_links=no
1349314557 touch conftest.a
1349414558 ln conftest.a conftest.b 2>&5 || hard_links=no
1349514559 ln conftest.a conftest.b 2>/dev/null && hard_links=no
13496 echo "$as_me:$LINENO: result: $hard_links" >&5
13497 echo "${ECHO_T}$hard_links" >&6
14560 { echo "$as_me:$LINENO: result: $hard_links" >&5
14561 echo "${ECHO_T}$hard_links" >&6; }
1349814562 if test "$hard_links" = no; then
1349914563 { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
1350014564 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
1350414568 need_locks=no
1350514569 fi
1350614570
13507 echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
13508 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
14571 { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
14572 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
1350914573
1351014574 runpath_var=
1351114575 allow_undefined_flag_F77=
1391014974 end
1391114975 _ACEOF
1391214976 rm -f conftest.$ac_objext conftest$ac_exeext
13913 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
13914 (eval $ac_link) 2>conftest.er1
14977 if { (ac_try="$ac_link"
14978 case "(($ac_try" in
14979 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
14980 *) ac_try_echo=$ac_try;;
14981 esac
14982 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
14983 (eval "$ac_link") 2>conftest.er1
1391514984 ac_status=$?
1391614985 grep -v '^ *+' conftest.er1 >conftest.err
1391714986 rm -f conftest.er1
1391814987 cat conftest.err >&5
1391914988 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1392014989 (exit $ac_status); } &&
13921 { ac_try='test -z "$ac_f77_werror_flag"
13922 || test ! -s conftest.err'
13923 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
13924 (eval $ac_try) 2>&5
14990 { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err'
14991 { (case "(($ac_try" in
14992 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
14993 *) ac_try_echo=$ac_try;;
14994 esac
14995 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
14996 (eval "$ac_try") 2>&5
1392514997 ac_status=$?
1392614998 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1392714999 (exit $ac_status); }; } &&
1392815000 { ac_try='test -s conftest$ac_exeext'
13929 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
13930 (eval $ac_try) 2>&5
15001 { (case "(($ac_try" in
15002 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15003 *) ac_try_echo=$ac_try;;
15004 esac
15005 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
15006 (eval "$ac_try") 2>&5
1393115007 ac_status=$?
1393215008 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1393315009 (exit $ac_status); }; }; then
1394115017 echo "$as_me: failed program was:" >&5
1394215018 sed 's/^/| /' conftest.$ac_ext >&5
1394315019
13944 fi
13945 rm -f conftest.err conftest.$ac_objext \
15020
15021 fi
15022
15023 rm -f core conftest.err conftest.$ac_objext \
1394615024 conftest$ac_exeext conftest.$ac_ext
1394715025 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
1394815026
1396115039 end
1396215040 _ACEOF
1396315041 rm -f conftest.$ac_objext conftest$ac_exeext
13964 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
13965 (eval $ac_link) 2>conftest.er1
15042 if { (ac_try="$ac_link"
15043 case "(($ac_try" in
15044 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15045 *) ac_try_echo=$ac_try;;
15046 esac
15047 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
15048 (eval "$ac_link") 2>conftest.er1
1396615049 ac_status=$?
1396715050 grep -v '^ *+' conftest.er1 >conftest.err
1396815051 rm -f conftest.er1
1396915052 cat conftest.err >&5
1397015053 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1397115054 (exit $ac_status); } &&
13972 { ac_try='test -z "$ac_f77_werror_flag"
13973 || test ! -s conftest.err'
13974 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
13975 (eval $ac_try) 2>&5
15055 { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err'
15056 { (case "(($ac_try" in
15057 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15058 *) ac_try_echo=$ac_try;;
15059 esac
15060 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
15061 (eval "$ac_try") 2>&5
1397615062 ac_status=$?
1397715063 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1397815064 (exit $ac_status); }; } &&
1397915065 { ac_try='test -s conftest$ac_exeext'
13980 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
13981 (eval $ac_try) 2>&5
15066 { (case "(($ac_try" in
15067 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15068 *) ac_try_echo=$ac_try;;
15069 esac
15070 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
15071 (eval "$ac_try") 2>&5
1398215072 ac_status=$?
1398315073 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1398415074 (exit $ac_status); }; }; then
1399215082 echo "$as_me: failed program was:" >&5
1399315083 sed 's/^/| /' conftest.$ac_ext >&5
1399415084
13995 fi
13996 rm -f conftest.err conftest.$ac_objext \
15085
15086 fi
15087
15088 rm -f core conftest.err conftest.$ac_objext \
1399715089 conftest$ac_exeext conftest.$ac_ext
1399815090 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
1399915091
1444215534 esac
1444315535 fi
1444415536
14445 echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
14446 echo "${ECHO_T}$ld_shlibs_F77" >&6
15537 { echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
15538 echo "${ECHO_T}$ld_shlibs_F77" >&6; }
1444715539 test "$ld_shlibs_F77" = no && can_build_shared=no
1444815540
1444915541 #
1446315555 # Test whether the compiler implicitly links with -lc since on some
1446415556 # systems, -lgcc has to come before -lc. If gcc already passes -lc
1446515557 # to ld, don't add -lc before -lgcc.
14466 echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
14467 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
15558 { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
15559 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
1446815560 $rm conftest*
1446915561 printf "$lt_simple_compile_test_code" > conftest.$ac_ext
1447015562
1450115593 cat conftest.err 1>&5
1450215594 fi
1450315595 $rm conftest*
14504 echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
14505 echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6
15596 { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
15597 echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; }
1450615598 ;;
1450715599 esac
1450815600 fi
1450915601 ;;
1451015602 esac
1451115603
14512 echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
14513 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
15604 { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
15605 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
1451415606 library_names_spec=
1451515607 libname_spec='lib$name'
1451615608 soname_spec=
1509716189 dynamic_linker=no
1509816190 ;;
1509916191 esac
15100 echo "$as_me:$LINENO: result: $dynamic_linker" >&5
15101 echo "${ECHO_T}$dynamic_linker" >&6
16192 { echo "$as_me:$LINENO: result: $dynamic_linker" >&5
16193 echo "${ECHO_T}$dynamic_linker" >&6; }
1510216194 test "$dynamic_linker" = no && can_build_shared=no
1510316195
1510416196 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
1510616198 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
1510716199 fi
1510816200
15109 echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
15110 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
16201 { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
16202 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
1511116203 hardcode_action_F77=
1511216204 if test -n "$hardcode_libdir_flag_spec_F77" || \
1511316205 test -n "$runpath_var_F77" || \
1513116223 # directories.
1513216224 hardcode_action_F77=unsupported
1513316225 fi
15134 echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
15135 echo "${ECHO_T}$hardcode_action_F77" >&6
16226 { echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
16227 echo "${ECHO_T}$hardcode_action_F77" >&6; }
1513616228
1513716229 if test "$hardcode_action_F77" = relink; then
1513816230 # Fast installation is not supported
1556916661 if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
1557016662
1557116663
15572
1557316664 # Source file extension for Java test sources.
1557416665 ac_ext=java
1557516666
1563716728 lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
1563816729
1563916730
15640 echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
15641 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
16731 { echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
16732 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
1564216733 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
1564316734 echo $ECHO_N "(cached) $ECHO_C" >&6
1564416735 else
1565516746 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1565616747 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1565716748 -e 's:$: $lt_compiler_flag:'`
15658 (eval echo "\"\$as_me:15659: $lt_compile\"" >&5)
16749 (eval echo "\"\$as_me:16750: $lt_compile\"" >&5)
1565916750 (eval "$lt_compile" 2>conftest.err)
1566016751 ac_status=$?
1566116752 cat conftest.err >&5
15662 echo "$as_me:15663: \$? = $ac_status" >&5
16753 echo "$as_me:16754: \$? = $ac_status" >&5
1566316754 if (exit $ac_status) && test -s "$ac_outfile"; then
1566416755 # The compiler can only warn and ignore the option if not recognized
1566516756 # So say no if there are warnings other than the usual output.
1567216763 $rm conftest*
1567316764
1567416765 fi
15675 echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
15676 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
16766 { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
16767 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
1567716768
1567816769 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
1567916770 lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
1568716778 lt_prog_compiler_pic_GCJ=
1568816779 lt_prog_compiler_static_GCJ=
1568916780
15690 echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
15691 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
16781 { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
16782 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
1569216783
1569316784 if test "$GCC" = yes; then
1569416785 lt_prog_compiler_wl_GCJ='-Wl,'
1589716988 esac
1589816989 fi
1589916990
15900 echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
15901 echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6
16991 { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
16992 echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; }
1590216993
1590316994 #
1590416995 # Check to make sure the PIC flag actually works.
1590516996 #
1590616997 if test -n "$lt_prog_compiler_pic_GCJ"; then
1590716998
15908 echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
15909 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6
16999 { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
17000 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; }
1591017001 if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
1591117002 echo $ECHO_N "(cached) $ECHO_C" >&6
1591217003 else
1592317014 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1592417015 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1592517016 -e 's:$: $lt_compiler_flag:'`
15926 (eval echo "\"\$as_me:15927: $lt_compile\"" >&5)
17017 (eval echo "\"\$as_me:17018: $lt_compile\"" >&5)
1592717018 (eval "$lt_compile" 2>conftest.err)
1592817019 ac_status=$?
1592917020 cat conftest.err >&5
15930 echo "$as_me:15931: \$? = $ac_status" >&5
17021 echo "$as_me:17022: \$? = $ac_status" >&5
1593117022 if (exit $ac_status) && test -s "$ac_outfile"; then
1593217023 # The compiler can only warn and ignore the option if not recognized
1593317024 # So say no if there are warnings other than the usual output.
1594017031 $rm conftest*
1594117032
1594217033 fi
15943 echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
15944 echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6
17034 { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
17035 echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; }
1594517036
1594617037 if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
1594717038 case $lt_prog_compiler_pic_GCJ in
1596817059 # Check to make sure the static flag actually works.
1596917060 #
1597017061 wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\"
15971 echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
15972 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
17062 { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
17063 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
1597317064 if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then
1597417065 echo $ECHO_N "(cached) $ECHO_C" >&6
1597517066 else
1599617087 LDFLAGS="$save_LDFLAGS"
1599717088
1599817089 fi
15999 echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5
16000 echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6
17090 { echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5
17091 echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6; }
1600117092
1600217093 if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then
1600317094 :
1600617097 fi
1600717098
1600817099
16009 echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
16010 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
17100 { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
17101 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
1601117102 if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
1601217103 echo $ECHO_N "(cached) $ECHO_C" >&6
1601317104 else
1602717118 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1602817119 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1602917120 -e 's:$: $lt_compiler_flag:'`
16030 (eval echo "\"\$as_me:16031: $lt_compile\"" >&5)
17121 (eval echo "\"\$as_me:17122: $lt_compile\"" >&5)
1603117122 (eval "$lt_compile" 2>out/conftest.err)
1603217123 ac_status=$?
1603317124 cat out/conftest.err >&5
16034 echo "$as_me:16035: \$? = $ac_status" >&5
17125 echo "$as_me:17126: \$? = $ac_status" >&5
1603517126 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1603617127 then
1603717128 # The compiler can only warn and ignore the option if not recognized
1605317144 $rm conftest*
1605417145
1605517146 fi
16056 echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
16057 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6
17147 { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
17148 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; }
1605817149
1605917150
1606017151 hard_links="nottested"
1606117152 if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
1606217153 # do not overwrite the value of need_locks provided by the user
16063 echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
16064 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
17154 { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
17155 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
1606517156 hard_links=yes
1606617157 $rm conftest*
1606717158 ln conftest.a conftest.b 2>/dev/null && hard_links=no
1606817159 touch conftest.a
1606917160 ln conftest.a conftest.b 2>&5 || hard_links=no
1607017161 ln conftest.a conftest.b 2>/dev/null && hard_links=no
16071 echo "$as_me:$LINENO: result: $hard_links" >&5
16072 echo "${ECHO_T}$hard_links" >&6
17162 { echo "$as_me:$LINENO: result: $hard_links" >&5
17163 echo "${ECHO_T}$hard_links" >&6; }
1607317164 if test "$hard_links" = no; then
1607417165 { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
1607517166 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
1607917170 need_locks=no
1608017171 fi
1608117172
16082 echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
16083 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
17173 { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
17174 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
1608417175
1608517176 runpath_var=
1608617177 allow_undefined_flag_GCJ=
1649517586 }
1649617587 _ACEOF
1649717588 rm -f conftest.$ac_objext conftest$ac_exeext
16498 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
16499 (eval $ac_link) 2>conftest.er1
17589 if { (ac_try="$ac_link"
17590 case "(($ac_try" in
17591 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17592 *) ac_try_echo=$ac_try;;
17593 esac
17594 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
17595 (eval "$ac_link") 2>conftest.er1
1650017596 ac_status=$?
1650117597 grep -v '^ *+' conftest.er1 >conftest.err
1650217598 rm -f conftest.er1
1650317599 cat conftest.err >&5
1650417600 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1650517601 (exit $ac_status); } &&
16506 { ac_try='test -z "$ac_c_werror_flag"
16507 || test ! -s conftest.err'
16508 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
16509 (eval $ac_try) 2>&5
17602 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
17603 { (case "(($ac_try" in
17604 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17605 *) ac_try_echo=$ac_try;;
17606 esac
17607 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
17608 (eval "$ac_try") 2>&5
1651017609 ac_status=$?
1651117610 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1651217611 (exit $ac_status); }; } &&
1651317612 { ac_try='test -s conftest$ac_exeext'
16514 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
16515 (eval $ac_try) 2>&5
17613 { (case "(($ac_try" in
17614 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17615 *) ac_try_echo=$ac_try;;
17616 esac
17617 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
17618 (eval "$ac_try") 2>&5
1651617619 ac_status=$?
1651717620 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1651817621 (exit $ac_status); }; }; then
1652617629 echo "$as_me: failed program was:" >&5
1652717630 sed 's/^/| /' conftest.$ac_ext >&5
1652817631
16529 fi
16530 rm -f conftest.err conftest.$ac_objext \
17632
17633 fi
17634
17635 rm -f core conftest.err conftest.$ac_objext \
1653117636 conftest$ac_exeext conftest.$ac_ext
1653217637 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
1653317638
1655617661 }
1655717662 _ACEOF
1655817663 rm -f conftest.$ac_objext conftest$ac_exeext
16559 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
16560 (eval $ac_link) 2>conftest.er1
17664 if { (ac_try="$ac_link"
17665 case "(($ac_try" in
17666 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17667 *) ac_try_echo=$ac_try;;
17668 esac
17669 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
17670 (eval "$ac_link") 2>conftest.er1
1656117671 ac_status=$?
1656217672 grep -v '^ *+' conftest.er1 >conftest.err
1656317673 rm -f conftest.er1
1656417674 cat conftest.err >&5
1656517675 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1656617676 (exit $ac_status); } &&
16567 { ac_try='test -z "$ac_c_werror_flag"
16568 || test ! -s conftest.err'
16569 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
16570 (eval $ac_try) 2>&5
17677 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
17678 { (case "(($ac_try" in
17679 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17680 *) ac_try_echo=$ac_try;;
17681 esac
17682 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
17683 (eval "$ac_try") 2>&5
1657117684 ac_status=$?
1657217685 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1657317686 (exit $ac_status); }; } &&
1657417687 { ac_try='test -s conftest$ac_exeext'
16575 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
16576 (eval $ac_try) 2>&5
17688 { (case "(($ac_try" in
17689 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17690 *) ac_try_echo=$ac_try;;
17691 esac
17692 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
17693 (eval "$ac_try") 2>&5
1657717694 ac_status=$?
1657817695 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1657917696 (exit $ac_status); }; }; then
1658717704 echo "$as_me: failed program was:" >&5
1658817705 sed 's/^/| /' conftest.$ac_ext >&5
1658917706
16590 fi
16591 rm -f conftest.err conftest.$ac_objext \
17707
17708 fi
17709
17710 rm -f core conftest.err conftest.$ac_objext \
1659217711 conftest$ac_exeext conftest.$ac_ext
1659317712 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
1659417713
1703718156 esac
1703818157 fi
1703918158
17040 echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
17041 echo "${ECHO_T}$ld_shlibs_GCJ" >&6
18159 { echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
18160 echo "${ECHO_T}$ld_shlibs_GCJ" >&6; }
1704218161 test "$ld_shlibs_GCJ" = no && can_build_shared=no
1704318162
1704418163 #
1705818177 # Test whether the compiler implicitly links with -lc since on some
1705918178 # systems, -lgcc has to come before -lc. If gcc already passes -lc
1706018179 # to ld, don't add -lc before -lgcc.
17061 echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
17062 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
18180 { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
18181 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
1706318182 $rm conftest*
1706418183 printf "$lt_simple_compile_test_code" > conftest.$ac_ext
1706518184
1709618215 cat conftest.err 1>&5
1709718216 fi
1709818217 $rm conftest*
17099 echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
17100 echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6
18218 { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
18219 echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; }
1710118220 ;;
1710218221 esac
1710318222 fi
1710418223 ;;
1710518224 esac
1710618225
17107 echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
17108 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
18226 { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
18227 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
1710918228 library_names_spec=
1711018229 libname_spec='lib$name'
1711118230 soname_spec=
1769218811 dynamic_linker=no
1769318812 ;;
1769418813 esac
17695 echo "$as_me:$LINENO: result: $dynamic_linker" >&5
17696 echo "${ECHO_T}$dynamic_linker" >&6
18814 { echo "$as_me:$LINENO: result: $dynamic_linker" >&5
18815 echo "${ECHO_T}$dynamic_linker" >&6; }
1769718816 test "$dynamic_linker" = no && can_build_shared=no
1769818817
1769918818 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
1770118820 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
1770218821 fi
1770318822
17704 echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
17705 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
18823 { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
18824 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
1770618825 hardcode_action_GCJ=
1770718826 if test -n "$hardcode_libdir_flag_spec_GCJ" || \
1770818827 test -n "$runpath_var_GCJ" || \
1772618845 # directories.
1772718846 hardcode_action_GCJ=unsupported
1772818847 fi
17729 echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
17730 echo "${ECHO_T}$hardcode_action_GCJ" >&6
18848 { echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
18849 echo "${ECHO_T}$hardcode_action_GCJ" >&6; }
1773118850
1773218851 if test "$hardcode_action_GCJ" = relink; then
1773318852 # Fast installation is not supported
1816319282 RC)
1816419283
1816519284
18166
1816719285 # Source file extension for RC test sources.
1816819286 ac_ext=rc
1816919287
1869419812
1869519813
1869619814
18697 echo "$as_me:$LINENO: checking whether ln -s works" >&5
18698 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
18699 LN_S=$as_ln_s
18700 if test "$LN_S" = "ln -s"; then
18701 echo "$as_me:$LINENO: result: yes" >&5
18702 echo "${ECHO_T}yes" >&6
18703 else
18704 echo "$as_me:$LINENO: result: no, using $LN_S" >&5
18705 echo "${ECHO_T}no, using $LN_S" >&6
18706 fi
18707
18708 # Check whether --enable-glibtest or --disable-glibtest was given.
19815 # Check whether --enable-glibtest was given.
1870919816 if test "${enable_glibtest+set}" = set; then
18710 enableval="$enable_glibtest"
18711
19817 enableval=$enable_glibtest;
1871219818 else
1871319819 enable_glibtest=yes
18714 fi;
19820 fi
19821
1871519822
1871619823 pkg_config_args=glib-2.0
1871719824 for module in .
1873419841
1873519842 # Extract the first word of "pkg-config", so it can be a program name with args.
1873619843 set dummy pkg-config; ac_word=$2
18737 echo "$as_me:$LINENO: checking for $ac_word" >&5
18738 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
19844 { echo "$as_me:$LINENO: checking for $ac_word" >&5
19845 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
1873919846 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
1874019847 echo $ECHO_N "(cached) $ECHO_C" >&6
1874119848 else
1875019857 IFS=$as_save_IFS
1875119858 test -z "$as_dir" && as_dir=.
1875219859 for ac_exec_ext in '' $ac_executable_extensions; do
18753 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
19860 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
1875419861 ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
1875519862 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
1875619863 break 2
1875719864 fi
1875819865 done
1875919866 done
19867 IFS=$as_save_IFS
1876019868
1876119869 test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
1876219870 ;;
1876319871 esac
1876419872 fi
1876519873 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
18766
1876719874 if test -n "$PKG_CONFIG"; then
18768 echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
18769 echo "${ECHO_T}$PKG_CONFIG" >&6
18770 else
18771 echo "$as_me:$LINENO: result: no" >&5
18772 echo "${ECHO_T}no" >&6
18773 fi
19875 { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
19876 echo "${ECHO_T}$PKG_CONFIG" >&6; }
19877 else
19878 { echo "$as_me:$LINENO: result: no" >&5
19879 echo "${ECHO_T}no" >&6; }
19880 fi
19881
1877419882
1877519883
1877619884 no_glib=""
1878819896 fi
1878919897
1879019898 min_glib_version=2.0.0
18791 echo "$as_me:$LINENO: checking for GLIB - version >= $min_glib_version" >&5
18792 echo $ECHO_N "checking for GLIB - version >= $min_glib_version... $ECHO_C" >&6
19899 { echo "$as_me:$LINENO: checking for GLIB - version >= $min_glib_version" >&5
19900 echo $ECHO_N "checking for GLIB - version >= $min_glib_version... $ECHO_C" >&6; }
1879319901
1879419902 if test x$PKG_CONFIG != xno ; then
1879519903 ## don't try to run the test against uninstalled libtool libs
1890720015
1890820016 _ACEOF
1890920017 rm -f conftest$ac_exeext
18910 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
18911 (eval $ac_link) 2>&5
20018 if { (ac_try="$ac_link"
20019 case "(($ac_try" in
20020 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20021 *) ac_try_echo=$ac_try;;
20022 esac
20023 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20024 (eval "$ac_link") 2>&5
1891220025 ac_status=$?
1891320026 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1891420027 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
18915 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
18916 (eval $ac_try) 2>&5
20028 { (case "(($ac_try" in
20029 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20030 *) ac_try_echo=$ac_try;;
20031 esac
20032 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20033 (eval "$ac_try") 2>&5
1891720034 ac_status=$?
1891820035 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1891920036 (exit $ac_status); }; }; then
1892620043 ( exit $ac_status )
1892720044 no_glib=yes
1892820045 fi
18929 rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
18930 fi
20046 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
20047 fi
20048
20049
1893120050 CFLAGS="$ac_save_CFLAGS"
1893220051 LIBS="$ac_save_LIBS"
1893320052 fi
1893420053 fi
1893520054 if test "x$no_glib" = x ; then
18936 echo "$as_me:$LINENO: result: yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&5
18937 echo "${ECHO_T}yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&6
20055 { echo "$as_me:$LINENO: result: yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&5
20056 echo "${ECHO_T}yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&6; }
1893820057 :
1893920058 else
18940 echo "$as_me:$LINENO: result: no" >&5
18941 echo "${ECHO_T}no" >&6
20059 { echo "$as_me:$LINENO: result: no" >&5
20060 echo "${ECHO_T}no" >&6; }
1894220061 if test "$PKG_CONFIG" = "no" ; then
1894320062 echo "*** A new enough version of pkg-config was not found."
1894420063 echo "*** See http://www.freedesktop.org/software/pkgconfig/"
1897020089 }
1897120090 _ACEOF
1897220091 rm -f conftest.$ac_objext conftest$ac_exeext
18973 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
18974 (eval $ac_link) 2>conftest.er1
20092 if { (ac_try="$ac_link"
20093 case "(($ac_try" in
20094 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20095 *) ac_try_echo=$ac_try;;
20096 esac
20097 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20098 (eval "$ac_link") 2>conftest.er1
1897520099 ac_status=$?
1897620100 grep -v '^ *+' conftest.er1 >conftest.err
1897720101 rm -f conftest.er1
1897820102 cat conftest.err >&5
1897920103 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1898020104 (exit $ac_status); } &&
18981 { ac_try='test -z "$ac_c_werror_flag"
18982 || test ! -s conftest.err'
18983 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
18984 (eval $ac_try) 2>&5
20105 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
20106 { (case "(($ac_try" in
20107 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20108 *) ac_try_echo=$ac_try;;
20109 esac
20110 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20111 (eval "$ac_try") 2>&5
1898520112 ac_status=$?
1898620113 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1898720114 (exit $ac_status); }; } &&
1898820115 { ac_try='test -s conftest$ac_exeext'
18989 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
18990 (eval $ac_try) 2>&5
20116 { (case "(($ac_try" in
20117 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20118 *) ac_try_echo=$ac_try;;
20119 esac
20120 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20121 (eval "$ac_try") 2>&5
1899120122 ac_status=$?
1899220123 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1899320124 (exit $ac_status); }; }; then
1900420135 echo "$as_me: failed program was:" >&5
1900520136 sed 's/^/| /' conftest.$ac_ext >&5
1900620137
19007 echo "*** The test program failed to compile or link. See the file config.log for the"
20138 echo "*** The test program failed to compile or link. See the file config.log for the"
1900820139 echo "*** exact error that occured. This usually means GLIB is incorrectly installed."
1900920140 fi
19010 rm -f conftest.err conftest.$ac_objext \
20141
20142 rm -f core conftest.err conftest.$ac_objext \
1901120143 conftest$ac_exeext conftest.$ac_ext
1901220144 CFLAGS="$ac_save_CFLAGS"
1901320145 LIBS="$ac_save_LIBS"
1903120163
1903220164
1903320165
19034
19035 if test "$FLYN"; then
19036 FLYN_TRUE=
19037 FLYN_FALSE='#'
19038 else
19039 FLYN_TRUE='#'
19040 FLYN_FALSE=
19041 fi
19042
19043
19044
19045 echo "$as_me:$LINENO: checking for EVP_DecryptInit_ex in -lcrypto" >&5
19046 echo $ECHO_N "checking for EVP_DecryptInit_ex in -lcrypto... $ECHO_C" >&6
20166 # Check whether --with-xml-prefix was given.
20167 if test "${with_xml_prefix+set}" = set; then
20168 withval=$with_xml_prefix; xml_config_prefix="$withval"
20169 else
20170 xml_config_prefix=""
20171 fi
20172
20173
20174 # Check whether --with-xml-exec-prefix was given.
20175 if test "${with_xml_exec_prefix+set}" = set; then
20176 withval=$with_xml_exec_prefix; xml_config_exec_prefix="$withval"
20177 else
20178 xml_config_exec_prefix=""
20179 fi
20180
20181 # Check whether --enable-xmltest was given.
20182 if test "${enable_xmltest+set}" = set; then
20183 enableval=$enable_xmltest;
20184 else
20185 enable_xmltest=yes
20186 fi
20187
20188
20189 if test x$xml_config_exec_prefix != x ; then
20190 xml_config_args="$xml_config_args"
20191 if test x${XML2_CONFIG+set} != xset ; then
20192 XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config
20193 fi
20194 fi
20195 if test x$xml_config_prefix != x ; then
20196 xml_config_args="$xml_config_args --prefix=$xml_config_prefix"
20197 if test x${XML2_CONFIG+set} != xset ; then
20198 XML2_CONFIG=$xml_config_prefix/bin/xml2-config
20199 fi
20200 fi
20201
20202 # Extract the first word of "xml2-config", so it can be a program name with args.
20203 set dummy xml2-config; ac_word=$2
20204 { echo "$as_me:$LINENO: checking for $ac_word" >&5
20205 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
20206 if test "${ac_cv_path_XML2_CONFIG+set}" = set; then
20207 echo $ECHO_N "(cached) $ECHO_C" >&6
20208 else
20209 case $XML2_CONFIG in
20210 [\\/]* | ?:[\\/]*)
20211 ac_cv_path_XML2_CONFIG="$XML2_CONFIG" # Let the user override the test with a path.
20212 ;;
20213 *)
20214 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
20215 for as_dir in $PATH
20216 do
20217 IFS=$as_save_IFS
20218 test -z "$as_dir" && as_dir=.
20219 for ac_exec_ext in '' $ac_executable_extensions; do
20220 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
20221 ac_cv_path_XML2_CONFIG="$as_dir/$ac_word$ac_exec_ext"
20222 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
20223 break 2
20224 fi
20225 done
20226 done
20227 IFS=$as_save_IFS
20228
20229 test -z "$ac_cv_path_XML2_CONFIG" && ac_cv_path_XML2_CONFIG="no"
20230 ;;
20231 esac
20232 fi
20233 XML2_CONFIG=$ac_cv_path_XML2_CONFIG
20234 if test -n "$XML2_CONFIG"; then
20235 { echo "$as_me:$LINENO: result: $XML2_CONFIG" >&5
20236 echo "${ECHO_T}$XML2_CONFIG" >&6; }
20237 else
20238 { echo "$as_me:$LINENO: result: no" >&5
20239 echo "${ECHO_T}no" >&6; }
20240 fi
20241
20242
20243 min_xml_version=2.0.0
20244 { echo "$as_me:$LINENO: checking for libxml - version >= $min_xml_version" >&5
20245 echo $ECHO_N "checking for libxml - version >= $min_xml_version... $ECHO_C" >&6; }
20246 no_xml=""
20247 if test "$XML2_CONFIG" = "no" ; then
20248 no_xml=yes
20249 else
20250 XML_CPPFLAGS=`$XML2_CONFIG $xml_config_args --cflags`
20251 XML_LIBS=`$XML2_CONFIG $xml_config_args --libs`
20252 xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \
20253 sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
20254 xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \
20255 sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
20256 xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \
20257 sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
20258 if test "x$enable_xmltest" = "xyes" ; then
20259 ac_save_CPPFLAGS="$CPPFLAGS"
20260 ac_save_LIBS="$LIBS"
20261 CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
20262 LIBS="$XML_LIBS $LIBS"
20263 rm -f conf.xmltest
20264 if test "$cross_compiling" = yes; then
20265 echo $ac_n "cross compiling; assumed OK... $ac_c"
20266 else
20267 cat >conftest.$ac_ext <<_ACEOF
20268 /* confdefs.h. */
20269 _ACEOF
20270 cat confdefs.h >>conftest.$ac_ext
20271 cat >>conftest.$ac_ext <<_ACEOF
20272 /* end confdefs.h. */
20273
20274 #include <stdlib.h>
20275 #include <stdio.h>
20276 #include <string.h>
20277 #include <libxml/xmlversion.h>
20278
20279 int
20280 main()
20281 {
20282 int xml_major_version, xml_minor_version, xml_micro_version;
20283 int major, minor, micro;
20284 char *tmp_version;
20285
20286 system("touch conf.xmltest");
20287
20288 /* Capture xml2-config output via autoconf/configure variables */
20289 /* HP/UX 9 (%@#!) writes to sscanf strings */
20290 tmp_version = (char *)strdup("$min_xml_version");
20291 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
20292 printf("%s, bad version string from xml2-config\n", "$min_xml_version");
20293 exit(1);
20294 }
20295 free(tmp_version);
20296
20297 /* Capture the version information from the header files */
20298 tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION);
20299 if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) {
20300 printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION");
20301 exit(1);
20302 }
20303 free(tmp_version);
20304
20305 /* Compare xml2-config output to the libxml headers */
20306 if ((xml_major_version != $xml_config_major_version) ||
20307 (xml_minor_version != $xml_config_minor_version) ||
20308 (xml_micro_version != $xml_config_micro_version))
20309 {
20310 printf("*** libxml header files (version %d.%d.%d) do not match\n",
20311 xml_major_version, xml_minor_version, xml_micro_version);
20312 printf("*** xml2-config (version %d.%d.%d)\n",
20313 $xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version);
20314 return 1;
20315 }
20316 /* Compare the headers to the library to make sure we match */
20317 /* Less than ideal -- doesn't provide us with return value feedback,
20318 * only exits if there's a serious mismatch between header and library.
20319 */
20320 LIBXML_TEST_VERSION;
20321
20322 /* Test that the library is greater than our minimum version */
20323 if ((xml_major_version > major) ||
20324 ((xml_major_version == major) && (xml_minor_version > minor)) ||
20325 ((xml_major_version == major) && (xml_minor_version == minor) &&
20326 (xml_micro_version >= micro)))
20327 {
20328 return 0;
20329 }
20330 else
20331 {
20332 printf("\n*** An old version of libxml (%d.%d.%d) was found.\n",
20333 xml_major_version, xml_minor_version, xml_micro_version);
20334 printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n",
20335 major, minor, micro);
20336 printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n");
20337 printf("***\n");
20338 printf("*** If you have already installed a sufficiently new version, this error\n");
20339 printf("*** probably means that the wrong copy of the xml2-config shell script is\n");
20340 printf("*** being found. The easiest way to fix this is to remove the old version\n");
20341 printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n");
20342 printf("*** correct copy of xml2-config. (In this case, you will have to\n");
20343 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
20344 printf("*** so that the correct libraries are found at run-time))\n");
20345 }
20346 return 1;
20347 }
20348
20349 _ACEOF
20350 rm -f conftest$ac_exeext
20351 if { (ac_try="$ac_link"
20352 case "(($ac_try" in
20353 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20354 *) ac_try_echo=$ac_try;;
20355 esac
20356 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20357 (eval "$ac_link") 2>&5
20358 ac_status=$?
20359 echo "$as_me:$LINENO: \$? = $ac_status" >&5
20360 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
20361 { (case "(($ac_try" in
20362 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20363 *) ac_try_echo=$ac_try;;
20364 esac
20365 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20366 (eval "$ac_try") 2>&5
20367 ac_status=$?
20368 echo "$as_me:$LINENO: \$? = $ac_status" >&5
20369 (exit $ac_status); }; }; then
20370 :
20371 else
20372 echo "$as_me: program exited with status $ac_status" >&5
20373 echo "$as_me: failed program was:" >&5
20374 sed 's/^/| /' conftest.$ac_ext >&5
20375
20376 ( exit $ac_status )
20377 no_xml=yes
20378 fi
20379 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
20380 fi
20381
20382
20383 CPPFLAGS="$ac_save_CPPFLAGS"
20384 LIBS="$ac_save_LIBS"
20385 fi
20386 fi
20387
20388 if test "x$no_xml" = x ; then
20389 { echo "$as_me:$LINENO: result: yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version)" >&5
20390 echo "${ECHO_T}yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version)" >&6; }
20391 :
20392 else
20393 { echo "$as_me:$LINENO: result: no" >&5
20394 echo "${ECHO_T}no" >&6; }
20395 if test "$XML2_CONFIG" = "no" ; then
20396 echo "*** The xml2-config script installed by LIBXML could not be found"
20397 echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in"
20398 echo "*** your path, or set the XML2_CONFIG environment variable to the"
20399 echo "*** full path to xml2-config."
20400 else
20401 if test -f conf.xmltest ; then
20402 :
20403 else
20404 echo "*** Could not run libxml test program, checking why..."
20405 CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
20406 LIBS="$LIBS $XML_LIBS"
20407 cat >conftest.$ac_ext <<_ACEOF
20408 /* confdefs.h. */
20409 _ACEOF
20410 cat confdefs.h >>conftest.$ac_ext
20411 cat >>conftest.$ac_ext <<_ACEOF
20412 /* end confdefs.h. */
20413
20414 #include <libxml/xmlversion.h>
20415 #include <stdio.h>
20416
20417 int
20418 main ()
20419 {
20420 LIBXML_TEST_VERSION; return 0;
20421 ;
20422 return 0;
20423 }
20424 _ACEOF
20425 rm -f conftest.$ac_objext conftest$ac_exeext
20426 if { (ac_try="$ac_link"
20427 case "(($ac_try" in
20428 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20429 *) ac_try_echo=$ac_try;;
20430 esac
20431 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20432 (eval "$ac_link") 2>conftest.er1
20433 ac_status=$?
20434 grep -v '^ *+' conftest.er1 >conftest.err
20435 rm -f conftest.er1
20436 cat conftest.err >&5
20437 echo "$as_me:$LINENO: \$? = $ac_status" >&5
20438 (exit $ac_status); } &&
20439 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
20440 { (case "(($ac_try" in
20441 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20442 *) ac_try_echo=$ac_try;;
20443 esac
20444 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20445 (eval "$ac_try") 2>&5
20446 ac_status=$?
20447 echo "$as_me:$LINENO: \$? = $ac_status" >&5
20448 (exit $ac_status); }; } &&
20449 { ac_try='test -s conftest$ac_exeext'
20450 { (case "(($ac_try" in
20451 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20452 *) ac_try_echo=$ac_try;;
20453 esac
20454 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20455 (eval "$ac_try") 2>&5
20456 ac_status=$?
20457 echo "$as_me:$LINENO: \$? = $ac_status" >&5
20458 (exit $ac_status); }; }; then
20459 echo "*** The test program compiled, but did not run. This usually means"
20460 echo "*** that the run-time linker is not finding LIBXML or finding the wrong"
20461 echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your"
20462 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
20463 echo "*** to the installed location Also, make sure you have run ldconfig if that"
20464 echo "*** is required on your system"
20465 echo "***"
20466 echo "*** If you have an old version installed, it is best to remove it, although"
20467 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
20468 else
20469 echo "$as_me: failed program was:" >&5
20470 sed 's/^/| /' conftest.$ac_ext >&5
20471
20472 echo "*** The test program failed to compile or link. See the file config.log for the"
20473 echo "*** exact error that occured. This usually means LIBXML was incorrectly installed"
20474 echo "*** or that you have moved LIBXML since it was installed. In the latter case, you"
20475 echo "*** may want to edit the xml2-config script: $XML2_CONFIG"
20476 fi
20477
20478 rm -f core conftest.err conftest.$ac_objext \
20479 conftest$ac_exeext conftest.$ac_ext
20480 CPPFLAGS="$ac_save_CPPFLAGS"
20481 LIBS="$ac_save_LIBS"
20482 fi
20483 fi
20484
20485 XML_CPPFLAGS=""
20486 XML_LIBS=""
20487 { { echo "$as_me:$LINENO: error: You are missing libxml2" >&5
20488 echo "$as_me: error: You are missing libxml2" >&2;}
20489 { (exit 1); exit 1; }; }
20490 fi
20491
20492
20493 rm -f conf.xmltest
20494
20495
20496
20497 # Check whether --with-slibdir was given.
20498 if test "${with_slibdir+set}" = set; then
20499 withval=$with_slibdir; slibdir="$withval"
20500 else
20501 slibdir="/lib"
20502 fi
20503
20504
20505
20506 # Check whether --with-ssbindir was given.
20507 if test "${with_ssbindir+set}" = set; then
20508 withval=$with_ssbindir; ssbindir="$withval"
20509 else
20510 ssbindir="/sbin"
20511 fi
20512
20513
20514
20515
20516 # GCC 4.x -fvisibility=hidden
20517
20518
20519 ac_ext=c
20520 ac_cpp='$CPP $CPPFLAGS'
20521 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
20522 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
20523 ac_compiler_gnu=$ac_cv_c_compiler_gnu
20524
20525 saved_CFLAGS="$CFLAGS"
20526 CFLAGS="$saved_CFLAGS -fvisibility=hidden"
20527 { echo "$as_me:$LINENO: checking whether compiler accepts -fvisibility=hidden" >&5
20528 echo $ECHO_N "checking whether compiler accepts -fvisibility=hidden... $ECHO_C" >&6; }
20529 if test "${cv_fvisibility_hidden+set}" = set; then
20530 echo $ECHO_N "(cached) $ECHO_C" >&6
20531 else
20532 cat >conftest.$ac_ext <<_ACEOF
20533 /* confdefs.h. */
20534 _ACEOF
20535 cat confdefs.h >>conftest.$ac_ext
20536 cat >>conftest.$ac_ext <<_ACEOF
20537 /* end confdefs.h. */
20538
20539 int
20540 main ()
20541 {
20542
20543 ;
20544 return 0;
20545 }
20546 _ACEOF
20547 rm -f conftest.$ac_objext
20548 if { (ac_try="$ac_compile"
20549 case "(($ac_try" in
20550 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20551 *) ac_try_echo=$ac_try;;
20552 esac
20553 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20554 (eval "$ac_compile") 2>conftest.er1
20555 ac_status=$?
20556 grep -v '^ *+' conftest.er1 >conftest.err
20557 rm -f conftest.er1
20558 cat conftest.err >&5
20559 echo "$as_me:$LINENO: \$? = $ac_status" >&5
20560 (exit $ac_status); } &&
20561 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
20562 { (case "(($ac_try" in
20563 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20564 *) ac_try_echo=$ac_try;;
20565 esac
20566 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20567 (eval "$ac_try") 2>&5
20568 ac_status=$?
20569 echo "$as_me:$LINENO: \$? = $ac_status" >&5
20570 (exit $ac_status); }; } &&
20571 { ac_try='test -s conftest.$ac_objext'
20572 { (case "(($ac_try" in
20573 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20574 *) ac_try_echo=$ac_try;;
20575 esac
20576 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20577 (eval "$ac_try") 2>&5
20578 ac_status=$?
20579 echo "$as_me:$LINENO: \$? = $ac_status" >&5
20580 (exit $ac_status); }; }; then
20581 cv_fvisibility_hidden=yes
20582 else
20583 echo "$as_me: failed program was:" >&5
20584 sed 's/^/| /' conftest.$ac_ext >&5
20585
20586 cv_fvisibility_hidden=no
20587
20588 fi
20589
20590 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20591 fi
20592 { echo "$as_me:$LINENO: result: $cv_fvisibility_hidden" >&5
20593 echo "${ECHO_T}$cv_fvisibility_hidden" >&6; }
20594 if test "$cv_fvisibility_hidden" = "yes"; then
20595
20596 cat >>confdefs.h <<\_ACEOF
20597 #define HAVE_VISIBILITY_HIDDEN 1
20598 _ACEOF
20599
20600 GCC_FVISIBILITY_HIDDEN=-fvisibility=hidden
20601
20602 fi
20603 CFLAGS="$saved_CFLAGS"
20604 ac_ext=c
20605 ac_cpp='$CPP $CPPFLAGS'
20606 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
20607 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
20608 ac_compiler_gnu=$ac_cv_c_compiler_gnu
20609
20610
20611
20612
20613 { echo "$as_me:$LINENO: checking for EVP_DecryptInit_ex in -lcrypto" >&5
20614 echo $ECHO_N "checking for EVP_DecryptInit_ex in -lcrypto... $ECHO_C" >&6; }
1904720615 if test "${ac_cv_lib_crypto_EVP_DecryptInit_ex+set}" = set; then
1904820616 echo $ECHO_N "(cached) $ECHO_C" >&6
1904920617 else
1905620624 cat >>conftest.$ac_ext <<_ACEOF
1905720625 /* end confdefs.h. */
1905820626
19059 /* Override any gcc2 internal prototype to avoid an error. */
20627 /* Override any GCC internal prototype to avoid an error.
20628 Use char because int might match the return type of a GCC
20629 builtin and then its argument prototype would still apply. */
1906020630 #ifdef __cplusplus
1906120631 extern "C"
1906220632 #endif
19063 /* We use char because int might match the return type of a gcc2
19064 builtin and then its argument prototype would still apply. */
1906520633 char EVP_DecryptInit_ex ();
1906620634 int
1906720635 main ()
1906820636 {
19069 EVP_DecryptInit_ex ();
20637 return EVP_DecryptInit_ex ();
1907020638 ;
1907120639 return 0;
1907220640 }
1907320641 _ACEOF
1907420642 rm -f conftest.$ac_objext conftest$ac_exeext
19075 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
19076 (eval $ac_link) 2>conftest.er1
20643 if { (ac_try="$ac_link"
20644 case "(($ac_try" in
20645 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20646 *) ac_try_echo=$ac_try;;
20647 esac
20648 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20649 (eval "$ac_link") 2>conftest.er1
1907720650 ac_status=$?
1907820651 grep -v '^ *+' conftest.er1 >conftest.err
1907920652 rm -f conftest.er1
1908020653 cat conftest.err >&5
1908120654 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1908220655 (exit $ac_status); } &&
19083 { ac_try='test -z "$ac_c_werror_flag"
19084 || test ! -s conftest.err'
19085 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
19086 (eval $ac_try) 2>&5
20656 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
20657 { (case "(($ac_try" in
20658 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20659 *) ac_try_echo=$ac_try;;
20660 esac
20661 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20662 (eval "$ac_try") 2>&5
1908720663 ac_status=$?
1908820664 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1908920665 (exit $ac_status); }; } &&
1909020666 { ac_try='test -s conftest$ac_exeext'
19091 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
19092 (eval $ac_try) 2>&5
20667 { (case "(($ac_try" in
20668 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20669 *) ac_try_echo=$ac_try;;
20670 esac
20671 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20672 (eval "$ac_try") 2>&5
1909320673 ac_status=$?
1909420674 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1909520675 (exit $ac_status); }; }; then
1909820678 echo "$as_me: failed program was:" >&5
1909920679 sed 's/^/| /' conftest.$ac_ext >&5
1910020680
19101 ac_cv_lib_crypto_EVP_DecryptInit_ex=no
19102 fi
19103 rm -f conftest.err conftest.$ac_objext \
20681 ac_cv_lib_crypto_EVP_DecryptInit_ex=no
20682 fi
20683
20684 rm -f core conftest.err conftest.$ac_objext \
1910420685 conftest$ac_exeext conftest.$ac_ext
1910520686 LIBS=$ac_check_lib_save_LIBS
1910620687 fi
19107 echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_EVP_DecryptInit_ex" >&5
19108 echo "${ECHO_T}$ac_cv_lib_crypto_EVP_DecryptInit_ex" >&6
20688 { echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_EVP_DecryptInit_ex" >&5
20689 echo "${ECHO_T}$ac_cv_lib_crypto_EVP_DecryptInit_ex" >&6; }
1910920690 if test $ac_cv_lib_crypto_EVP_DecryptInit_ex = yes; then
1911020691 cat >>confdefs.h <<_ACEOF
1911120692 #define HAVE_LIBCRYPTO 1
1911620697 fi
1911720698 # RH 8.0's OpenSSL does not have?
1911820699
19119 echo "$as_me:$LINENO: checking for SSL_load_error_strings in -lssl" >&5
19120 echo $ECHO_N "checking for SSL_load_error_strings in -lssl... $ECHO_C" >&6
20700 { echo "$as_me:$LINENO: checking for SSL_load_error_strings in -lssl" >&5
20701 echo $ECHO_N "checking for SSL_load_error_strings in -lssl... $ECHO_C" >&6; }
1912120702 if test "${ac_cv_lib_ssl_SSL_load_error_strings+set}" = set; then
1912220703 echo $ECHO_N "(cached) $ECHO_C" >&6
1912320704 else
1913020711 cat >>conftest.$ac_ext <<_ACEOF
1913120712 /* end confdefs.h. */
1913220713
19133 /* Override any gcc2 internal prototype to avoid an error. */
20714 /* Override any GCC internal prototype to avoid an error.
20715 Use char because int might match the return type of a GCC
20716 builtin and then its argument prototype would still apply. */
1913420717 #ifdef __cplusplus
1913520718 extern "C"
1913620719 #endif
19137 /* We use char because int might match the return type of a gcc2
19138 builtin and then its argument prototype would still apply. */
1913920720 char SSL_load_error_strings ();
1914020721 int
1914120722 main ()
1914220723 {
19143 SSL_load_error_strings ();
20724 return SSL_load_error_strings ();
1914420725 ;
1914520726 return 0;
1914620727 }
1914720728 _ACEOF
1914820729 rm -f conftest.$ac_objext conftest$ac_exeext
19149 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
19150 (eval $ac_link) 2>conftest.er1
20730 if { (ac_try="$ac_link"
20731 case "(($ac_try" in
20732 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20733 *) ac_try_echo=$ac_try;;
20734 esac
20735 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20736 (eval "$ac_link") 2>conftest.er1
1915120737 ac_status=$?
1915220738 grep -v '^ *+' conftest.er1 >conftest.err
1915320739 rm -f conftest.er1
1915420740 cat conftest.err >&5
1915520741 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1915620742 (exit $ac_status); } &&
19157 { ac_try='test -z "$ac_c_werror_flag"
19158 || test ! -s conftest.err'
19159 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
19160 (eval $ac_try) 2>&5
20743 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
20744 { (case "(($ac_try" in
20745 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20746 *) ac_try_echo=$ac_try;;
20747 esac
20748 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20749 (eval "$ac_try") 2>&5
1916120750 ac_status=$?
1916220751 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1916320752 (exit $ac_status); }; } &&
1916420753 { ac_try='test -s conftest$ac_exeext'
19165 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
19166 (eval $ac_try) 2>&5
20754 { (case "(($ac_try" in
20755 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20756 *) ac_try_echo=$ac_try;;
20757 esac
20758 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20759 (eval "$ac_try") 2>&5
1916720760 ac_status=$?
1916820761 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1916920762 (exit $ac_status); }; }; then
1917220765 echo "$as_me: failed program was:" >&5
1917320766 sed 's/^/| /' conftest.$ac_ext >&5
1917420767
19175 ac_cv_lib_ssl_SSL_load_error_strings=no
19176 fi
19177 rm -f conftest.err conftest.$ac_objext \
20768 ac_cv_lib_ssl_SSL_load_error_strings=no
20769 fi
20770
20771 rm -f core conftest.err conftest.$ac_objext \
1917820772 conftest$ac_exeext conftest.$ac_ext
1917920773 LIBS=$ac_check_lib_save_LIBS
1918020774 fi
19181 echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SSL_load_error_strings" >&5
19182 echo "${ECHO_T}$ac_cv_lib_ssl_SSL_load_error_strings" >&6
20775 { echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SSL_load_error_strings" >&5
20776 echo "${ECHO_T}$ac_cv_lib_ssl_SSL_load_error_strings" >&6; }
1918320777 if test $ac_cv_lib_ssl_SSL_load_error_strings = yes; then
1918420778 cat >>confdefs.h <<_ACEOF
1918520779 #define HAVE_LIBSSL 1
1919020784 fi
1919120785
1919220786
19193 for ac_func in setfsuid
19194 do
19195 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
19196 echo "$as_me:$LINENO: checking for $ac_func" >&5
19197 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
19198 if eval "test \"\${$as_ac_var+set}\" = set"; then
20787 regular_CFLAGS="-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 \
20788 -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations \
20789 -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \
20790 -Winline -pipe"
20791
20792
20793 { echo "$as_me:$LINENO: checking for struct loop_info64.lo_file_name" >&5
20794 echo $ECHO_N "checking for struct loop_info64.lo_file_name... $ECHO_C" >&6; }
20795 if test "${ac_cv_member_struct_loop_info64_lo_file_name+set}" = set; then
1919920796 echo $ECHO_N "(cached) $ECHO_C" >&6
1920020797 else
1920120798 cat >conftest.$ac_ext <<_ACEOF
1920420801 cat confdefs.h >>conftest.$ac_ext
1920520802 cat >>conftest.$ac_ext <<_ACEOF
1920620803 /* end confdefs.h. */
19207 /* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
19208 For example, HP-UX 11i <limits.h> declares gettimeofday. */
19209 #define $ac_func innocuous_$ac_func
19210
19211 /* System header to define __stub macros and hopefully few prototypes,
19212 which can conflict with char $ac_func (); below.
19213 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
19214 <limits.h> exists even on freestanding compilers. */
19215
19216 #ifdef __STDC__
19217 # include <limits.h>
19218 #else
19219 # include <assert.h>
19220 #endif
19221
19222 #undef $ac_func
19223
19224 /* Override any gcc2 internal prototype to avoid an error. */
19225 #ifdef __cplusplus
19226 extern "C"
19227 {
19228 #endif
19229 /* We use char because int might match the return type of a gcc2
19230 builtin and then its argument prototype would still apply. */
19231 char $ac_func ();
19232 /* The GNU C library defines this for functions which it implements
19233 to always fail with ENOSYS. Some functions are actually named
19234 something starting with __ and the normal name is an alias. */
19235 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
19236 choke me
19237 #else
19238 char (*f) () = $ac_func;
19239 #endif
19240 #ifdef __cplusplus
19241 }
19242 #endif
20804 #include <linux/loop.h>
1924320805
1924420806 int
1924520807 main ()
1924620808 {
19247 return f != $ac_func;
20809 static struct loop_info64 ac_aggr;
20810 if (ac_aggr.lo_file_name)
20811 return 0;
1924820812 ;
1924920813 return 0;
1925020814 }
1925120815 _ACEOF
19252 rm -f conftest.$ac_objext conftest$ac_exeext
19253 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
19254 (eval $ac_link) 2>conftest.er1
20816 rm -f conftest.$ac_objext
20817 if { (ac_try="$ac_compile"
20818 case "(($ac_try" in
20819 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20820 *) ac_try_echo=$ac_try;;
20821 esac
20822 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20823 (eval "$ac_compile") 2>conftest.er1
1925520824 ac_status=$?
1925620825 grep -v '^ *+' conftest.er1 >conftest.err
1925720826 rm -f conftest.er1
1925820827 cat conftest.err >&5
1925920828 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1926020829 (exit $ac_status); } &&
19261 { ac_try='test -z "$ac_c_werror_flag"
19262 || test ! -s conftest.err'
19263 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
19264 (eval $ac_try) 2>&5
20830 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
20831 { (case "(($ac_try" in
20832 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20833 *) ac_try_echo=$ac_try;;
20834 esac
20835 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20836 (eval "$ac_try") 2>&5
1926520837 ac_status=$?
1926620838 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1926720839 (exit $ac_status); }; } &&
19268 { ac_try='test -s conftest$ac_exeext'
19269 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
19270 (eval $ac_try) 2>&5
20840 { ac_try='test -s conftest.$ac_objext'
20841 { (case "(($ac_try" in
20842 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20843 *) ac_try_echo=$ac_try;;
20844 esac
20845 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20846 (eval "$ac_try") 2>&5
1927120847 ac_status=$?
1927220848 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1927320849 (exit $ac_status); }; }; then
19274 eval "$as_ac_var=yes"
20850 ac_cv_member_struct_loop_info64_lo_file_name=yes
1927520851 else
1927620852 echo "$as_me: failed program was:" >&5
1927720853 sed 's/^/| /' conftest.$ac_ext >&5
1927820854
19279 eval "$as_ac_var=no"
19280 fi
19281 rm -f conftest.err conftest.$ac_objext \
19282 conftest$ac_exeext conftest.$ac_ext
19283 fi
19284 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
19285 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
19286 if test `eval echo '${'$as_ac_var'}'` = yes; then
19287 cat >>confdefs.h <<_ACEOF
19288 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
20855 cat >conftest.$ac_ext <<_ACEOF
20856 /* confdefs.h. */
1928920857 _ACEOF
19290
19291 fi
19292 done
20858 cat confdefs.h >>conftest.$ac_ext
20859 cat >>conftest.$ac_ext <<_ACEOF
20860 /* end confdefs.h. */
20861 #include <linux/loop.h>
20862
20863 int
20864 main ()
20865 {
20866 static struct loop_info64 ac_aggr;
20867 if (sizeof ac_aggr.lo_file_name)
20868 return 0;
20869 ;
20870 return 0;
20871 }
20872 _ACEOF
20873 rm -f conftest.$ac_objext
20874 if { (ac_try="$ac_compile"
20875 case "(($ac_try" in
20876 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20877 *) ac_try_echo=$ac_try;;
20878 esac
20879 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20880 (eval "$ac_compile") 2>conftest.er1
20881 ac_status=$?
20882 grep -v '^ *+' conftest.er1 >conftest.err
20883 rm -f conftest.er1
20884 cat conftest.err >&5
20885 echo "$as_me:$LINENO: \$? = $ac_status" >&5
20886 (exit $ac_status); } &&
20887 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
20888 { (case "(($ac_try" in
20889 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20890 *) ac_try_echo=$ac_try;;
20891 esac
20892 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20893 (eval "$ac_try") 2>&5
20894 ac_status=$?
20895 echo "$as_me:$LINENO: \$? = $ac_status" >&5
20896 (exit $ac_status); }; } &&
20897 { ac_try='test -s conftest.$ac_objext'
20898 { (case "(($ac_try" in
20899 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20900 *) ac_try_echo=$ac_try;;
20901 esac
20902 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20903 (eval "$ac_try") 2>&5
20904 ac_status=$?
20905 echo "$as_me:$LINENO: \$? = $ac_status" >&5
20906 (exit $ac_status); }; }; then
20907 ac_cv_member_struct_loop_info64_lo_file_name=yes
20908 else
20909 echo "$as_me: failed program was:" >&5
20910 sed 's/^/| /' conftest.$ac_ext >&5
20911
20912 ac_cv_member_struct_loop_info64_lo_file_name=no
20913 fi
20914
20915 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20916 fi
20917
20918 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20919 fi
20920 { echo "$as_me:$LINENO: result: $ac_cv_member_struct_loop_info64_lo_file_name" >&5
20921 echo "${ECHO_T}$ac_cv_member_struct_loop_info64_lo_file_name" >&6; }
20922 if test $ac_cv_member_struct_loop_info64_lo_file_name = yes; then
20923
20924 cat >>confdefs.h <<_ACEOF
20925 #define HAVE_STRUCT_LOOP_INFO64_LO_FILE_NAME 1
20926 _ACEOF
20927
20928
20929 fi
20930
20931
20932 { echo "$as_me:$LINENO: checking for libHX.h" >&5
20933 echo $ECHO_N "checking for libHX.h... $ECHO_C" >&6; }
20934 if test "${ac_cv_header_libHX_h+set}" = set; then
20935 echo $ECHO_N "(cached) $ECHO_C" >&6
20936 else
20937 cat >conftest.$ac_ext <<_ACEOF
20938 /* confdefs.h. */
20939 _ACEOF
20940 cat confdefs.h >>conftest.$ac_ext
20941 cat >>conftest.$ac_ext <<_ACEOF
20942 /* end confdefs.h. */
20943
20944 #include <libHX.h>
20945 #if !defined(_LIBHX_H) || _LIBHX_H < 20070701
20946 # error You need a newer version of libHX (at least 1.10.0)
20947 #endif
20948
20949
20950 #include <libHX.h>
20951 _ACEOF
20952 rm -f conftest.$ac_objext
20953 if { (ac_try="$ac_compile"
20954 case "(($ac_try" in
20955 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20956 *) ac_try_echo=$ac_try;;
20957 esac
20958 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20959 (eval "$ac_compile") 2>conftest.er1
20960 ac_status=$?
20961 grep -v '^ *+' conftest.er1 >conftest.err
20962 rm -f conftest.er1
20963 cat conftest.err >&5
20964 echo "$as_me:$LINENO: \$? = $ac_status" >&5
20965 (exit $ac_status); } &&
20966 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
20967 { (case "(($ac_try" in
20968 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20969 *) ac_try_echo=$ac_try;;
20970 esac
20971 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20972 (eval "$ac_try") 2>&5
20973 ac_status=$?
20974 echo "$as_me:$LINENO: \$? = $ac_status" >&5
20975 (exit $ac_status); }; } &&
20976 { ac_try='test -s conftest.$ac_objext'
20977 { (case "(($ac_try" in
20978 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20979 *) ac_try_echo=$ac_try;;
20980 esac
20981 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
20982 (eval "$ac_try") 2>&5
20983 ac_status=$?
20984 echo "$as_me:$LINENO: \$? = $ac_status" >&5
20985 (exit $ac_status); }; }; then
20986 ac_cv_header_libHX_h=yes
20987 else
20988 echo "$as_me: failed program was:" >&5
20989 sed 's/^/| /' conftest.$ac_ext >&5
20990
20991 ac_cv_header_libHX_h=no
20992 fi
20993
20994 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20995 fi
20996 { echo "$as_me:$LINENO: result: $ac_cv_header_libHX_h" >&5
20997 echo "${ECHO_T}$ac_cv_header_libHX_h" >&6; }
20998 if test $ac_cv_header_libHX_h = yes; then
20999 :
21000 else
21001 { { echo "$as_me:$LINENO: error: Need at least libHX 1.10 (http://jengelh.hopto.org/p/libHX/)" >&5
21002 echo "$as_me: error: Need at least libHX 1.10 (http://jengelh.hopto.org/p/libHX/)" >&2;}
21003 { (exit 1); exit 1; }; }
21004 fi
1929321005
1929421006
1929521007 if test "${ac_cv_header_security_pam_modules_h+set}" = set; then
19296 echo "$as_me:$LINENO: checking for security/pam_modules.h" >&5
19297 echo $ECHO_N "checking for security/pam_modules.h... $ECHO_C" >&6
21008 { echo "$as_me:$LINENO: checking for security/pam_modules.h" >&5
21009 echo $ECHO_N "checking for security/pam_modules.h... $ECHO_C" >&6; }
1929821010 if test "${ac_cv_header_security_pam_modules_h+set}" = set; then
1929921011 echo $ECHO_N "(cached) $ECHO_C" >&6
1930021012 fi
19301 echo "$as_me:$LINENO: result: $ac_cv_header_security_pam_modules_h" >&5
19302 echo "${ECHO_T}$ac_cv_header_security_pam_modules_h" >&6
21013 { echo "$as_me:$LINENO: result: $ac_cv_header_security_pam_modules_h" >&5
21014 echo "${ECHO_T}$ac_cv_header_security_pam_modules_h" >&6; }
1930321015 else
1930421016 # Is the header compilable?
19305 echo "$as_me:$LINENO: checking security/pam_modules.h usability" >&5
19306 echo $ECHO_N "checking security/pam_modules.h usability... $ECHO_C" >&6
21017 { echo "$as_me:$LINENO: checking security/pam_modules.h usability" >&5
21018 echo $ECHO_N "checking security/pam_modules.h usability... $ECHO_C" >&6; }
1930721019 cat >conftest.$ac_ext <<_ACEOF
1930821020 /* confdefs.h. */
1930921021 _ACEOF
1931421026 #include <security/pam_modules.h>
1931521027 _ACEOF
1931621028 rm -f conftest.$ac_objext
19317 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
19318 (eval $ac_compile) 2>conftest.er1
21029 if { (ac_try="$ac_compile"
21030 case "(($ac_try" in
21031 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
21032 *) ac_try_echo=$ac_try;;
21033 esac
21034 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
21035 (eval "$ac_compile") 2>conftest.er1
1931921036 ac_status=$?
1932021037 grep -v '^ *+' conftest.er1 >conftest.err
1932121038 rm -f conftest.er1
1932221039 cat conftest.err >&5
1932321040 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1932421041 (exit $ac_status); } &&
19325 { ac_try='test -z "$ac_c_werror_flag"
19326 || test ! -s conftest.err'
19327 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
19328 (eval $ac_try) 2>&5
21042 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
21043 { (case "(($ac_try" in
21044 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
21045 *) ac_try_echo=$ac_try;;
21046 esac
21047 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
21048 (eval "$ac_try") 2>&5
1932921049 ac_status=$?
1933021050 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1933121051 (exit $ac_status); }; } &&
1933221052 { ac_try='test -s conftest.$ac_objext'
19333 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
19334 (eval $ac_try) 2>&5
21053 { (case "(($ac_try" in
21054 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
21055 *) ac_try_echo=$ac_try;;
21056 esac
21057 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
21058 (eval "$ac_try") 2>&5
1933521059 ac_status=$?
1933621060 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1933721061 (exit $ac_status); }; }; then
1934021064 echo "$as_me: failed program was:" >&5
1934121065 sed 's/^/| /' conftest.$ac_ext >&5
1934221066
19343 ac_header_compiler=no
19344 fi
19345 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
19346 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
19347 echo "${ECHO_T}$ac_header_compiler" >&6
21067 ac_header_compiler=no
21068 fi
21069
21070 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21071 { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
21072 echo "${ECHO_T}$ac_header_compiler" >&6; }
1934821073
1934921074 # Is the header present?
19350 echo "$as_me:$LINENO: checking security/pam_modules.h presence" >&5
19351 echo $ECHO_N "checking security/pam_modules.h presence... $ECHO_C" >&6
21075 { echo "$as_me:$LINENO: checking security/pam_modules.h presence" >&5
21076 echo $ECHO_N "checking security/pam_modules.h presence... $ECHO_C" >&6; }
1935221077 cat >conftest.$ac_ext <<_ACEOF
1935321078 /* confdefs.h. */
1935421079 _ACEOF
1935721082 /* end confdefs.h. */
1935821083 #include <security/pam_modules.h>
1935921084 _ACEOF
19360 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
19361 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
21085 if { (ac_try="$ac_cpp conftest.$ac_ext"
21086 case "(($ac_try" in
21087 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
21088 *) ac_try_echo=$ac_try;;
21089 esac
21090 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
21091 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
1936221092 ac_status=$?
1936321093 grep -v '^ *+' conftest.er1 >conftest.err
1936421094 rm -f conftest.er1
1938221112
1938321113 ac_header_preproc=no
1938421114 fi
21115
1938521116 rm -f conftest.err conftest.$ac_ext
19386 echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
19387 echo "${ECHO_T}$ac_header_preproc" >&6
21117 { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
21118 echo "${ECHO_T}$ac_header_preproc" >&6; }
1938821119
1938921120 # So? What about this header?
1939021121 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
1940821139 echo "$as_me: WARNING: security/pam_modules.h: proceeding with the preprocessor's result" >&2;}
1940921140 { echo "$as_me:$LINENO: WARNING: security/pam_modules.h: in the future, the compiler will take precedence" >&5
1941021141 echo "$as_me: WARNING: security/pam_modules.h: in the future, the compiler will take precedence" >&2;}
19411 (
19412 cat <<\_ASBOX
19413 ## ------------------------------------------ ##
19414 ## Report this to the AC_PACKAGE_NAME lists. ##
19415 ## ------------------------------------------ ##
19416 _ASBOX
19417 ) |
19418 sed "s/^/$as_me: WARNING: /" >&2
21142
1941921143 ;;
1942021144 esac
19421 echo "$as_me:$LINENO: checking for security/pam_modules.h" >&5
19422 echo $ECHO_N "checking for security/pam_modules.h... $ECHO_C" >&6
21145 { echo "$as_me:$LINENO: checking for security/pam_modules.h" >&5
21146 echo $ECHO_N "checking for security/pam_modules.h... $ECHO_C" >&6; }
1942321147 if test "${ac_cv_header_security_pam_modules_h+set}" = set; then
1942421148 echo $ECHO_N "(cached) $ECHO_C" >&6
1942521149 else
1942621150 ac_cv_header_security_pam_modules_h=$ac_header_preproc
1942721151 fi
19428 echo "$as_me:$LINENO: result: $ac_cv_header_security_pam_modules_h" >&5
19429 echo "${ECHO_T}$ac_cv_header_security_pam_modules_h" >&6
21152 { echo "$as_me:$LINENO: result: $ac_cv_header_security_pam_modules_h" >&5
21153 echo "${ECHO_T}$ac_cv_header_security_pam_modules_h" >&6; }
1943021154
1943121155 fi
1943221156 if test $ac_cv_header_security_pam_modules_h = yes; then
1943621160
1943721161 # Mac OS X 10.3 puts PAM headers in /usr/include/pam.
1943821162 if test "${ac_cv_header_pam_pam_modules_h+set}" = set; then
19439 echo "$as_me:$LINENO: checking for pam/pam_modules.h" >&5
19440 echo $ECHO_N "checking for pam/pam_modules.h... $ECHO_C" >&6
21163 { echo "$as_me:$LINENO: checking for pam/pam_modules.h" >&5
21164 echo $ECHO_N "checking for pam/pam_modules.h... $ECHO_C" >&6; }
1944121165 if test "${ac_cv_header_pam_pam_modules_h+set}" = set; then
1944221166 echo $ECHO_N "(cached) $ECHO_C" >&6
1944321167 fi
19444 echo "$as_me:$LINENO: result: $ac_cv_header_pam_pam_modules_h" >&5
19445 echo "${ECHO_T}$ac_cv_header_pam_pam_modules_h" >&6
21168 { echo "$as_me:$LINENO: result: $ac_cv_header_pam_pam_modules_h" >&5
21169 echo "${ECHO_T}$ac_cv_header_pam_pam_modules_h" >&6; }
1944621170 else
1944721171 # Is the header compilable?
19448 echo "$as_me:$LINENO: checking pam/pam_modules.h usability" >&5
19449 echo $ECHO_N "checking pam/pam_modules.h usability... $ECHO_C" >&6
21172 { echo "$as_me:$LINENO: checking pam/pam_modules.h usability" >&5
21173 echo $ECHO_N "checking pam/pam_modules.h usability... $ECHO_C" >&6; }
1945021174 cat >conftest.$ac_ext <<_ACEOF
1945121175 /* confdefs.h. */
1945221176 _ACEOF
1945721181 #include <pam/pam_modules.h>
1945821182 _ACEOF
1945921183 rm -f conftest.$ac_objext
19460 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
19461 (eval $ac_compile) 2>conftest.er1
21184 if { (ac_try="$ac_compile"
21185 case "(($ac_try" in
21186 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
21187 *) ac_try_echo=$ac_try;;
21188 esac
21189 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
21190 (eval "$ac_compile") 2>conftest.er1
1946221191 ac_status=$?
1946321192 grep -v '^ *+' conftest.er1 >conftest.err
1946421193 rm -f conftest.er1
1946521194 cat conftest.err >&5
1946621195 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1946721196 (exit $ac_status); } &&
19468 { ac_try='test -z "$ac_c_werror_flag"
19469 || test ! -s conftest.err'
19470 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
19471 (eval $ac_try) 2>&5
21197 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
21198 { (case "(($ac_try" in
21199 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
21200 *) ac_try_echo=$ac_try;;
21201 esac
21202 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
21203 (eval "$ac_try") 2>&5
1947221204 ac_status=$?
1947321205 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1947421206 (exit $ac_status); }; } &&
1947521207 { ac_try='test -s conftest.$ac_objext'
19476 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
19477 (eval $ac_try) 2>&5
21208 { (case "(($ac_try" in
21209 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
21210 *) ac_try_echo=$ac_try;;
21211 esac
21212 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
21213 (eval "$ac_try") 2>&5
1947821214 ac_status=$?
1947921215 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1948021216 (exit $ac_status); }; }; then
1948321219 echo "$as_me: failed program was:" >&5
1948421220 sed 's/^/| /' conftest.$ac_ext >&5
1948521221
19486 ac_header_compiler=no
19487 fi
19488 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
19489 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
19490 echo "${ECHO_T}$ac_header_compiler" >&6
21222 ac_header_compiler=no
21223 fi
21224
21225 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21226 { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
21227 echo "${ECHO_T}$ac_header_compiler" >&6; }
1949121228
1949221229 # Is the header present?
19493 echo "$as_me:$LINENO: checking pam/pam_modules.h presence" >&5
19494 echo $ECHO_N "checking pam/pam_modules.h presence... $ECHO_C" >&6
21230 { echo "$as_me:$LINENO: checking pam/pam_modules.h presence" >&5
21231 echo $ECHO_N "checking pam/pam_modules.h presence... $ECHO_C" >&6; }
1949521232 cat >conftest.$ac_ext <<_ACEOF
1949621233 /* confdefs.h. */
1949721234 _ACEOF
1950021237 /* end confdefs.h. */
1950121238 #include <pam/pam_modules.h>
1950221239 _ACEOF
19503 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
19504 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
21240 if { (ac_try="$ac_cpp conftest.$ac_ext"
21241 case "(($ac_try" in
21242 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
21243 *) ac_try_echo=$ac_try;;
21244 esac
21245 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
21246 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
1950521247 ac_status=$?
1950621248 grep -v '^ *+' conftest.er1 >conftest.err
1950721249 rm -f conftest.er1
1952521267
1952621268 ac_header_preproc=no
1952721269 fi
21270
1952821271 rm -f conftest.err conftest.$ac_ext
19529 echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
19530 echo "${ECHO_T}$ac_header_preproc" >&6
21272 { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
21273 echo "${ECHO_T}$ac_header_preproc" >&6; }
1953121274
1953221275 # So? What about this header?
1953321276 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
1955121294 echo "$as_me: WARNING: pam/pam_modules.h: proceeding with the preprocessor's result" >&2;}
1955221295 { echo "$as_me:$LINENO: WARNING: pam/pam_modules.h: in the future, the compiler will take precedence" >&5
1955321296 echo "$as_me: WARNING: pam/pam_modules.h: in the future, the compiler will take precedence" >&2;}
19554 (
19555 cat <<\_ASBOX
19556 ## ------------------------------------------ ##
19557 ## Report this to the AC_PACKAGE_NAME lists. ##
19558 ## ------------------------------------------ ##
19559 _ASBOX
19560 ) |
19561 sed "s/^/$as_me: WARNING: /" >&2
21297
1956221298 ;;
1956321299 esac
19564 echo "$as_me:$LINENO: checking for pam/pam_modules.h" >&5
19565 echo $ECHO_N "checking for pam/pam_modules.h... $ECHO_C" >&6
21300 { echo "$as_me:$LINENO: checking for pam/pam_modules.h" >&5
21301 echo $ECHO_N "checking for pam/pam_modules.h... $ECHO_C" >&6; }
1956621302 if test "${ac_cv_header_pam_pam_modules_h+set}" = set; then
1956721303 echo $ECHO_N "(cached) $ECHO_C" >&6
1956821304 else
1956921305 ac_cv_header_pam_pam_modules_h=$ac_header_preproc
1957021306 fi
19571 echo "$as_me:$LINENO: result: $ac_cv_header_pam_pam_modules_h" >&5
19572 echo "${ECHO_T}$ac_cv_header_pam_pam_modules_h" >&6
21307 { echo "$as_me:$LINENO: result: $ac_cv_header_pam_pam_modules_h" >&5
21308 echo "${ECHO_T}$ac_cv_header_pam_pam_modules_h" >&6; }
1957321309
1957421310 fi
1957521311 if test $ac_cv_header_pam_pam_modules_h = yes; then
1958421320 fi
1958521321
1958621322 case "$host" in
19587 *-*-linux*)
19588 # See also <configure-flags> in pam_mount.xml.
19589 PAM_MODDIR="\$(slibdir)/security"
19590 ;;
19591 *-*-darwin*)
19592 PAM_MODDIR="/usr/lib/pam"
19593 ;;
19594 *)
19595 PAM_MODDIR="/usr/lib"
19596 ;;
21323 (*-*-linux*)
21324 PAM_MODDIR='${slibdir}/security'
21325 ;;
21326 (*-*-darwin*)
21327 PAM_MODDIR="/usr/lib/pam"
21328 ;;
21329 (*)
21330 PAM_MODDIR="/usr/lib"
21331 ;;
1959721332 esac
1959821333
1959921334
19600 ac_config_files="$ac_config_files Makefile config/Makefile dry/Makefile src/Makefile scripts/Makefile"
21335 ac_config_files="$ac_config_files Makefile config/Makefile dry/Makefile src/Makefile scripts/Makefile"
21336
1960121337 cat >confcache <<\_ACEOF
1960221338 # This file is a shell script that caches the results of configure
1960321339 # tests run on this system so they can be shared between configure
1961621352
1961721353 # The following way of writing the cache mishandles newlines in values,
1961821354 # but we know of no workaround that is simple, portable, and efficient.
19619 # So, don't put newlines in cache variables' values.
21355 # So, we kill variables containing newlines.
1962021356 # Ultrix sh set writes to stderr and can't be redirected directly,
1962121357 # and sets the high bit in the cache file unless we assign to the vars.
19622 {
21358 (
21359 for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
21360 eval ac_val=\$$ac_var
21361 case $ac_val in #(
21362 *${as_nl}*)
21363 case $ac_var in #(
21364 *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
21365 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
21366 esac
21367 case $ac_var in #(
21368 _ | IFS | as_nl) ;; #(
21369 *) $as_unset $ac_var ;;
21370 esac ;;
21371 esac
21372 done
21373
1962321374 (set) 2>&1 |
19624 case `(ac_space=' '; set | grep ac_space) 2>&1` in
19625 *ac_space=\ *)
21375 case $as_nl`(ac_space=' '; set) 2>&1` in #(
21376 *${as_nl}ac_space=\ *)
1962621377 # `set' does not quote correctly, so add quotes (double-quote
1962721378 # substitution turns \\\\ into \\, and sed turns \\ into \).
1962821379 sed -n \
1962921380 "s/'/'\\\\''/g;
1963021381 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
19631 ;;
21382 ;; #(
1963221383 *)
1963321384 # `set' quotes correctly as required by POSIX, so do not add quotes.
19634 sed -n \
19635 "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
19636 ;;
19637 esac;
19638 } |
21385 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
21386 ;;
21387 esac |
21388 sort
21389 ) |
1963921390 sed '
21391 /^ac_cv_env_/b end
1964021392 t clear
19641 : clear
21393 :clear
1964221394 s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
1964321395 t end
19644 /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
19645 : end' >>confcache
19646 if diff $cache_file confcache >/dev/null 2>&1; then :; else
19647 if test -w $cache_file; then
19648 test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
21396 s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
21397 :end' >>confcache
21398 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
21399 if test -w "$cache_file"; then
21400 test "x$cache_file" != "x/dev/null" &&
21401 { echo "$as_me:$LINENO: updating cache $cache_file" >&5
21402 echo "$as_me: updating cache $cache_file" >&6;}
1964921403 cat confcache >$cache_file
1965021404 else
19651 echo "not updating unwritable cache $cache_file"
21405 { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
21406 echo "$as_me: not updating unwritable cache $cache_file" >&6;}
1965221407 fi
1965321408 fi
1965421409 rm -f confcache
1965621411 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1965721412 # Let make expand exec_prefix.
1965821413 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
19659
19660 # VPATH may cause trouble with some makes, so we remove $(srcdir),
19661 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
19662 # trailing colons and then remove the whole line if VPATH becomes empty
19663 # (actually we leave an empty line to preserve line numbers).
19664 if test "x$srcdir" = x.; then
19665 ac_vpsub='/^[ ]*VPATH[ ]*=/{
19666 s/:*\$(srcdir):*/:/;
19667 s/:*\${srcdir}:*/:/;
19668 s/:*@srcdir@:*/:/;
19669 s/^\([^=]*=[ ]*\):*/\1/;
19670 s/:*$//;
19671 s/^[^=]*=[ ]*$//;
19672 }'
19673 fi
1967421414
1967521415 DEFS=-DHAVE_CONFIG_H
1967621416
1967821418 ac_ltlibobjs=
1967921419 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
1968021420 # 1. Remove the extension, and $U if already installed.
19681 ac_i=`echo "$ac_i" |
19682 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
19683 # 2. Add them.
19684 ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
19685 ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
21421 ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
21422 ac_i=`echo "$ac_i" | sed "$ac_script"`
21423 # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
21424 # will be set to the directory where LIBOBJS objects are built.
21425 ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
21426 ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
1968621427 done
1968721428 LIBOBJS=$ac_libobjs
1968821429
1970721448 { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
1970821449 Usually this means the macro was only invoked conditionally." >&5
1970921450 echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
19710 Usually this means the macro was only invoked conditionally." >&2;}
19711 { (exit 1); exit 1; }; }
19712 fi
19713 if test -z "${FLYN_TRUE}" && test -z "${FLYN_FALSE}"; then
19714 { { echo "$as_me:$LINENO: error: conditional \"FLYN\" was never defined.
19715 Usually this means the macro was only invoked conditionally." >&5
19716 echo "$as_me: error: conditional \"FLYN\" was never defined.
1971721451 Usually this means the macro was only invoked conditionally." >&2;}
1971821452 { (exit 1); exit 1; }; }
1971921453 fi
1974821482 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
1974921483 # is contrary to our usage. Disable this feature.
1975021484 alias -g '${1+"$@"}'='"$@"'
19751 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
19752 set -o posix
19753 fi
21485 setopt NO_GLOB_SUBST
21486 else
21487 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
21488 fi
21489 BIN_SH=xpg4; export BIN_SH # for Tru64
1975421490 DUALCASE=1; export DUALCASE # for MKS sh
1975521491
19756 # Support unset when possible.
19757 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
19758 as_unset=unset
19759 else
19760 as_unset=false
19761 fi
19762
19763
19764 # Work around bugs in pre-3.0 UWIN ksh.
19765 $as_unset ENV MAIL MAILPATH
19766 PS1='$ '
19767 PS2='> '
19768 PS4='+ '
19769
19770 # NLS nuisances.
19771 for as_var in \
19772 LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
19773 LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
19774 LC_TELEPHONE LC_TIME
19775 do
19776 if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
19777 eval $as_var=C; export $as_var
19778 else
19779 $as_unset $as_var
19780 fi
19781 done
19782
19783 # Required to use basename.
19784 if expr a : '\(a\)' >/dev/null 2>&1; then
19785 as_expr=expr
19786 else
19787 as_expr=false
19788 fi
19789
19790 if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
19791 as_basename=basename
19792 else
19793 as_basename=false
19794 fi
19795
19796
19797 # Name of the executable.
19798 as_me=`$as_basename "$0" ||
19799 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
19800 X"$0" : 'X\(//\)$' \| \
19801 X"$0" : 'X\(/\)$' \| \
19802 . : '\(.\)' 2>/dev/null ||
19803 echo X/"$0" |
19804 sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
19805 /^X\/\(\/\/\)$/{ s//\1/; q; }
19806 /^X\/\(\/\).*/{ s//\1/; q; }
19807 s/.*/./; q'`
19808
19809
19810 # PATH needs CR, and LINENO needs CR and PATH.
21492
21493 # PATH needs CR
1981121494 # Avoid depending upon Character Ranges.
1981221495 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
1981321496 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
1982821511 rm -f conf$$.sh
1982921512 fi
1983021513
19831
19832 as_lineno_1=$LINENO
19833 as_lineno_2=$LINENO
19834 as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
19835 test "x$as_lineno_1" != "x$as_lineno_2" &&
19836 test "x$as_lineno_3" = "x$as_lineno_2" || {
19837 # Find who we are. Look in the path if we contain no path at all
19838 # relative or not.
19839 case $0 in
19840 *[\\/]* ) as_myself=$0 ;;
19841 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
21514 # Support unset when possible.
21515 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
21516 as_unset=unset
21517 else
21518 as_unset=false
21519 fi
21520
21521
21522 # IFS
21523 # We need space, tab and new line, in precisely that order. Quoting is
21524 # there to prevent editors from complaining about space-tab.
21525 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
21526 # splitting by setting IFS to empty value.)
21527 as_nl='
21528 '
21529 IFS=" "" $as_nl"
21530
21531 # Find who we are. Look in the path if we contain no directory separator.
21532 case $0 in
21533 *[\\/]* ) as_myself=$0 ;;
21534 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1984221535 for as_dir in $PATH
1984321536 do
1984421537 IFS=$as_save_IFS
1984521538 test -z "$as_dir" && as_dir=.
1984621539 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
1984721540 done
19848
19849 ;;
19850 esac
19851 # We did not find ourselves, most probably we were run as `sh COMMAND'
19852 # in which case we are not to be found in the path.
19853 if test "x$as_myself" = x; then
19854 as_myself=$0
21541 IFS=$as_save_IFS
21542
21543 ;;
21544 esac
21545 # We did not find ourselves, most probably we were run as `sh COMMAND'
21546 # in which case we are not to be found in the path.
21547 if test "x$as_myself" = x; then
21548 as_myself=$0
21549 fi
21550 if test ! -f "$as_myself"; then
21551 echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
21552 { (exit 1); exit 1; }
21553 fi
21554
21555 # Work around bugs in pre-3.0 UWIN ksh.
21556 for as_var in ENV MAIL MAILPATH
21557 do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
21558 done
21559 PS1='$ '
21560 PS2='> '
21561 PS4='+ '
21562
21563 # NLS nuisances.
21564 for as_var in \
21565 LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
21566 LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
21567 LC_TELEPHONE LC_TIME
21568 do
21569 if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
21570 eval $as_var=C; export $as_var
21571 else
21572 ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
1985521573 fi
19856 if test ! -f "$as_myself"; then
19857 { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
19858 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
19859 { (exit 1); exit 1; }; }
19860 fi
19861 case $CONFIG_SHELL in
19862 '')
19863 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
19864 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
19865 do
19866 IFS=$as_save_IFS
19867 test -z "$as_dir" && as_dir=.
19868 for as_base in sh bash ksh sh5; do
19869 case $as_dir in
19870 /*)
19871 if ("$as_dir/$as_base" -c '
21574 done
21575
21576 # Required to use basename.
21577 if expr a : '\(a\)' >/dev/null 2>&1 &&
21578 test "X`expr 00001 : '.*\(...\)'`" = X001; then
21579 as_expr=expr
21580 else
21581 as_expr=false
21582 fi
21583
21584 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
21585 as_basename=basename
21586 else
21587 as_basename=false
21588 fi
21589
21590
21591 # Name of the executable.
21592 as_me=`$as_basename -- "$0" ||
21593 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
21594 X"$0" : 'X\(//\)$' \| \
21595 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
21596 echo X/"$0" |
21597 sed '/^.*\/\([^/][^/]*\)\/*$/{
21598 s//\1/
21599 q
21600 }
21601 /^X\/\(\/\/\)$/{
21602 s//\1/
21603 q
21604 }
21605 /^X\/\(\/\).*/{
21606 s//\1/
21607 q
21608 }
21609 s/.*/./; q'`
21610
21611 # CDPATH.
21612 $as_unset CDPATH
21613
21614
21615
1987221616 as_lineno_1=$LINENO
1987321617 as_lineno_2=$LINENO
19874 as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
1987521618 test "x$as_lineno_1" != "x$as_lineno_2" &&
19876 test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
19877 $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
19878 $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
19879 CONFIG_SHELL=$as_dir/$as_base
19880 export CONFIG_SHELL
19881 exec "$CONFIG_SHELL" "$0" ${1+"$@"}
19882 fi;;
19883 esac
19884 done
19885 done
19886 ;;
19887 esac
21619 test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
1988821620
1988921621 # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
1989021622 # uniformly replaced by the line number. The first 'sed' inserts a
19891 # line-number line before each line; the second 'sed' does the real
19892 # work. The second script uses 'N' to pair each line-number line
19893 # with the numbered line, and appends trailing '-' during
19894 # substitution so that $LINENO is not a special case at line end.
21623 # line-number line after each line using $LINENO; the second 'sed'
21624 # does the real work. The second script uses 'N' to pair each
21625 # line-number line with the line containing $LINENO, and appends
21626 # trailing '-' during substitution so that $LINENO is not a special
21627 # case at line end.
1989521628 # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
19896 # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
19897 sed '=' <$as_myself |
21629 # scripts with optimization help from Paolo Bonzini. Blame Lee
21630 # E. McMahon (1931-1989) for sed's syntax. :-)
21631 sed -n '
21632 p
21633 /[$]LINENO/=
21634 ' <$as_myself |
1989821635 sed '
21636 s/[$]LINENO.*/&-/
21637 t lineno
21638 b
21639 :lineno
1989921640 N
19900 s,$,-,
19901 : loop
19902 s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
21641 :loop
21642 s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
1990321643 t loop
19904 s,-$,,
19905 s,^['$as_cr_digits']*\n,,
21644 s/-\n.*//
1990621645 ' >$as_me.lineno &&
19907 chmod +x $as_me.lineno ||
19908 { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
19909 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
21646 chmod +x "$as_me.lineno" ||
21647 { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
1991021648 { (exit 1); exit 1; }; }
1991121649
1991221650 # Don't try to exec as it changes $[0], causing all sort of problems
1991321651 # (the dirname of $[0] is not the place where we might find the
19914 # original and so on. Autoconf is especially sensible to this).
19915 . ./$as_me.lineno
21652 # original and so on. Autoconf is especially sensitive to this).
21653 . "./$as_me.lineno"
1991621654 # Exit status is that of the last command.
1991721655 exit
1991821656 }
1991921657
1992021658
19921 case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
19922 *c*,-n*) ECHO_N= ECHO_C='
19923 ' ECHO_T=' ' ;;
19924 *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
19925 *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
21659 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
21660 as_dirname=dirname
21661 else
21662 as_dirname=false
21663 fi
21664
21665 ECHO_C= ECHO_N= ECHO_T=
21666 case `echo -n x` in
21667 -n*)
21668 case `echo 'x\c'` in
21669 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
21670 *) ECHO_C='\c';;
21671 esac;;
21672 *)
21673 ECHO_N='-n';;
1992621674 esac
1992721675
19928 if expr a : '\(a\)' >/dev/null 2>&1; then
21676 if expr a : '\(a\)' >/dev/null 2>&1 &&
21677 test "X`expr 00001 : '.*\(...\)'`" = X001; then
1992921678 as_expr=expr
1993021679 else
1993121680 as_expr=false
1993221681 fi
1993321682
1993421683 rm -f conf$$ conf$$.exe conf$$.file
21684 if test -d conf$$.dir; then
21685 rm -f conf$$.dir/conf$$.file
21686 else
21687 rm -f conf$$.dir
21688 mkdir conf$$.dir
21689 fi
1993521690 echo >conf$$.file
1993621691 if ln -s conf$$.file conf$$ 2>/dev/null; then
19937 # We could just check for DJGPP; but this test a) works b) is more generic
19938 # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
19939 if test -f conf$$.exe; then
19940 # Don't use ln at all; we don't have any links
21692 as_ln_s='ln -s'
21693 # ... but there are two gotchas:
21694 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
21695 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
21696 # In both cases, we have to default to `cp -p'.
21697 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
1994121698 as_ln_s='cp -p'
19942 else
19943 as_ln_s='ln -s'
19944 fi
1994521699 elif ln conf$$.file conf$$ 2>/dev/null; then
1994621700 as_ln_s=ln
1994721701 else
1994821702 as_ln_s='cp -p'
1994921703 fi
19950 rm -f conf$$ conf$$.exe conf$$.file
21704 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
21705 rmdir conf$$.dir 2>/dev/null
1995121706
1995221707 if mkdir -p . 2>/dev/null; then
1995321708 as_mkdir_p=:
1995621711 as_mkdir_p=false
1995721712 fi
1995821713
19959 as_executable_p="test -f"
21714 # Find out whether ``test -x'' works. Don't use a zero-byte file, as
21715 # systems may use methods other than mode bits to determine executability.
21716 cat >conf$$.file <<_ASEOF
21717 #! /bin/sh
21718 exit 0
21719 _ASEOF
21720 chmod +x conf$$.file
21721 if test -x conf$$.file >/dev/null 2>&1; then
21722 as_executable_p="test -x"
21723 else
21724 as_executable_p=:
21725 fi
21726 rm -f conf$$.file
1996021727
1996121728 # Sed expression to map a string onto a valid CPP name.
1996221729 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
1996521732 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
1996621733
1996721734
19968 # IFS
19969 # We need space, tab and new line, in precisely that order.
19970 as_nl='
19971 '
19972 IFS=" $as_nl"
19973
19974 # CDPATH.
19975 $as_unset CDPATH
19976
1997721735 exec 6>&1
1997821736
19979 # Open the log real soon, to keep \$[0] and so on meaningful, and to
21737 # Save the log message, to keep $[0] and so on meaningful, and to
1998021738 # report actual input values of CONFIG_FILES etc. instead of their
19981 # values after options handling. Logging --version etc. is OK.
19982 exec 5>>config.log
19983 {
19984 echo
19985 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
19986 ## Running $as_me. ##
19987 _ASBOX
19988 } >&5
19989 cat >&5 <<_CSEOF
19990
19991 This file was extended by $as_me, which was
19992 generated by GNU Autoconf 2.59. Invocation command line was
21739 # values after options handling.
21740 ac_log="
21741 This file was extended by pam_mount $as_me 0.20, which was
21742 generated by GNU Autoconf 2.60. Invocation command line was
1999321743
1999421744 CONFIG_FILES = $CONFIG_FILES
1999521745 CONFIG_HEADERS = $CONFIG_HEADERS
1999721747 CONFIG_COMMANDS = $CONFIG_COMMANDS
1999821748 $ $0 $@
1999921749
20000 _CSEOF
20001 echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
20002 echo >&5
21750 on `(hostname || uname -n) 2>/dev/null | sed 1q`
21751 "
21752
2000321753 _ACEOF
2000421754
21755 cat >>$CONFIG_STATUS <<_ACEOF
2000521756 # Files that config.status was made for.
20006 if test -n "$ac_config_files"; then
20007 echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
20008 fi
20009
20010 if test -n "$ac_config_headers"; then
20011 echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
20012 fi
20013
20014 if test -n "$ac_config_links"; then
20015 echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
20016 fi
20017
20018 if test -n "$ac_config_commands"; then
20019 echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
20020 fi
21757 config_files="$ac_config_files"
21758 config_headers="$ac_config_headers"
21759 config_commands="$ac_config_commands"
21760
21761 _ACEOF
2002121762
2002221763 cat >>$CONFIG_STATUS <<\_ACEOF
20023
2002421764 ac_cs_usage="\
2002521765 \`$as_me' instantiates files from templates according to the
2002621766 current configuration.
2004721787 $config_commands
2004821788
2004921789 Report bugs to <bug-autoconf@gnu.org>."
21790
2005021791 _ACEOF
20051
2005221792 cat >>$CONFIG_STATUS <<_ACEOF
2005321793 ac_cs_version="\\
20054 config.status
20055 configured by $0, generated by GNU Autoconf 2.59,
20056 with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
20057
20058 Copyright (C) 2003 Free Software Foundation, Inc.
21794 pam_mount config.status 0.20
21795 configured by $0, generated by GNU Autoconf 2.60,
21796 with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
21797
21798 Copyright (C) 2006 Free Software Foundation, Inc.
2005921799 This config.status script is free software; the Free Software Foundation
2006021800 gives unlimited permission to copy, distribute and modify it."
20061 srcdir=$srcdir
20062 INSTALL="$INSTALL"
21801
21802 ac_pwd='$ac_pwd'
21803 srcdir='$srcdir'
21804 INSTALL='$INSTALL'
2006321805 _ACEOF
2006421806
2006521807 cat >>$CONFIG_STATUS <<\_ACEOF
2007021812 do
2007121813 case $1 in
2007221814 --*=*)
20073 ac_option=`expr "x$1" : 'x\([^=]*\)='`
20074 ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
21815 ac_option=`expr "X$1" : 'X\([^=]*\)='`
21816 ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
2007521817 ac_shift=:
2007621818 ;;
20077 -*)
21819 *)
2007821820 ac_option=$1
2007921821 ac_optarg=$2
2008021822 ac_shift=shift
2008121823 ;;
20082 *) # This is not an option, so the user has probably given explicit
20083 # arguments.
20084 ac_option=$1
20085 ac_need_defaults=false;;
2008621824 esac
2008721825
2008821826 case $ac_option in
2008921827 # Handling of the options.
20090 _ACEOF
20091 cat >>$CONFIG_STATUS <<\_ACEOF
2009221828 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
2009321829 ac_cs_recheck=: ;;
20094 --version | --vers* | -V )
20095 echo "$ac_cs_version"; exit 0 ;;
20096 --he | --h)
20097 # Conflict between --help and --header
20098 { { echo "$as_me:$LINENO: error: ambiguous option: $1
20099 Try \`$0 --help' for more information." >&5
20100 echo "$as_me: error: ambiguous option: $1
20101 Try \`$0 --help' for more information." >&2;}
20102 { (exit 1); exit 1; }; };;
20103 --help | --hel | -h )
20104 echo "$ac_cs_usage"; exit 0 ;;
20105 --debug | --d* | -d )
21830 --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
21831 echo "$ac_cs_version"; exit ;;
21832 --debug | --debu | --deb | --de | --d | -d )
2010621833 debug=: ;;
2010721834 --file | --fil | --fi | --f )
2010821835 $ac_shift
2011221839 $ac_shift
2011321840 CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
2011421841 ac_need_defaults=false;;
21842 --he | --h)
21843 # Conflict between --help and --header
21844 { echo "$as_me: error: ambiguous option: $1
21845 Try \`$0 --help' for more information." >&2
21846 { (exit 1); exit 1; }; };;
21847 --help | --hel | -h )
21848 echo "$ac_cs_usage"; exit ;;
2011521849 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
2011621850 | -silent | --silent | --silen | --sile | --sil | --si | --s)
2011721851 ac_cs_silent=: ;;
2011821852
2011921853 # This is an error.
20120 -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
20121 Try \`$0 --help' for more information." >&5
20122 echo "$as_me: error: unrecognized option: $1
20123 Try \`$0 --help' for more information." >&2;}
21854 -*) { echo "$as_me: error: unrecognized option: $1
21855 Try \`$0 --help' for more information." >&2
2012421856 { (exit 1); exit 1; }; } ;;
2012521857
20126 *) ac_config_targets="$ac_config_targets $1" ;;
21858 *) ac_config_targets="$ac_config_targets $1"
21859 ac_need_defaults=false ;;
2012721860
2012821861 esac
2012921862 shift
2013921872 _ACEOF
2014021873 cat >>$CONFIG_STATUS <<_ACEOF
2014121874 if \$ac_cs_recheck; then
20142 echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
20143 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
21875 echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
21876 CONFIG_SHELL=$SHELL
21877 export CONFIG_SHELL
21878 exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
2014421879 fi
2014521880
2014621881 _ACEOF
20147
21882 cat >>$CONFIG_STATUS <<\_ACEOF
21883 exec 5>>config.log
21884 {
21885 echo
21886 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
21887 ## Running $as_me. ##
21888 _ASBOX
21889 echo "$ac_log"
21890 } >&5
21891
21892 _ACEOF
2014821893 cat >>$CONFIG_STATUS <<_ACEOF
2014921894 #
20150 # INIT-COMMANDS section.
21895 # INIT-COMMANDS
2015121896 #
20152
2015321897 AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
2015421898
2015521899 _ACEOF
2015621900
20157
20158
2015921901 cat >>$CONFIG_STATUS <<\_ACEOF
21902
21903 # Handling of arguments.
2016021904 for ac_config_target in $ac_config_targets
2016121905 do
20162 case "$ac_config_target" in
20163 # Handling of arguments.
20164 "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
20165 "config/Makefile" ) CONFIG_FILES="$CONFIG_FILES config/Makefile" ;;
20166 "dry/Makefile" ) CONFIG_FILES="$CONFIG_FILES dry/Makefile" ;;
20167 "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
20168 "scripts/Makefile" ) CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;;
20169 "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
20170 "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
21906 case $ac_config_target in
21907 "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
21908 "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
21909 "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
21910 "config/Makefile") CONFIG_FILES="$CONFIG_FILES config/Makefile" ;;
21911 "dry/Makefile") CONFIG_FILES="$CONFIG_FILES dry/Makefile" ;;
21912 "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
21913 "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;;
21914
2017121915 *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
2017221916 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
2017321917 { (exit 1); exit 1; }; };;
2017421918 esac
2017521919 done
21920
2017621921
2017721922 # If the user did not use the arguments to specify the items to instantiate,
2017821923 # then the envvar interface is used. Set only those that are not.
2018521930 fi
2018621931
2018721932 # Have a temporary directory for convenience. Make it in the build tree
20188 # simply because there is no reason to put it here, and in addition,
21933 # simply because there is no reason against having it here, and in addition,
2018921934 # creating and moving files from /tmp can sometimes cause problems.
20190 # Create a temporary directory, and hook for its removal unless debugging.
21935 # Hook for its removal unless debugging.
21936 # Note that there is a small window in which the directory will not be cleaned:
21937 # after its creation but before its name has been assigned to `$tmp'.
2019121938 $debug ||
2019221939 {
20193 trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
21940 tmp=
21941 trap 'exit_status=$?
21942 { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
21943 ' 0
2019421944 trap '{ (exit 1); exit 1; }' 1 2 13 15
2019521945 }
20196
2019721946 # Create a (secure) tmp directory for tmp files.
2019821947
2019921948 {
20200 tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
21949 tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
2020121950 test -n "$tmp" && test -d "$tmp"
2020221951 } ||
2020321952 {
20204 tmp=./confstat$$-$RANDOM
20205 (umask 077 && mkdir $tmp)
21953 tmp=./conf$$-$RANDOM
21954 (umask 077 && mkdir "$tmp")
2020621955 } ||
2020721956 {
2020821957 echo "$me: cannot create a temporary directory in ." >&2
2020921958 { (exit 1); exit 1; }
2021021959 }
2021121960
20212 _ACEOF
20213
20214 cat >>$CONFIG_STATUS <<_ACEOF
20215
2021621961 #
20217 # CONFIG_FILES section.
21962 # Set up the sed scripts for CONFIG_FILES section.
2021821963 #
2021921964
2022021965 # No need to generate the scripts if there are no CONFIG_FILES.
2022121966 # This happens for instance when ./config.status config.h
20222 if test -n "\$CONFIG_FILES"; then
20223 # Protect against being on the right side of a sed subst in config.status.
20224 sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
20225 s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
20226 s,@SHELL@,$SHELL,;t t
20227 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
20228 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
20229 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
20230 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
20231 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
20232 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
20233 s,@exec_prefix@,$exec_prefix,;t t
20234 s,@prefix@,$prefix,;t t
20235 s,@program_transform_name@,$program_transform_name,;t t
20236 s,@bindir@,$bindir,;t t
20237 s,@sbindir@,$sbindir,;t t
20238 s,@libexecdir@,$libexecdir,;t t
20239 s,@datadir@,$datadir,;t t
20240 s,@sysconfdir@,$sysconfdir,;t t
20241 s,@sharedstatedir@,$sharedstatedir,;t t
20242 s,@localstatedir@,$localstatedir,;t t
20243 s,@libdir@,$libdir,;t t
20244 s,@includedir@,$includedir,;t t
20245 s,@oldincludedir@,$oldincludedir,;t t
20246 s,@infodir@,$infodir,;t t
20247 s,@mandir@,$mandir,;t t
20248 s,@build_alias@,$build_alias,;t t
20249 s,@host_alias@,$host_alias,;t t
20250 s,@target_alias@,$target_alias,;t t
20251 s,@DEFS@,$DEFS,;t t
20252 s,@ECHO_C@,$ECHO_C,;t t
20253 s,@ECHO_N@,$ECHO_N,;t t
20254 s,@ECHO_T@,$ECHO_T,;t t
20255 s,@LIBS@,$LIBS,;t t
20256 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
20257 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
20258 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
20259 s,@CYGPATH_W@,$CYGPATH_W,;t t
20260 s,@PACKAGE@,$PACKAGE,;t t
20261 s,@VERSION@,$VERSION,;t t
20262 s,@ACLOCAL@,$ACLOCAL,;t t
20263 s,@AUTOCONF@,$AUTOCONF,;t t
20264 s,@AUTOMAKE@,$AUTOMAKE,;t t
20265 s,@AUTOHEADER@,$AUTOHEADER,;t t
20266 s,@MAKEINFO@,$MAKEINFO,;t t
20267 s,@install_sh@,$install_sh,;t t
20268 s,@STRIP@,$STRIP,;t t
20269 s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
20270 s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
20271 s,@mkdir_p@,$mkdir_p,;t t
20272 s,@AWK@,$AWK,;t t
20273 s,@SET_MAKE@,$SET_MAKE,;t t
20274 s,@am__leading_dot@,$am__leading_dot,;t t
20275 s,@AMTAR@,$AMTAR,;t t
20276 s,@am__tar@,$am__tar,;t t
20277 s,@am__untar@,$am__untar,;t t
20278 s,@MAJOR_VERSION@,$MAJOR_VERSION,;t t
20279 s,@MINOR_VERSION@,$MINOR_VERSION,;t t
20280 s,@MICRO_VERSION@,$MICRO_VERSION,;t t
20281 s,@VER_INFO@,$VER_INFO,;t t
20282 s,@slibdir@,$slibdir,;t t
20283 s,@ssbindir@,$ssbindir,;t t
20284 s,@CC@,$CC,;t t
20285 s,@CFLAGS@,$CFLAGS,;t t
20286 s,@LDFLAGS@,$LDFLAGS,;t t
20287 s,@CPPFLAGS@,$CPPFLAGS,;t t
20288 s,@ac_ct_CC@,$ac_ct_CC,;t t
20289 s,@EXEEXT@,$EXEEXT,;t t
20290 s,@OBJEXT@,$OBJEXT,;t t
20291 s,@DEPDIR@,$DEPDIR,;t t
20292 s,@am__include@,$am__include,;t t
20293 s,@am__quote@,$am__quote,;t t
20294 s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
20295 s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
20296 s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
20297 s,@CCDEPMODE@,$CCDEPMODE,;t t
20298 s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
20299 s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
20300 s,@GCC_FVISIBILITY_HIDDEN@,$GCC_FVISIBILITY_HIDDEN,;t t
20301 s,@build@,$build,;t t
20302 s,@build_cpu@,$build_cpu,;t t
20303 s,@build_vendor@,$build_vendor,;t t
20304 s,@build_os@,$build_os,;t t
20305 s,@host@,$host,;t t
20306 s,@host_cpu@,$host_cpu,;t t
20307 s,@host_vendor@,$host_vendor,;t t
20308 s,@host_os@,$host_os,;t t
20309 s,@EGREP@,$EGREP,;t t
20310 s,@LN_S@,$LN_S,;t t
20311 s,@ECHO@,$ECHO,;t t
20312 s,@AR@,$AR,;t t
20313 s,@ac_ct_AR@,$ac_ct_AR,;t t
20314 s,@RANLIB@,$RANLIB,;t t
20315 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
20316 s,@CPP@,$CPP,;t t
20317 s,@CXX@,$CXX,;t t
20318 s,@CXXFLAGS@,$CXXFLAGS,;t t
20319 s,@ac_ct_CXX@,$ac_ct_CXX,;t t
20320 s,@CXXDEPMODE@,$CXXDEPMODE,;t t
20321 s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t
20322 s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t
20323 s,@CXXCPP@,$CXXCPP,;t t
20324 s,@F77@,$F77,;t t
20325 s,@FFLAGS@,$FFLAGS,;t t
20326 s,@ac_ct_F77@,$ac_ct_F77,;t t
20327 s,@LIBTOOL@,$LIBTOOL,;t t
20328 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
20329 s,@GLIB_CFLAGS@,$GLIB_CFLAGS,;t t
20330 s,@GLIB_LIBS@,$GLIB_LIBS,;t t
20331 s,@GLIB_GENMARSHAL@,$GLIB_GENMARSHAL,;t t
20332 s,@GOBJECT_QUERY@,$GOBJECT_QUERY,;t t
20333 s,@GLIB_MKENUMS@,$GLIB_MKENUMS,;t t
20334 s,@FLYN_TRUE@,$FLYN_TRUE,;t t
20335 s,@FLYN_FALSE@,$FLYN_FALSE,;t t
20336 s,@PAM_MODDIR@,$PAM_MODDIR,;t t
20337 s,@LIBOBJS@,$LIBOBJS,;t t
20338 s,@LTLIBOBJS@,$LTLIBOBJS,;t t
20339 CEOF
21967 if test -n "$CONFIG_FILES"; then
2034021968
2034121969 _ACEOF
2034221970
20343 cat >>$CONFIG_STATUS <<\_ACEOF
20344 # Split the substitutions into bite-sized pieces for seds with
20345 # small command number limits, like on Digital OSF/1 and HP-UX.
20346 ac_max_sed_lines=48
20347 ac_sed_frag=1 # Number of current file.
20348 ac_beg=1 # First line for current file.
20349 ac_end=$ac_max_sed_lines # Line after last line for current file.
20350 ac_more_lines=:
20351 ac_sed_cmds=
20352 while $ac_more_lines; do
20353 if test $ac_beg -gt 1; then
20354 sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
20355 else
20356 sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
21971
21972
21973 ac_delim='%!_!# '
21974 for ac_last_try in false false false false false :; do
21975 cat >conf$$subs.sed <<_ACEOF
21976 SHELL!$SHELL$ac_delim
21977 PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
21978 PACKAGE_NAME!$PACKAGE_NAME$ac_delim
21979 PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
21980 PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
21981 PACKAGE_STRING!$PACKAGE_STRING$ac_delim
21982 PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
21983 exec_prefix!$exec_prefix$ac_delim
21984 prefix!$prefix$ac_delim
21985 program_transform_name!$program_transform_name$ac_delim
21986 bindir!$bindir$ac_delim
21987 sbindir!$sbindir$ac_delim
21988 libexecdir!$libexecdir$ac_delim
21989 datarootdir!$datarootdir$ac_delim
21990 datadir!$datadir$ac_delim
21991 sysconfdir!$sysconfdir$ac_delim
21992 sharedstatedir!$sharedstatedir$ac_delim
21993 localstatedir!$localstatedir$ac_delim
21994 includedir!$includedir$ac_delim
21995 oldincludedir!$oldincludedir$ac_delim
21996 docdir!$docdir$ac_delim
21997 infodir!$infodir$ac_delim
21998 htmldir!$htmldir$ac_delim
21999 dvidir!$dvidir$ac_delim
22000 pdfdir!$pdfdir$ac_delim
22001 psdir!$psdir$ac_delim
22002 libdir!$libdir$ac_delim
22003 localedir!$localedir$ac_delim
22004 mandir!$mandir$ac_delim
22005 DEFS!$DEFS$ac_delim
22006 ECHO_C!$ECHO_C$ac_delim
22007 ECHO_N!$ECHO_N$ac_delim
22008 ECHO_T!$ECHO_T$ac_delim
22009 LIBS!$LIBS$ac_delim
22010 build_alias!$build_alias$ac_delim
22011 host_alias!$host_alias$ac_delim
22012 target_alias!$target_alias$ac_delim
22013 INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
22014 INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
22015 INSTALL_DATA!$INSTALL_DATA$ac_delim
22016 CYGPATH_W!$CYGPATH_W$ac_delim
22017 PACKAGE!$PACKAGE$ac_delim
22018 VERSION!$VERSION$ac_delim
22019 ACLOCAL!$ACLOCAL$ac_delim
22020 AUTOCONF!$AUTOCONF$ac_delim
22021 AUTOMAKE!$AUTOMAKE$ac_delim
22022 AUTOHEADER!$AUTOHEADER$ac_delim
22023 MAKEINFO!$MAKEINFO$ac_delim
22024 install_sh!$install_sh$ac_delim
22025 STRIP!$STRIP$ac_delim
22026 INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
22027 mkdir_p!$mkdir_p$ac_delim
22028 AWK!$AWK$ac_delim
22029 SET_MAKE!$SET_MAKE$ac_delim
22030 am__leading_dot!$am__leading_dot$ac_delim
22031 AMTAR!$AMTAR$ac_delim
22032 am__tar!$am__tar$ac_delim
22033 am__untar!$am__untar$ac_delim
22034 CC!$CC$ac_delim
22035 CFLAGS!$CFLAGS$ac_delim
22036 LDFLAGS!$LDFLAGS$ac_delim
22037 CPPFLAGS!$CPPFLAGS$ac_delim
22038 ac_ct_CC!$ac_ct_CC$ac_delim
22039 EXEEXT!$EXEEXT$ac_delim
22040 OBJEXT!$OBJEXT$ac_delim
22041 DEPDIR!$DEPDIR$ac_delim
22042 am__include!$am__include$ac_delim
22043 am__quote!$am__quote$ac_delim
22044 AMDEP_TRUE!$AMDEP_TRUE$ac_delim
22045 AMDEP_FALSE!$AMDEP_FALSE$ac_delim
22046 AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
22047 CCDEPMODE!$CCDEPMODE$ac_delim
22048 am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
22049 am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
22050 build!$build$ac_delim
22051 build_cpu!$build_cpu$ac_delim
22052 build_vendor!$build_vendor$ac_delim
22053 build_os!$build_os$ac_delim
22054 host!$host$ac_delim
22055 host_cpu!$host_cpu$ac_delim
22056 host_vendor!$host_vendor$ac_delim
22057 host_os!$host_os$ac_delim
22058 GREP!$GREP$ac_delim
22059 EGREP!$EGREP$ac_delim
22060 LN_S!$LN_S$ac_delim
22061 ECHO!$ECHO$ac_delim
22062 AR!$AR$ac_delim
22063 RANLIB!$RANLIB$ac_delim
22064 CPP!$CPP$ac_delim
22065 CXX!$CXX$ac_delim
22066 CXXFLAGS!$CXXFLAGS$ac_delim
22067 ac_ct_CXX!$ac_ct_CXX$ac_delim
22068 CXXDEPMODE!$CXXDEPMODE$ac_delim
22069 am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim
22070 am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim
22071 CXXCPP!$CXXCPP$ac_delim
22072 F77!$F77$ac_delim
22073 _ACEOF
22074
22075 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
22076 break
22077 elif $ac_last_try; then
22078 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
22079 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
22080 { (exit 1); exit 1; }; }
22081 else
22082 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
22083 fi
22084 done
22085
22086 ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
22087 if test -n "$ac_eof"; then
22088 ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
22089 ac_eof=`expr $ac_eof + 1`
22090 fi
22091
22092 cat >>$CONFIG_STATUS <<_ACEOF
22093 cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
22094 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
22095 _ACEOF
22096 sed '
22097 s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
22098 s/^/s,@/; s/!/@,|#_!!_#|/
22099 :n
22100 t n
22101 s/'"$ac_delim"'$/,g/; t
22102 s/$/\\/; p
22103 N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
22104 ' >>$CONFIG_STATUS <conf$$subs.sed
22105 rm -f conf$$subs.sed
22106 cat >>$CONFIG_STATUS <<_ACEOF
22107 CEOF$ac_eof
22108 _ACEOF
22109
22110
22111 ac_delim='%!_!# '
22112 for ac_last_try in false false false false false :; do
22113 cat >conf$$subs.sed <<_ACEOF
22114 FFLAGS!$FFLAGS$ac_delim
22115 ac_ct_F77!$ac_ct_F77$ac_delim
22116 LIBTOOL!$LIBTOOL$ac_delim
22117 PKG_CONFIG!$PKG_CONFIG$ac_delim
22118 GLIB_CFLAGS!$GLIB_CFLAGS$ac_delim
22119 GLIB_LIBS!$GLIB_LIBS$ac_delim
22120 GLIB_GENMARSHAL!$GLIB_GENMARSHAL$ac_delim
22121 GOBJECT_QUERY!$GOBJECT_QUERY$ac_delim
22122 GLIB_MKENUMS!$GLIB_MKENUMS$ac_delim
22123 XML2_CONFIG!$XML2_CONFIG$ac_delim
22124 XML_CPPFLAGS!$XML_CPPFLAGS$ac_delim
22125 XML_LIBS!$XML_LIBS$ac_delim
22126 slibdir!$slibdir$ac_delim
22127 ssbindir!$ssbindir$ac_delim
22128 GCC_FVISIBILITY_HIDDEN!$GCC_FVISIBILITY_HIDDEN$ac_delim
22129 regular_CFLAGS!$regular_CFLAGS$ac_delim
22130 PAM_MODDIR!$PAM_MODDIR$ac_delim
22131 LIBOBJS!$LIBOBJS$ac_delim
22132 LTLIBOBJS!$LTLIBOBJS$ac_delim
22133 _ACEOF
22134
22135 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 19; then
22136 break
22137 elif $ac_last_try; then
22138 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
22139 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
22140 { (exit 1); exit 1; }; }
22141 else
22142 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
22143 fi
22144 done
22145
22146 ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
22147 if test -n "$ac_eof"; then
22148 ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
22149 ac_eof=`expr $ac_eof + 1`
22150 fi
22151
22152 cat >>$CONFIG_STATUS <<_ACEOF
22153 cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
22154 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
22155 _ACEOF
22156 sed '
22157 s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
22158 s/^/s,@/; s/!/@,|#_!!_#|/
22159 :n
22160 t n
22161 s/'"$ac_delim"'$/,g/; t
22162 s/$/\\/; p
22163 N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
22164 ' >>$CONFIG_STATUS <conf$$subs.sed
22165 rm -f conf$$subs.sed
22166 cat >>$CONFIG_STATUS <<_ACEOF
22167 :end
22168 s/|#_!!_#|//g
22169 CEOF$ac_eof
22170 _ACEOF
22171
22172
22173 # VPATH may cause trouble with some makes, so we remove $(srcdir),
22174 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
22175 # trailing colons and then remove the whole line if VPATH becomes empty
22176 # (actually we leave an empty line to preserve line numbers).
22177 if test "x$srcdir" = x.; then
22178 ac_vpsub='/^[ ]*VPATH[ ]*=/{
22179 s/:*\$(srcdir):*/:/
22180 s/:*\${srcdir}:*/:/
22181 s/:*@srcdir@:*/:/
22182 s/^\([^=]*=[ ]*\):*/\1/
22183 s/:*$//
22184 s/^[^=]*=[ ]*$//
22185 }'
22186 fi
22187
22188 cat >>$CONFIG_STATUS <<\_ACEOF
22189 fi # test -n "$CONFIG_FILES"
22190
22191
22192 for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS
22193 do
22194 case $ac_tag in
22195 :[FHLC]) ac_mode=$ac_tag; continue;;
22196 esac
22197 case $ac_mode$ac_tag in
22198 :[FHL]*:*);;
22199 :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
22200 echo "$as_me: error: Invalid tag $ac_tag." >&2;}
22201 { (exit 1); exit 1; }; };;
22202 :[FH]-) ac_tag=-:-;;
22203 :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
22204 esac
22205 ac_save_IFS=$IFS
22206 IFS=:
22207 set x $ac_tag
22208 IFS=$ac_save_IFS
22209 shift
22210 ac_file=$1
22211 shift
22212
22213 case $ac_mode in
22214 :L) ac_source=$1;;
22215 :[FH])
22216 ac_file_inputs=
22217 for ac_f
22218 do
22219 case $ac_f in
22220 -) ac_f="$tmp/stdin";;
22221 *) # Look for the file first in the build tree, then in the source tree
22222 # (if the path is not absolute). The absolute path cannot be DOS-style,
22223 # because $ac_f cannot contain `:'.
22224 test -f "$ac_f" ||
22225 case $ac_f in
22226 [\\/$]*) false;;
22227 *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
22228 esac ||
22229 { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
22230 echo "$as_me: error: cannot find input file: $ac_f" >&2;}
22231 { (exit 1); exit 1; }; };;
22232 esac
22233 ac_file_inputs="$ac_file_inputs $ac_f"
22234 done
22235
22236 # Let's still pretend it is `configure' which instantiates (i.e., don't
22237 # use $as_me), people would be surprised to read:
22238 # /* config.h. Generated by config.status. */
22239 configure_input="Generated from "`IFS=:
22240 echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
22241 if test x"$ac_file" != x-; then
22242 configure_input="$ac_file. $configure_input"
22243 { echo "$as_me:$LINENO: creating $ac_file" >&5
22244 echo "$as_me: creating $ac_file" >&6;}
2035722245 fi
20358 if test ! -s $tmp/subs.frag; then
20359 ac_more_lines=false
20360 else
20361 # The purpose of the label and of the branching condition is to
20362 # speed up the sed processing (if there are no `@' at all, there
20363 # is no need to browse any of the substitutions).
20364 # These are the two extra sed commands mentioned above.
20365 (echo ':t
20366 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
20367 if test -z "$ac_sed_cmds"; then
20368 ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
20369 else
20370 ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
20371 fi
20372 ac_sed_frag=`expr $ac_sed_frag + 1`
20373 ac_beg=$ac_end
20374 ac_end=`expr $ac_end + $ac_max_sed_lines`
20375 fi
20376 done
20377 if test -z "$ac_sed_cmds"; then
20378 ac_sed_cmds=cat
20379 fi
20380 fi # test -n "$CONFIG_FILES"
20381
20382 _ACEOF
20383 cat >>$CONFIG_STATUS <<\_ACEOF
20384 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
20385 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
20386 case $ac_file in
20387 - | *:- | *:-:* ) # input from stdin
20388 cat >$tmp/stdin
20389 ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
20390 ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
20391 *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
20392 ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
20393 * ) ac_file_in=$ac_file.in ;;
22246
22247 case $ac_tag in
22248 *:-:* | *:-) cat >"$tmp/stdin";;
22249 esac
22250 ;;
2039422251 esac
2039522252
20396 # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
20397 ac_dir=`(dirname "$ac_file") 2>/dev/null ||
22253 ac_dir=`$as_dirname -- "$ac_file" ||
2039822254 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
2039922255 X"$ac_file" : 'X\(//\)[^/]' \| \
2040022256 X"$ac_file" : 'X\(//\)$' \| \
20401 X"$ac_file" : 'X\(/\)' \| \
20402 . : '\(.\)' 2>/dev/null ||
22257 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
2040322258 echo X"$ac_file" |
20404 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
20405 /^X\(\/\/\)[^/].*/{ s//\1/; q; }
20406 /^X\(\/\/\)$/{ s//\1/; q; }
20407 /^X\(\/\).*/{ s//\1/; q; }
20408 s/.*/./; q'`
20409 { if $as_mkdir_p; then
20410 mkdir -p "$ac_dir"
20411 else
20412 as_dir="$ac_dir"
22259 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
22260 s//\1/
22261 q
22262 }
22263 /^X\(\/\/\)[^/].*/{
22264 s//\1/
22265 q
22266 }
22267 /^X\(\/\/\)$/{
22268 s//\1/
22269 q
22270 }
22271 /^X\(\/\).*/{
22272 s//\1/
22273 q
22274 }
22275 s/.*/./; q'`
22276 { as_dir="$ac_dir"
22277 case $as_dir in #(
22278 -*) as_dir=./$as_dir;;
22279 esac
22280 test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
2041322281 as_dirs=
20414 while test ! -d "$as_dir"; do
20415 as_dirs="$as_dir $as_dirs"
20416 as_dir=`(dirname "$as_dir") 2>/dev/null ||
22282 while :; do
22283 case $as_dir in #(
22284 *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
22285 *) as_qdir=$as_dir;;
22286 esac
22287 as_dirs="'$as_qdir' $as_dirs"
22288 as_dir=`$as_dirname -- "$as_dir" ||
2041722289 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
2041822290 X"$as_dir" : 'X\(//\)[^/]' \| \
2041922291 X"$as_dir" : 'X\(//\)$' \| \
20420 X"$as_dir" : 'X\(/\)' \| \
20421 . : '\(.\)' 2>/dev/null ||
22292 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
2042222293 echo X"$as_dir" |
20423 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
20424 /^X\(\/\/\)[^/].*/{ s//\1/; q; }
20425 /^X\(\/\/\)$/{ s//\1/; q; }
20426 /^X\(\/\).*/{ s//\1/; q; }
20427 s/.*/./; q'`
22294 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
22295 s//\1/
22296 q
22297 }
22298 /^X\(\/\/\)[^/].*/{
22299 s//\1/
22300 q
22301 }
22302 /^X\(\/\/\)$/{
22303 s//\1/
22304 q
22305 }
22306 /^X\(\/\).*/{
22307 s//\1/
22308 q
22309 }
22310 s/.*/./; q'`
22311 test -d "$as_dir" && break
2042822312 done
20429 test ! -n "$as_dirs" || mkdir $as_dirs
20430 fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
20431 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
22313 test -z "$as_dirs" || eval "mkdir $as_dirs"
22314 } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
22315 echo "$as_me: error: cannot create directory $as_dir" >&2;}
2043222316 { (exit 1); exit 1; }; }; }
20433
2043422317 ac_builddir=.
2043522318
20436 if test "$ac_dir" != .; then
22319 case "$ac_dir" in
22320 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
22321 *)
2043722322 ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
20438 # A "../" for each directory in $ac_dir_suffix.
20439 ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
20440 else
20441 ac_dir_suffix= ac_top_builddir=
20442 fi
22323 # A ".." for each directory in $ac_dir_suffix.
22324 ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
22325 case $ac_top_builddir_sub in
22326 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
22327 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
22328 esac ;;
22329 esac
22330 ac_abs_top_builddir=$ac_pwd
22331 ac_abs_builddir=$ac_pwd$ac_dir_suffix
22332 # for backward compatibility:
22333 ac_top_builddir=$ac_top_build_prefix
2044322334
2044422335 case $srcdir in
20445 .) # No --srcdir option. We are building in place.
22336 .) # We are building in place.
2044622337 ac_srcdir=.
20447 if test -z "$ac_top_builddir"; then
20448 ac_top_srcdir=.
20449 else
20450 ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
20451 fi ;;
20452 [\\/]* | ?:[\\/]* ) # Absolute path.
22338 ac_top_srcdir=$ac_top_builddir_sub
22339 ac_abs_top_srcdir=$ac_pwd ;;
22340 [\\/]* | ?:[\\/]* ) # Absolute name.
2045322341 ac_srcdir=$srcdir$ac_dir_suffix;
20454 ac_top_srcdir=$srcdir ;;
20455 *) # Relative path.
20456 ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
20457 ac_top_srcdir=$ac_top_builddir$srcdir ;;
22342 ac_top_srcdir=$srcdir
22343 ac_abs_top_srcdir=$srcdir ;;
22344 *) # Relative name.
22345 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
22346 ac_top_srcdir=$ac_top_build_prefix$srcdir
22347 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
2045822348 esac
20459
20460 # Do not use `cd foo && pwd` to compute absolute paths, because
20461 # the directories may not exist.
20462 case `pwd` in
20463 .) ac_abs_builddir="$ac_dir";;
20464 *)
20465 case "$ac_dir" in
20466 .) ac_abs_builddir=`pwd`;;
20467 [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
20468 *) ac_abs_builddir=`pwd`/"$ac_dir";;
20469 esac;;
20470 esac
20471 case $ac_abs_builddir in
20472 .) ac_abs_top_builddir=${ac_top_builddir}.;;
20473 *)
20474 case ${ac_top_builddir}. in
20475 .) ac_abs_top_builddir=$ac_abs_builddir;;
20476 [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
20477 *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
20478 esac;;
20479 esac
20480 case $ac_abs_builddir in
20481 .) ac_abs_srcdir=$ac_srcdir;;
20482 *)
20483 case $ac_srcdir in
20484 .) ac_abs_srcdir=$ac_abs_builddir;;
20485 [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
20486 *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
20487 esac;;
20488 esac
20489 case $ac_abs_builddir in
20490 .) ac_abs_top_srcdir=$ac_top_srcdir;;
20491 *)
20492 case $ac_top_srcdir in
20493 .) ac_abs_top_srcdir=$ac_abs_builddir;;
20494 [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
20495 *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
20496 esac;;
20497 esac
20498
22349 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
22350
22351
22352 case $ac_mode in
22353 :F)
22354 #
22355 # CONFIG_FILE
22356 #
2049922357
2050022358 case $INSTALL in
2050122359 [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
20502 *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
22360 *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
2050322361 esac
20504
20505 if test x"$ac_file" != x-; then
20506 { echo "$as_me:$LINENO: creating $ac_file" >&5
20507 echo "$as_me: creating $ac_file" >&6;}
20508 rm -f "$ac_file"
20509 fi
20510 # Let's still pretend it is `configure' which instantiates (i.e., don't
20511 # use $as_me), people would be surprised to read:
20512 # /* config.h. Generated by config.status. */
20513 if test x"$ac_file" = x-; then
20514 configure_input=
20515 else
20516 configure_input="$ac_file. "
20517 fi
20518 configure_input=$configure_input"Generated from `echo $ac_file_in |
20519 sed 's,.*/,,'` by configure."
20520
20521 # First look for the input files in the build tree, otherwise in the
20522 # src tree.
20523 ac_file_inputs=`IFS=:
20524 for f in $ac_file_in; do
20525 case $f in
20526 -) echo $tmp/stdin ;;
20527 [\\/$]*)
20528 # Absolute (can't be DOS-style, as IFS=:)
20529 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
20530 echo "$as_me: error: cannot find input file: $f" >&2;}
20531 { (exit 1); exit 1; }; }
20532 echo "$f";;
20533 *) # Relative
20534 if test -f "$f"; then
20535 # Build tree
20536 echo "$f"
20537 elif test -f "$srcdir/$f"; then
20538 # Source tree
20539 echo "$srcdir/$f"
20540 else
20541 # /dev/null tree
20542 { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
20543 echo "$as_me: error: cannot find input file: $f" >&2;}
20544 { (exit 1); exit 1; }; }
20545 fi;;
20546 esac
20547 done` || { (exit 1); exit 1; }
2054822362 _ACEOF
22363
22364 cat >>$CONFIG_STATUS <<\_ACEOF
22365 # If the template does not know about datarootdir, expand it.
22366 # FIXME: This hack should be removed a few years after 2.60.
22367 ac_datarootdir_hack=; ac_datarootdir_seen=
22368
22369 case `sed -n '/datarootdir/ {
22370 p
22371 q
22372 }
22373 /@datadir@/p
22374 /@docdir@/p
22375 /@infodir@/p
22376 /@localedir@/p
22377 /@mandir@/p
22378 ' $ac_file_inputs` in
22379 *datarootdir*) ac_datarootdir_seen=yes;;
22380 *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
22381 { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
22382 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
22383 _ACEOF
22384 cat >>$CONFIG_STATUS <<_ACEOF
22385 ac_datarootdir_hack='
22386 s&@datadir@&$datadir&g
22387 s&@docdir@&$docdir&g
22388 s&@infodir@&$infodir&g
22389 s&@localedir@&$localedir&g
22390 s&@mandir@&$mandir&g
22391 s&\\\${datarootdir}&$datarootdir&g' ;;
22392 esac
22393 _ACEOF
22394
22395 # Neutralize VPATH when `$srcdir' = `.'.
22396 # Shell code in configure.ac might set extrasub.
22397 # FIXME: do we really want to maintain this feature?
2054922398 cat >>$CONFIG_STATUS <<_ACEOF
2055022399 sed "$ac_vpsub
2055122400 $extrasub
2055322402 cat >>$CONFIG_STATUS <<\_ACEOF
2055422403 :t
2055522404 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
20556 s,@configure_input@,$configure_input,;t t
20557 s,@srcdir@,$ac_srcdir,;t t
20558 s,@abs_srcdir@,$ac_abs_srcdir,;t t
20559 s,@top_srcdir@,$ac_top_srcdir,;t t
20560 s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
20561 s,@builddir@,$ac_builddir,;t t
20562 s,@abs_builddir@,$ac_abs_builddir,;t t
20563 s,@top_builddir@,$ac_top_builddir,;t t
20564 s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
20565 s,@INSTALL@,$ac_INSTALL,;t t
20566 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
20567 rm -f $tmp/stdin
20568 if test x"$ac_file" != x-; then
20569 mv $tmp/out $ac_file
20570 else
20571 cat $tmp/out
20572 rm -f $tmp/out
20573 fi
20574
20575 done
22405 s&@configure_input@&$configure_input&;t t
22406 s&@top_builddir@&$ac_top_builddir_sub&;t t
22407 s&@srcdir@&$ac_srcdir&;t t
22408 s&@abs_srcdir@&$ac_abs_srcdir&;t t
22409 s&@top_srcdir@&$ac_top_srcdir&;t t
22410 s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
22411 s&@builddir@&$ac_builddir&;t t
22412 s&@abs_builddir@&$ac_abs_builddir&;t t
22413 s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
22414 s&@INSTALL@&$ac_INSTALL&;t t
22415 $ac_datarootdir_hack
22416 " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
22417
22418 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
22419 { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
22420 { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
22421 { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
22422 which seems to be undefined. Please make sure it is defined." >&5
22423 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
22424 which seems to be undefined. Please make sure it is defined." >&2;}
22425
22426 rm -f "$tmp/stdin"
22427 case $ac_file in
22428 -) cat "$tmp/out"; rm -f "$tmp/out";;
22429 *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
22430 esac
22431 ;;
22432 :H)
22433 #
22434 # CONFIG_HEADER
22435 #
2057622436 _ACEOF
20577 cat >>$CONFIG_STATUS <<\_ACEOF
20578
20579 #
20580 # CONFIG_HEADER section.
20581 #
20582
20583 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
20584 # NAME is the cpp macro being defined and VALUE is the value it is being given.
20585 #
20586 # ac_d sets the value in "#define NAME VALUE" lines.
20587 ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
20588 ac_dB='[ ].*$,\1#\2'
22437
22438 # Transform confdefs.h into a sed script `conftest.defines', that
22439 # substitutes the proper values into config.h.in to produce config.h.
22440 rm -f conftest.defines conftest.tail
22441 # First, append a space to every undef/define line, to ease matching.
22442 echo 's/$/ /' >conftest.defines
22443 # Then, protect against being on the right side of a sed subst, or in
22444 # an unquoted here document, in config.status. If some macros were
22445 # called several times there might be several #defines for the same
22446 # symbol, which is useless. But do not sort them, since the last
22447 # AC_DEFINE must be honored.
22448 ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
22449 # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
22450 # NAME is the cpp macro being defined, VALUE is the value it is being given.
22451 # PARAMS is the parameter list in the macro definition--in most cases, it's
22452 # just an empty string.
22453 ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*'
22454 ac_dB='\\)[ (].*,\\1define\\2'
2058922455 ac_dC=' '
20590 ac_dD=',;t'
20591 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
20592 ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
20593 ac_uB='$,\1#\2define\3'
20594 ac_uC=' '
20595 ac_uD=',;t'
20596
20597 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
20598 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
20599 case $ac_file in
20600 - | *:- | *:-:* ) # input from stdin
20601 cat >$tmp/stdin
20602 ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
20603 ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
20604 *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
20605 ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
20606 * ) ac_file_in=$ac_file.in ;;
20607 esac
20608
20609 test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
20610 echo "$as_me: creating $ac_file" >&6;}
20611
20612 # First look for the input files in the build tree, otherwise in the
20613 # src tree.
20614 ac_file_inputs=`IFS=:
20615 for f in $ac_file_in; do
20616 case $f in
20617 -) echo $tmp/stdin ;;
20618 [\\/$]*)
20619 # Absolute (can't be DOS-style, as IFS=:)
20620 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
20621 echo "$as_me: error: cannot find input file: $f" >&2;}
20622 { (exit 1); exit 1; }; }
20623 # Do quote $f, to prevent DOS paths from being IFS'd.
20624 echo "$f";;
20625 *) # Relative
20626 if test -f "$f"; then
20627 # Build tree
20628 echo "$f"
20629 elif test -f "$srcdir/$f"; then
20630 # Source tree
20631 echo "$srcdir/$f"
20632 else
20633 # /dev/null tree
20634 { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
20635 echo "$as_me: error: cannot find input file: $f" >&2;}
20636 { (exit 1); exit 1; }; }
20637 fi;;
20638 esac
20639 done` || { (exit 1); exit 1; }
20640 # Remove the trailing spaces.
20641 sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
20642
20643 _ACEOF
20644
20645 # Transform confdefs.h into two sed scripts, `conftest.defines' and
20646 # `conftest.undefs', that substitutes the proper values into
20647 # config.h.in to produce config.h. The first handles `#define'
20648 # templates, and the second `#undef' templates.
20649 # And first: Protect against being on the right side of a sed subst in
20650 # config.status. Protect against being in an unquoted here document
20651 # in config.status.
20652 rm -f conftest.defines conftest.undefs
20653 # Using a here document instead of a string reduces the quoting nightmare.
20654 # Putting comments in sed scripts is not portable.
20655 #
20656 # `end' is used to avoid that the second main sed command (meant for
20657 # 0-ary CPP macros) applies to n-ary macro definitions.
20658 # See the Autoconf documentation for `clear'.
20659 cat >confdef2sed.sed <<\_ACEOF
20660 s/[\\&,]/\\&/g
20661 s,[\\$`],\\&,g
20662 t clear
20663 : clear
20664 s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
20665 t end
20666 s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
20667 : end
20668 _ACEOF
20669 # If some macros were called several times there might be several times
20670 # the same #defines, which is useless. Nevertheless, we may not want to
20671 # sort them, since we want the *last* AC-DEFINE to be honored.
20672 uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
20673 sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
20674 rm -f confdef2sed.sed
20675
20676 # This sed command replaces #undef with comments. This is necessary, for
22456 ac_dD=' ,'
22457
22458 uniq confdefs.h |
22459 sed -n '
22460 t rset
22461 :rset
22462 s/^[ ]*#[ ]*define[ ][ ]*//
22463 t ok
22464 d
22465 :ok
22466 s/[\\&,]/\\&/g
22467 s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
22468 s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
22469 ' >>conftest.defines
22470
22471 # Remove the space that was appended to ease matching.
22472 # Then replace #undef with comments. This is necessary, for
2067722473 # example, in the case of _POSIX_SOURCE, which is predefined and required
2067822474 # on some systems where configure will not decide to define it.
20679 cat >>conftest.undefs <<\_ACEOF
20680 s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
22475 # (The regexp can be short, since the line contains either #define or #undef.)
22476 echo 's/ $//
22477 s,^[ #]*u.*,/* & */,' >>conftest.defines
22478
22479 # Break up conftest.defines:
22480 ac_max_sed_lines=50
22481
22482 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1"
22483 # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2"
22484 # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1"
22485 # et cetera.
22486 ac_in='$ac_file_inputs'
22487 ac_out='"$tmp/out1"'
22488 ac_nxt='"$tmp/out2"'
22489
22490 while :
22491 do
22492 # Write a here document:
22493 cat >>$CONFIG_STATUS <<_ACEOF
22494 # First, check the format of the line:
22495 cat >"\$tmp/defines.sed" <<\\CEOF
22496 /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def
22497 /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def
22498 b
22499 :def
2068122500 _ACEOF
20682
20683 # Break up conftest.defines because some shells have a limit on the size
20684 # of here documents, and old seds have small limits too (100 cmds).
20685 echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
20686 echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
20687 echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
20688 echo ' :' >>$CONFIG_STATUS
20689 rm -f conftest.tail
20690 while grep . conftest.defines >/dev/null
20691 do
20692 # Write a limited-size here document to $tmp/defines.sed.
20693 echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
20694 # Speed up: don't consider the non `#define' lines.
20695 echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
20696 # Work around the forget-to-reset-the-flag bug.
20697 echo 't clr' >>$CONFIG_STATUS
20698 echo ': clr' >>$CONFIG_STATUS
20699 sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
22501 sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
2070022502 echo 'CEOF
20701 sed -f $tmp/defines.sed $tmp/in >$tmp/out
20702 rm -f $tmp/in
20703 mv $tmp/out $tmp/in
20704 ' >>$CONFIG_STATUS
20705 sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
22503 sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
22504 ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
22505 sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
22506 grep . conftest.tail >/dev/null || break
2070622507 rm -f conftest.defines
2070722508 mv conftest.tail conftest.defines
2070822509 done
20709 rm -f conftest.defines
20710 echo ' fi # grep' >>$CONFIG_STATUS
20711 echo >>$CONFIG_STATUS
20712
20713 # Break up conftest.undefs because some shells have a limit on the size
20714 # of here documents, and old seds have small limits too (100 cmds).
20715 echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
20716 rm -f conftest.tail
20717 while grep . conftest.undefs >/dev/null
20718 do
20719 # Write a limited-size here document to $tmp/undefs.sed.
20720 echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
20721 # Speed up: don't consider the non `#undef'
20722 echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
20723 # Work around the forget-to-reset-the-flag bug.
20724 echo 't clr' >>$CONFIG_STATUS
20725 echo ': clr' >>$CONFIG_STATUS
20726 sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
20727 echo 'CEOF
20728 sed -f $tmp/undefs.sed $tmp/in >$tmp/out
20729 rm -f $tmp/in
20730 mv $tmp/out $tmp/in
20731 ' >>$CONFIG_STATUS
20732 sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
20733 rm -f conftest.undefs
20734 mv conftest.tail conftest.undefs
20735 done
20736 rm -f conftest.undefs
20737
22510 rm -f conftest.defines conftest.tail
22511
22512 echo "ac_result=$ac_in" >>$CONFIG_STATUS
2073822513 cat >>$CONFIG_STATUS <<\_ACEOF
20739 # Let's still pretend it is `configure' which instantiates (i.e., don't
20740 # use $as_me), people would be surprised to read:
20741 # /* config.h. Generated by config.status. */
20742 if test x"$ac_file" = x-; then
20743 echo "/* Generated by configure. */" >$tmp/config.h
20744 else
20745 echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
20746 fi
20747 cat $tmp/in >>$tmp/config.h
20748 rm -f $tmp/in
2074922514 if test x"$ac_file" != x-; then
20750 if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
22515 echo "/* $configure_input */" >"$tmp/config.h"
22516 cat "$ac_result" >>"$tmp/config.h"
22517 if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
2075122518 { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
2075222519 echo "$as_me: $ac_file is unchanged" >&6;}
2075322520 else
20754 ac_dir=`(dirname "$ac_file") 2>/dev/null ||
20755 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
20756 X"$ac_file" : 'X\(//\)[^/]' \| \
20757 X"$ac_file" : 'X\(//\)$' \| \
20758 X"$ac_file" : 'X\(/\)' \| \
20759 . : '\(.\)' 2>/dev/null ||
20760 echo X"$ac_file" |
20761 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
20762 /^X\(\/\/\)[^/].*/{ s//\1/; q; }
20763 /^X\(\/\/\)$/{ s//\1/; q; }
20764 /^X\(\/\).*/{ s//\1/; q; }
20765 s/.*/./; q'`
20766 { if $as_mkdir_p; then
20767 mkdir -p "$ac_dir"
20768 else
20769 as_dir="$ac_dir"
20770 as_dirs=
20771 while test ! -d "$as_dir"; do
20772 as_dirs="$as_dir $as_dirs"
20773 as_dir=`(dirname "$as_dir") 2>/dev/null ||
20774 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
20775 X"$as_dir" : 'X\(//\)[^/]' \| \
20776 X"$as_dir" : 'X\(//\)$' \| \
20777 X"$as_dir" : 'X\(/\)' \| \
20778 . : '\(.\)' 2>/dev/null ||
20779 echo X"$as_dir" |
20780 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
20781 /^X\(\/\/\)[^/].*/{ s//\1/; q; }
20782 /^X\(\/\/\)$/{ s//\1/; q; }
20783 /^X\(\/\).*/{ s//\1/; q; }
20784 s/.*/./; q'`
20785 done
20786 test ! -n "$as_dirs" || mkdir $as_dirs
20787 fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
20788 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
20789 { (exit 1); exit 1; }; }; }
20790
2079122521 rm -f $ac_file
20792 mv $tmp/config.h $ac_file
22522 mv "$tmp/config.h" $ac_file
2079322523 fi
2079422524 else
20795 cat $tmp/config.h
20796 rm -f $tmp/config.h
22525 echo "/* $configure_input */"
22526 cat "$ac_result"
2079722527 fi
22528 rm -f "$tmp/out12"
2079822529 # Compute $ac_file's index in $config_headers.
2079922530 _am_stamp_count=1
2080022531 for _am_header in $config_headers :; do
2080522536 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
2080622537 esac
2080722538 done
20808 echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
22539 echo "timestamp for $ac_file" >`$as_dirname -- $ac_file ||
2080922540 $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
2081022541 X$ac_file : 'X\(//\)[^/]' \| \
2081122542 X$ac_file : 'X\(//\)$' \| \
20812 X$ac_file : 'X\(/\)' \| \
20813 . : '\(.\)' 2>/dev/null ||
22543 X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
2081422544 echo X$ac_file |
20815 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
20816 /^X\(\/\/\)[^/].*/{ s//\1/; q; }
20817 /^X\(\/\/\)$/{ s//\1/; q; }
20818 /^X\(\/\).*/{ s//\1/; q; }
20819 s/.*/./; q'`/stamp-h$_am_stamp_count
20820 done
20821 _ACEOF
20822 cat >>$CONFIG_STATUS <<\_ACEOF
20823
20824 #
20825 # CONFIG_COMMANDS section.
20826 #
20827 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
20828 ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
20829 ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
20830 ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
20831 $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
20832 X"$ac_dest" : 'X\(//\)[^/]' \| \
20833 X"$ac_dest" : 'X\(//\)$' \| \
20834 X"$ac_dest" : 'X\(/\)' \| \
20835 . : '\(.\)' 2>/dev/null ||
20836 echo X"$ac_dest" |
20837 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
20838 /^X\(\/\/\)[^/].*/{ s//\1/; q; }
20839 /^X\(\/\/\)$/{ s//\1/; q; }
20840 /^X\(\/\).*/{ s//\1/; q; }
20841 s/.*/./; q'`
20842 { if $as_mkdir_p; then
20843 mkdir -p "$ac_dir"
20844 else
20845 as_dir="$ac_dir"
20846 as_dirs=
20847 while test ! -d "$as_dir"; do
20848 as_dirs="$as_dir $as_dirs"
20849 as_dir=`(dirname "$as_dir") 2>/dev/null ||
20850 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
20851 X"$as_dir" : 'X\(//\)[^/]' \| \
20852 X"$as_dir" : 'X\(//\)$' \| \
20853 X"$as_dir" : 'X\(/\)' \| \
20854 . : '\(.\)' 2>/dev/null ||
20855 echo X"$as_dir" |
20856 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
20857 /^X\(\/\/\)[^/].*/{ s//\1/; q; }
20858 /^X\(\/\/\)$/{ s//\1/; q; }
20859 /^X\(\/\).*/{ s//\1/; q; }
20860 s/.*/./; q'`
20861 done
20862 test ! -n "$as_dirs" || mkdir $as_dirs
20863 fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
20864 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
20865 { (exit 1); exit 1; }; }; }
20866
20867 ac_builddir=.
20868
20869 if test "$ac_dir" != .; then
20870 ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
20871 # A "../" for each directory in $ac_dir_suffix.
20872 ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
20873 else
20874 ac_dir_suffix= ac_top_builddir=
20875 fi
20876
20877 case $srcdir in
20878 .) # No --srcdir option. We are building in place.
20879 ac_srcdir=.
20880 if test -z "$ac_top_builddir"; then
20881 ac_top_srcdir=.
20882 else
20883 ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
20884 fi ;;
20885 [\\/]* | ?:[\\/]* ) # Absolute path.
20886 ac_srcdir=$srcdir$ac_dir_suffix;
20887 ac_top_srcdir=$srcdir ;;
20888 *) # Relative path.
20889 ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
20890 ac_top_srcdir=$ac_top_builddir$srcdir ;;
20891 esac
20892
20893 # Do not use `cd foo && pwd` to compute absolute paths, because
20894 # the directories may not exist.
20895 case `pwd` in
20896 .) ac_abs_builddir="$ac_dir";;
20897 *)
20898 case "$ac_dir" in
20899 .) ac_abs_builddir=`pwd`;;
20900 [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
20901 *) ac_abs_builddir=`pwd`/"$ac_dir";;
20902 esac;;
20903 esac
20904 case $ac_abs_builddir in
20905 .) ac_abs_top_builddir=${ac_top_builddir}.;;
20906 *)
20907 case ${ac_top_builddir}. in
20908 .) ac_abs_top_builddir=$ac_abs_builddir;;
20909 [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
20910 *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
20911 esac;;
20912 esac
20913 case $ac_abs_builddir in
20914 .) ac_abs_srcdir=$ac_srcdir;;
20915 *)
20916 case $ac_srcdir in
20917 .) ac_abs_srcdir=$ac_abs_builddir;;
20918 [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
20919 *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
20920 esac;;
20921 esac
20922 case $ac_abs_builddir in
20923 .) ac_abs_top_srcdir=$ac_top_srcdir;;
20924 *)
20925 case $ac_top_srcdir in
20926 .) ac_abs_top_srcdir=$ac_abs_builddir;;
20927 [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
20928 *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
20929 esac;;
20930 esac
20931
20932
20933 { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
20934 echo "$as_me: executing $ac_dest commands" >&6;}
20935 case $ac_dest in
20936 depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
22545 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
22546 s//\1/
22547 q
22548 }
22549 /^X\(\/\/\)[^/].*/{
22550 s//\1/
22551 q
22552 }
22553 /^X\(\/\/\)$/{
22554 s//\1/
22555 q
22556 }
22557 /^X\(\/\).*/{
22558 s//\1/
22559 q
22560 }
22561 s/.*/./; q'`/stamp-h$_am_stamp_count
22562 ;;
22563
22564 :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5
22565 echo "$as_me: executing $ac_file commands" >&6;}
22566 ;;
22567 esac
22568
22569
22570 case $ac_file$ac_mode in
22571 "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
2093722572 # Strip MF so we end up with the name of the file.
2093822573 mf=`echo "$mf" | sed -e 's/:.*$//'`
2093922574 # Check whether this is an Automake generated Makefile or not.
2094322578 # each Makefile.in and add a new line on top of each file to say so.
2094422579 # So let's grep whole file.
2094522580 if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
20946 dirpart=`(dirname "$mf") 2>/dev/null ||
22581 dirpart=`$as_dirname -- "$mf" ||
2094722582 $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
2094822583 X"$mf" : 'X\(//\)[^/]' \| \
2094922584 X"$mf" : 'X\(//\)$' \| \
20950 X"$mf" : 'X\(/\)' \| \
20951 . : '\(.\)' 2>/dev/null ||
22585 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
2095222586 echo X"$mf" |
20953 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
20954 /^X\(\/\/\)[^/].*/{ s//\1/; q; }
20955 /^X\(\/\/\)$/{ s//\1/; q; }
20956 /^X\(\/\).*/{ s//\1/; q; }
20957 s/.*/./; q'`
22587 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
22588 s//\1/
22589 q
22590 }
22591 /^X\(\/\/\)[^/].*/{
22592 s//\1/
22593 q
22594 }
22595 /^X\(\/\/\)$/{
22596 s//\1/
22597 q
22598 }
22599 /^X\(\/\).*/{
22600 s//\1/
22601 q
22602 }
22603 s/.*/./; q'`
2095822604 else
2095922605 continue
2096022606 fi
2097622622 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
2097722623 # Make sure the directory exists.
2097822624 test -f "$dirpart/$file" && continue
20979 fdir=`(dirname "$file") 2>/dev/null ||
22625 fdir=`$as_dirname -- "$file" ||
2098022626 $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
2098122627 X"$file" : 'X\(//\)[^/]' \| \
2098222628 X"$file" : 'X\(//\)$' \| \
20983 X"$file" : 'X\(/\)' \| \
20984 . : '\(.\)' 2>/dev/null ||
22629 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
2098522630 echo X"$file" |
20986 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
20987 /^X\(\/\/\)[^/].*/{ s//\1/; q; }
20988 /^X\(\/\/\)$/{ s//\1/; q; }
20989 /^X\(\/\).*/{ s//\1/; q; }
20990 s/.*/./; q'`
20991 { if $as_mkdir_p; then
20992 mkdir -p $dirpart/$fdir
20993 else
20994 as_dir=$dirpart/$fdir
22631 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
22632 s//\1/
22633 q
22634 }
22635 /^X\(\/\/\)[^/].*/{
22636 s//\1/
22637 q
22638 }
22639 /^X\(\/\/\)$/{
22640 s//\1/
22641 q
22642 }
22643 /^X\(\/\).*/{
22644 s//\1/
22645 q
22646 }
22647 s/.*/./; q'`
22648 { as_dir=$dirpart/$fdir
22649 case $as_dir in #(
22650 -*) as_dir=./$as_dir;;
22651 esac
22652 test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
2099522653 as_dirs=
20996 while test ! -d "$as_dir"; do
20997 as_dirs="$as_dir $as_dirs"
20998 as_dir=`(dirname "$as_dir") 2>/dev/null ||
22654 while :; do
22655 case $as_dir in #(
22656 *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
22657 *) as_qdir=$as_dir;;
22658 esac
22659 as_dirs="'$as_qdir' $as_dirs"
22660 as_dir=`$as_dirname -- "$as_dir" ||
2099922661 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
2100022662 X"$as_dir" : 'X\(//\)[^/]' \| \
2100122663 X"$as_dir" : 'X\(//\)$' \| \
21002 X"$as_dir" : 'X\(/\)' \| \
21003 . : '\(.\)' 2>/dev/null ||
22664 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
2100422665 echo X"$as_dir" |
21005 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
21006 /^X\(\/\/\)[^/].*/{ s//\1/; q; }
21007 /^X\(\/\/\)$/{ s//\1/; q; }
21008 /^X\(\/\).*/{ s//\1/; q; }
21009 s/.*/./; q'`
22666 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
22667 s//\1/
22668 q
22669 }
22670 /^X\(\/\/\)[^/].*/{
22671 s//\1/
22672 q
22673 }
22674 /^X\(\/\/\)$/{
22675 s//\1/
22676 q
22677 }
22678 /^X\(\/\).*/{
22679 s//\1/
22680 q
22681 }
22682 s/.*/./; q'`
22683 test -d "$as_dir" && break
2101022684 done
21011 test ! -n "$as_dirs" || mkdir $as_dirs
21012 fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
21013 echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
22685 test -z "$as_dirs" || eval "mkdir $as_dirs"
22686 } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
22687 echo "$as_me: error: cannot create directory $as_dir" >&2;}
2101422688 { (exit 1); exit 1; }; }; }
21015
2101622689 # echo "creating $dirpart/$file"
2101722690 echo '# dummy' > "$dirpart/$file"
2101822691 done
2101922692 done
2102022693 ;;
22694
2102122695 esac
21022 done
21023 _ACEOF
21024
21025 cat >>$CONFIG_STATUS <<\_ACEOF
22696 done # for ac_tag
22697
2102622698
2102722699 { (exit 0); exit 0; }
2102822700 _ACEOF
22 # DATE: 03 August 2002
33 #
44 # Copyright (C) 2002 W. Michael Petullo <mike@flyn.org>
5 # Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
5 # Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2007
66 # All rights reserved.
77 #
88 # This program is free software; you can redistribute it and/or modify
1919 # along with this program; if not, write to the Free Software
2020 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2121
22 AC_INIT(src/pam_mount.c)
23
24 AM_CONFIG_HEADER(config.h)
25
26 MAJOR_VERSION=0
27 MINOR_VERSION=18
28 MICRO_VERSION=0
29 AM_INIT_AUTOMAKE(pam_mount, $MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION)
30
31 VER_INFO=`expr $MINOR_VERSION + $MAJOR_VERSION`:$MICRO_VERSION:$MINOR_VERSION
32
33 AC_SUBST(MAJOR_VERSION)
34 AC_SUBST(MINOR_VERSION)
35 AC_SUBST(MICRO_VERSION)
36 AC_SUBST(VER_INFO)
22 AC_INIT(pam_mount, 0.20)
23 AC_CONFIG_HEADERS(config.h)
24 AC_PROG_INSTALL
25 AM_INIT_AUTOMAKE
26 AC_PROG_CC
27 AM_PROG_CC_C_O
28 AC_DISABLE_STATIC
29 AM_PROG_LIBTOOL
30 AM_PATH_GLIB_2_0(,,AC_MSG_ERROR(You are missing glib))
31 AM_PATH_XML2(,,AC_MSG_ERROR(You are missing libxml2))
3732
3833 AC_ARG_WITH([slibdir], AS_HELP_STRING([--with-slibdir=PATH],
39 [Path to the super sbin directory [[/sbin]]]),
40 [slibdir="$withval"], [slibdir="/lib"])
34 [Path to the super lib directory [[/lib]]]),
35 [slibdir="$withval"], [slibdir="/lib"])
36 AC_SUBST(slibdir)
4137 AC_ARG_WITH([ssbindir], AS_HELP_STRING([--with-ssbindir=PATH],
42 [Path to the super lib directory [[/lib]]]),
43 [ssbindir="$withval"], [ssbindir="/sbin"])
44 AC_SUBST(slibdir)
38 [Path to the super sbin directory [[/sbin]]]),
39 [ssbindir="$withval"], [ssbindir="/sbin"])
4540 AC_SUBST(ssbindir)
4641
47 AC_PROG_CC
48
49 # GCC 4.x -fvisibility=hidden {
50 AC_DEFUN([CHECK_GCC_FVISIBILITY],
51 [
52 AC_LANG_PUSH(C)
53 saved_CFLAGS="$CFLAGS"
54 CFLAGS="$saved_CFLAGS -fvisibility=hidden"
55 AC_CACHE_CHECK([whether compiler accepts -fvisibility=hidden],
56 [cv_fvisibility_hidden],
57 AC_COMPILE_IFELSE(
58 AC_LANG_PROGRAM(
59 [],
60 []),
61 [cv_fvisibility_hidden=yes],
62 [cv_fvisibility_hidden=no]
63 )
64 )
65 if test "$cv_fvisibility_hidden" = "yes"; then
66 AC_DEFINE(HAVE_VISIBILITY_HIDDEN, [],
67 [True if compiler supports -fvisibility=hidden])
68 AC_SUBST(GCC_FVISIBILITY_HIDDEN, [-fvisibility=hidden])
69 fi
70 CFLAGS="$saved_CFLAGS"
71 AC_LANG_POP(C)
72 ])dnl
73 CHECK_GCC_FVISIBILITY()
74 # }
75
76 AC_PROG_INSTALL
77 AM_PROG_LIBTOOL
78 AC_PROG_LN_S
79 AM_PATH_GLIB_2_0(,,AC_MSG_ERROR(You are missing glib))
80
81 AM_CONDITIONAL(FLYN, test "$FLYN")
82
42 m4_sinclude(m4lib/gcc4_visibility.m4)
8343 AC_CHECK_LIB(crypto, EVP_DecryptInit_ex) # RH 8.0's OpenSSL does not have?
8444 AC_CHECK_LIB(ssl, SSL_load_error_strings)
85 AC_CHECK_FUNCS(setfsuid)
8645
87 AC_CHECK_HEADER(security/pam_modules.h,[have_pamheader="yes"],)
46 regular_CFLAGS="-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 \
47 -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations \
48 -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \
49 -Winline -pipe"
50 AC_SUBST(regular_CFLAGS)
51
52 AC_CHECK_MEMBERS([struct loop_info64.lo_file_name], [], [],
53 [#include <linux/loop.h>])
54
55 AC_CHECK_HEADER([libHX.h], [],
56 AC_MSG_ERROR([Need at least libHX 1.10 (http://jengelh.hopto.org/p/libHX/)]),
57 [
58 #include <libHX.h>
59 #if !defined(_LIBHX_H) || _LIBHX_H < 20070701
60 # error You need a newer version of libHX (at least 1.10.0)
61 #endif
62 ])
63 AC_CHECK_HEADER(security/pam_modules.h, [have_pamheader="yes"])
8864 # Mac OS X 10.3 puts PAM headers in /usr/include/pam.
89 AC_CHECK_HEADER(pam/pam_modules.h,[have_pamheader="yes"],)
65 AC_CHECK_HEADER(pam/pam_modules.h, [have_pamheader="yes"])
9066 if test x"$have_pamheader" != x"yes"; then
91 AC_MSG_ERROR(You are missing PAM headers)
67 AC_MSG_ERROR([You are missing PAM headers])
9268 fi
9369
9470 case "$host" in
95 *-*-linux*)
96 # See also <configure-flags> in pam_mount.xml.
97 PAM_MODDIR="\$(slibdir)/security"
98 ;;
99 *-*-darwin*)
100 PAM_MODDIR="/usr/lib/pam"
101 ;;
102 *)
103 PAM_MODDIR="/usr/lib"
104 ;;
71 (*-*-linux*)
72 PAM_MODDIR='${slibdir}/security'
73 ;;
74 (*-*-darwin*)
75 PAM_MODDIR="/usr/lib/pam"
76 ;;
77 (*)
78 PAM_MODDIR="/usr/lib"
79 ;;
10580 esac
10681 AC_SUBST(PAM_MODDIR)
10782
108 AC_OUTPUT(Makefile config/Makefile dry/Makefile src/Makefile scripts/Makefile)
83 AC_OUTPUT([Makefile config/Makefile dry/Makefile src/Makefile scripts/Makefile])
0 # -*- Makefile -*-
1 #
02 # FILE: Makefile.am --
13 # AUTHOR: W. Michael Petullo <mike@flyn.org>
24 # DATE: 03 August 2002
1820 # along with this program; if not, write to the Free Software
1921 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2022
21 if FLYN
22 # For local development use only.
23 include /etc/fctk/config.mk
24 endif
25
26 AUTOMAKE_OPTIONS = gnu
27
2823 man_MANS = autoehd.8 mount.crypt.8 pam_mount.8 pmvarrun.8 \
2924 mkehd.1 mount_ehd.8 passwdehd.8 umount.crypt.8
3025
3126 EXTRA_DIST = pam_mount.spec $(man_MANS)
32
33 if FLYN
34 # For local development use only.
35 README: pam_mount.xml
36 xsltproc -o README /usr/share/fctk/README.xslt pam_mount.xml
37
38 pam_mount.html: pam_mount.xml
39 xsltproc -o pam_mount.html /usr/share/fctk/webpage.xslt pam_mount.xml
40
41 pam_mount_summary.html: pam_mount.xml
42 xsltproc -o pam_mount_summary.html /usr/share/fctk/html_summary.xslt pam_mount.xml
43
44 pam_mount.spec: pam_mount.xml
45 xsltproc -o pam_mount.spec --stringparam version $(VERSION) /usr/share/fctk/spec.xslt pam_mount.xml
46
47 control: pam_mount.xml
48 xsltproc -o control /usr/share/fctk/control.xslt pam_mount.xml
49
50 pam_mount.8: pam_mount.xml
51 xsltproc -o pam_mount.8 /usr/share/fctk/manpage.xslt pam_mount.xml
52
53 maintainer-clean-local:
54 rm -f control
55 rm -f new.html
56 rm -f $(PACKAGE).spec
57 rm -f $(PACKAGE)_summary.html
58 rm -f pam_mount.8
59 rm -f README
60 rm -f usage_$(PACKAGE).c
61
62 # ============================= all ===========================================
63 all: $(PACKAGE).spec README pam_mount.html pam_mount_summary.html control
64 cp README ..
65 cp control ../debian
66
67 endif
1313
1414 @SET_MAKE@
1515
16 # -*- Makefile -*-
17 #
1618 # FILE: Makefile.am --
1719 # AUTHOR: W. Michael Petullo <mike@flyn.org>
1820 # DATE: 03 August 2002
5658 build_triplet = @build@
5759 host_triplet = @host@
5860 subdir = dry
59 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
61 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
6062 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
61 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
63 am__aclocal_m4_deps = $(top_srcdir)/m4lib/gcc4_visibility.m4 \
64 $(top_srcdir)/configure.ac
6265 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
6366 $(ACLOCAL_M4)
6467 mkinstalldirs = $(install_sh) -d
6568 CONFIG_HEADER = $(top_builddir)/config.h
6669 CONFIG_CLEAN_FILES =
70 AM_LIBTOOL_SILENT = $(if $(V),,--silent)
71 AM_VERBOSE_CC = $(if $(V),,@echo " CC " $@;)
72 AM_VERBOSE_CCLD = $(if $(V),,@echo " CCLD " $@;)
73 AM_VERBOSE_CXX = $(if $(V),,@echo " CXX " $@;)
74 AM_VERBOSE_CXXLD = $(if $(V),,@echo " CXXLD " $@;)
75 AM_VERBOSE_OBJC = $(if $(V),,@echo " OBJC " $@;)
76 AM_VERBOSE_OBJCLD = $(if $(V),,@echo " OBJCLD " $@;)
77 AM_VERBOSE_YACC = $(if $(V),,@echo " YACC " $@;)
78 AM_VERBOSE_LEX = $(if $(V),,@echo " LEX " $@;)
79 AM_VERBOSE_AS = $(if $(V),,@echo " AS " $@;)
80 AM_VERBOSE_F77 = $(if $(V),,@echo " F77 " $@;)
81 AM_VERBOSE_F77LD = $(if $(V),,@echo " F77LD " $@;)
82 AM_VERBOSE_FC = $(if $(V),,@echo " FC " $@;)
83 AM_VERBOSE_FCLD = $(if $(V),,@echo " FCLD " $@;)
84 AM_VERBOSE_GCJ = $(if $(V),,@echo " GCJ " $@;)
85 AM_VERBOSE_GCJLD = $(if $(V),,@echo " GCJLD " $@;)
86 AM_VERBOSE_GEN = $(if $(V),,@echo " GEN " $@;)
6787 SOURCES =
6888 DIST_SOURCES =
6989 man1dir = $(mandir)/man1
101121 EXEEXT = @EXEEXT@
102122 F77 = @F77@
103123 FFLAGS = @FFLAGS@
104 FLYN_FALSE = @FLYN_FALSE@
105 FLYN_TRUE = @FLYN_TRUE@
106124 GCC_FVISIBILITY_HIDDEN = @GCC_FVISIBILITY_HIDDEN@
107125 GLIB_CFLAGS = @GLIB_CFLAGS@
108126 GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
109127 GLIB_LIBS = @GLIB_LIBS@
110128 GLIB_MKENUMS = @GLIB_MKENUMS@
111129 GOBJECT_QUERY = @GOBJECT_QUERY@
130 GREP = @GREP@
112131 INSTALL_DATA = @INSTALL_DATA@
113132 INSTALL_PROGRAM = @INSTALL_PROGRAM@
114133 INSTALL_SCRIPT = @INSTALL_SCRIPT@
119138 LIBTOOL = @LIBTOOL@
120139 LN_S = @LN_S@
121140 LTLIBOBJS = @LTLIBOBJS@
122 MAJOR_VERSION = @MAJOR_VERSION@
123141 MAKEINFO = @MAKEINFO@
124 MICRO_VERSION = @MICRO_VERSION@
125 MINOR_VERSION = @MINOR_VERSION@
126142 OBJEXT = @OBJEXT@
127143 PACKAGE = @PACKAGE@
128144 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
138154 SHELL = @SHELL@
139155 STRIP = @STRIP@
140156 VERSION = @VERSION@
141 VER_INFO = @VER_INFO@
142 ac_ct_AR = @ac_ct_AR@
157 XML2_CONFIG = @XML2_CONFIG@
158 XML_CPPFLAGS = @XML_CPPFLAGS@
159 XML_LIBS = @XML_LIBS@
143160 ac_ct_CC = @ac_ct_CC@
144161 ac_ct_CXX = @ac_ct_CXX@
145162 ac_ct_F77 = @ac_ct_F77@
146 ac_ct_RANLIB = @ac_ct_RANLIB@
147 ac_ct_STRIP = @ac_ct_STRIP@
148163 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
149164 am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
150165 am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
161176 build_os = @build_os@
162177 build_vendor = @build_vendor@
163178 datadir = @datadir@
179 datarootdir = @datarootdir@
180 docdir = @docdir@
181 dvidir = @dvidir@
164182 exec_prefix = @exec_prefix@
165183 host = @host@
166184 host_alias = @host_alias@
167185 host_cpu = @host_cpu@
168186 host_os = @host_os@
169187 host_vendor = @host_vendor@
188 htmldir = @htmldir@
170189 includedir = @includedir@
171190 infodir = @infodir@
172191 install_sh = @install_sh@
173192 libdir = @libdir@
174193 libexecdir = @libexecdir@
194 localedir = @localedir@
175195 localstatedir = @localstatedir@
176196 mandir = @mandir@
177197 mkdir_p = @mkdir_p@
178198 oldincludedir = @oldincludedir@
199 pdfdir = @pdfdir@
179200 prefix = @prefix@
180201 program_transform_name = @program_transform_name@
202 psdir = @psdir@
203 regular_CFLAGS = @regular_CFLAGS@
181204 sbindir = @sbindir@
182205 sharedstatedir = @sharedstatedir@
183206 slibdir = @slibdir@
184207 ssbindir = @ssbindir@
185208 sysconfdir = @sysconfdir@
186209 target_alias = @target_alias@
187 AUTOMAKE_OPTIONS = gnu
188210 man_MANS = autoehd.8 mount.crypt.8 pam_mount.8 pmvarrun.8 \
189211 mkehd.1 mount_ehd.8 passwdehd.8 umount.crypt.8
190212
386408 maintainer-clean-generic:
387409 @echo "This command is intended for maintainers to use"
388410 @echo "it deletes files that may require special tools to rebuild."
389 @FLYN_FALSE@maintainer-clean-local:
390411 clean: clean-am
391412
392413 clean-am: clean-generic clean-libtool mostlyclean-am
417438
418439 maintainer-clean: maintainer-clean-am
419440 -rm -f Makefile
420 maintainer-clean-am: distclean-am maintainer-clean-generic \
421 maintainer-clean-local
441 maintainer-clean-am: distclean-am maintainer-clean-generic
422442
423443 mostlyclean: mostlyclean-am
424444
443463 install-info install-info-am install-man install-man1 \
444464 install-man8 install-strip installcheck installcheck-am \
445465 installdirs maintainer-clean maintainer-clean-generic \
446 maintainer-clean-local mostlyclean mostlyclean-generic \
447 mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
448 uninstall-info-am uninstall-man uninstall-man1 uninstall-man8
449
450
451 # For local development use only.
452 @FLYN_TRUE@include /etc/fctk/config.mk
453
454 # For local development use only.
455 @FLYN_TRUE@README: pam_mount.xml
456 @FLYN_TRUE@ xsltproc -o README /usr/share/fctk/README.xslt pam_mount.xml
457
458 @FLYN_TRUE@pam_mount.html: pam_mount.xml
459 @FLYN_TRUE@ xsltproc -o pam_mount.html /usr/share/fctk/webpage.xslt pam_mount.xml
460
461 @FLYN_TRUE@pam_mount_summary.html: pam_mount.xml
462 @FLYN_TRUE@ xsltproc -o pam_mount_summary.html /usr/share/fctk/html_summary.xslt pam_mount.xml
463
464 @FLYN_TRUE@pam_mount.spec: pam_mount.xml
465 @FLYN_TRUE@ xsltproc -o pam_mount.spec --stringparam version $(VERSION) /usr/share/fctk/spec.xslt pam_mount.xml
466
467 @FLYN_TRUE@control: pam_mount.xml
468 @FLYN_TRUE@ xsltproc -o control /usr/share/fctk/control.xslt pam_mount.xml
469
470 @FLYN_TRUE@pam_mount.8: pam_mount.xml
471 @FLYN_TRUE@ xsltproc -o pam_mount.8 /usr/share/fctk/manpage.xslt pam_mount.xml
472
473 @FLYN_TRUE@maintainer-clean-local:
474 @FLYN_TRUE@ rm -f control
475 @FLYN_TRUE@ rm -f new.html
476 @FLYN_TRUE@ rm -f $(PACKAGE).spec
477 @FLYN_TRUE@ rm -f $(PACKAGE)_summary.html
478 @FLYN_TRUE@ rm -f pam_mount.8
479 @FLYN_TRUE@ rm -f README
480 @FLYN_TRUE@ rm -f usage_$(PACKAGE).c
481
482 # ============================= all ===========================================
483 @FLYN_TRUE@all: $(PACKAGE).spec README pam_mount.html pam_mount_summary.html control
484 @FLYN_TRUE@ cp README ..
485 @FLYN_TRUE@ cp control ../debian
466 mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
467 ps ps-am uninstall uninstall-am uninstall-info-am \
468 uninstall-man uninstall-man1 uninstall-man8
469
486470 # Tell versions [3.59,3.63) of GNU make to not export all variables.
487471 # Otherwise a system limit (for SysV at least) may be exceeded.
488472 .NOEXPORT:
33 .SH SYNOPSIS
44 \fBautoehd\fP [\fIuser\fP] [\fIoptions\fP]...
55 .SH DESCRIPTION
6 Mounts the encrypted home directory defined in \fBpam_mount.conf\fP for the
6 Mounts the encrypted home directory defined in \fBpam_mount.conf.xml\fP for the
77 given user.
88 .SH OPTIONS
99 .TP
22 mount.crypt - mount a dm\-crypt encrypted volume
33 .SH SYNOPSIS
44 \fBmount.crypt\fP \fIdevice\fP \fIdirectory\fP [\fB\-o\fP \fIoptions\fP]
5 \fBmount.crypt\fP {\fB\-h\fP, \fB\-?\fP}
5 .br
6 \fBmount.crypt\fP {\fB\-h\fP|\fB\-?\fP}
67 .SH OPTIONS
78 .TP
89 \fB\-o\fP \fIoptions\fP
3535 threats.
3636 .SH NASTY DETAILS
3737 .PP
38 The primary configuration file for the pam_mount module is pam_mount.conf. On
39 most platforms this file is read from /etc/security/pam_mount.conf. On OpenBSD
40 pam_mount reads its configuration file from /etc/pam_mount.conf.
41 pam_mount.conf contains many comments documenting its use.
38 The primary configuration file for the pam_mount module is pam_mount.conf.xml.
39 On most platforms this file is read from /etc/security/pam_mount.conf.xml. On
40 OpenBSD pam_mount reads its configuration file from /etc/pam_mount.conf.xml.
41 pam_mount.conf.xml contains many comments documenting its use.
4242 .PP
4343 In addition, you must include two entries in the system's applicable
4444 /etc/pam.d/SERVICE config files, as the following example shows:
5555 session optional pam_console.so
5656 +++ session optional pam_mount.so
5757 .fi
58 .PP
59 When "sufficient" is used in the second column, you must make sure that
60 pam_mount is added before this entry. Otherwise pam_mount will not get executed
61 should a previous PAM module succeed. Also be aware of the "include"
62 statements. These make PAM look into the specified file. If there is a
63 "sufficient" statement, then the pam_mount entry must either be in the included
64 file before the "sufficient" statement or before the "include" statement.
5865 .PP
5966 If you use pam_ldap, pam_winbind, or any other authentication services that
6067 make use of PAM's sufficient keyword then model your configuration on the
105112 regenerate efsk using efsk = E_sk (fsk). If you want to mount this volume by
106113 hand, use something like openssl enc -d -aes-256-ecb -in /home/user.key | mount
107114 -p0 /home/user. More information about this technique is included in
108 pam_mount.conf.
115 pam_mount.conf.xml.
109116 .PP
110117 A script named mkehd is provided with pam_mount to help create encrypted home
111118 directories. If you have an entry for a user using encrypted home directories
112 in pam_mount.conf, mkehd will create necessary filesystem images and possibly
113 encrypted filesystem keys.
119 in pam_mount.conf.xml, mkehd will create necessary filesystem images and
120 possibly encrypted filesystem keys.
114121 .PP
115122 Individual users may define additional volumes to mount if allowed by
116 pam_mount.conf (usually ~/.pam_mount.conf). The volume keyword is the only
117 valid keyword in these per-user configuration files. If the luserconf parameter
118 is set in pam_mount.conf, allowing user-defined volume, then users may mount
119 and unmount any volume they own at any mount point they own. On some filesystem
120 configurations this may be a security flaw so user-defined volumes are not
121 allowed by the example pam_mount.conf distributed with pam_mount.
123 pam_mount.conf.xml (usually ~/.pam_mount.conf.xml). The volume keyword is the
124 only valid keyword in these per-user configuration files. If the luserconf
125 parameter is set in pam_mount.conf.xml, allowing user-defined volume, then
126 users may mount and unmount any volume they own at any mount point they own. On
127 some filesystem configurations this may be a security flaw so user-defined
128 volumes are not allowed by the example pam_mount.conf.xml distributed with
129 pam_mount.
122130 .PP
123131 In general, you will leave all the first (general) parameters as provided by
124132 default. You only have to provide the user/volume list in the end of the file,
126134 .PP
127135 To ensure that your system and, possibly, the remote server are all properly
128136 configured, you should try to mount all or some of the volumes by hand, using
129 the same commands and mount points provided in pam_mount.conf. This will save
130 you a lot of grief, since it is more difficult to debug the mounting process
131 via pam_mount.
137 the same commands and mount points provided in pam_mount.conf.xml. This will
138 save you a lot of grief, since it is more difficult to debug the mounting
139 process via pam_mount.
132140 .PP
133 If you can mount the volumes by hand but it is not happening via pam_mount,
134 you may want to enable the "debug" option in pam_mount.conf to see what is
141 If you can mount the volumes by hand but it is not happening via pam_mount, you
142 may want to enable the "debug" option in pam_mount.conf.xml to see what is
135143 happening.
136144 .PP
137145 Verify if the user owns the mount point and has sufficient permissions over
139147 the user does not own that directory.
140148 .PP
141149 If pam_mount is having trouble unmounting volumes upon logging out, enable the
142 debug variable and check the lsof variable in pam_mount.conf. This causes
150 debug variable and check the lsof variable in pam_mount.conf.xml. This causes
143151 pam_mount to run lsof upon logging out and write lsof's output to the system's
144152 logs.
145153 .SH AUTHORS
00
11 Name: pam_mount
2 Version: 0.18
2 Version: 0.20
33 Release: 0
44 Group: System/Libraries
55 Summary: A PAM module that can mount volumes for a user session
77 URL: http://pam-mount.sf.net/
88
99 Source: http://heanet.dl.sf.net/sourceforge/pam-mount/%name-%version.tar.bz2
10 Requires: pam
11 BuildRequires: autoconf automake binutils gcc glib2-devel libtool pam-devel openssl-devel zlib-devel
10 Requires: lsof pam
11 BuildRequires: glib2-devel libtool linux-kernel-headers pam-devel
12 BuildRequires: openssl-devel libxml2-devel libHX >= 1.10
1213 BuildRoot: %_tmppath/%name-%version-build
14 Prefix: %_prefix
1315
1416 %description
1517 pam_mount automatically mounts directories when the user logs in,
2527
2628 %build
2729 autoreconf -fi;
28 %configure --disable-debug --disable-static --with-slibdir=/%_lib
30 %configure --disable-static --with-ssbindir=/sbin --with-slibdir=/%_lib
2931 make;
3032
3133 %install
3335 rm -Rf "$b";
3436 make -i install DESTDIR="$b";
3537 mkdir -p "$b/%_sysconfdir/security";
36 install -m0644 config/pam_mount.conf "$b/%_sysconfdir/security/";
37 rm -f "$b/%_lib/security/"*.{la,a};
38 install -m0644 config/pam_mount.conf.xml "$b/%_sysconfdir/security/";
3839
3940 %clean
4041 rm -Rf "%buildroot";
4142
4243 %files
4344 %defattr(-,root,root)
44 %config(noreplace) %_sysconfdir/security/%name.conf
45 %config(noreplace) %_sysconfdir/security/%name.conf.xml
4546 /%_lib/security/%{name}*.so
4647 %_sbindir/pmvarrun
4748 %_bindir/mkehd
5354 %_mandir/*/*
5455 #%policy %_sysconfdir/selinux/strict/src/policy/macros/%{name}_macros.te
5556 #%policy %_sysconfdir/selinux/strict/src/policy/file_contexts/misc/%name.fc
56 %doc AUTHORS COPYING ChangeLog INSTALL NEWS README FAQ TODO
57 %doc AUTHORS README FAQ TODO
5758
5859 %changelog -n pam_mount
44 \fBpasswdehd\fP [\fIuser\fP] [\fIoption\fP]...
55 .SH DESCRIPTION
66 When using a password protected key file to mount an encrypted volume, this
7 command changes the password of the key file for the given user.
8 It reads the global \fBpam_mount.conf\fP file for keyfile and cipher options.
7 command changes the password of the key file for the given user. It reads the
8 global \fBpam_mount.conf.xml\fP file for keyfile and cipher options.
99 .SH OPTIONS
1010 .TP
1111 \fB\-h\fP, \fB\-?\fP
1212 display help
1313 .SH FILES
14 \fB/etc/security/pam_mount.conf\fP
14 \fB/etc/security/pam_mount.conf.xml\fP
1515 .SH AUTHOR
16 This manpage was originally written by Bastian Kleineidam
17 <calvin@debian.org> for the Debian distribution of libpam\-mount but
18 may be used by others.
16 This manpage was originally written by Bastian Kleineidam <calvin@debian.org>
17 for the Debian distribution of pam_mount but may be used by others.
1918
2019 See /usr/share/doc/packages/pam_mount/AUTHORS for the list of original authors
2120 of pam_mount.
0
1 # GCC 4.x -fvisibility=hidden
2
3 AC_DEFUN([CHECK_GCC_FVISIBILITY], [
4 AC_LANG_PUSH(C)
5 saved_CFLAGS="$CFLAGS"
6 CFLAGS="$saved_CFLAGS -fvisibility=hidden"
7 AC_CACHE_CHECK([whether compiler accepts -fvisibility=hidden],
8 [cv_fvisibility_hidden], AC_COMPILE_IFELSE(
9 AC_LANG_PROGRAM([], []),
10 [cv_fvisibility_hidden=yes],
11 [cv_fvisibility_hidden=no]
12 ))
13 if test "$cv_fvisibility_hidden" = "yes"; then
14 AC_DEFINE(HAVE_VISIBILITY_HIDDEN, [1],
15 [True if compiler supports -fvisibility=hidden])
16 AC_SUBST(GCC_FVISIBILITY_HIDDEN, [-fvisibility=hidden])
17 fi
18 CFLAGS="$saved_CFLAGS"
19 AC_LANG_POP(C)
20 ])dnl
21 CHECK_GCC_FVISIBILITY()
0
1 This short document will explain the various pam_mount options.
2 Options are listed in the 4th column of a PAM file, e.g.:
3
4 auth optional pam_mount.so use_first_pass
5
6
7 <no argument>
8 Always ask for password.
9
10 use_first_pass
11 Always take the password from the PAM subsystem;
12 if it is not available, fail the module.
13
14 try_first_pass
15 Try taking the password from the PAM subsystem;
16 if it fails, ask for password.
17
18 soft_try_pass
19 Try taking the password frmo the PAM subsystem;
20 if it fails, do not ask.
0 # -*- Makefile -*-
1 #
02 # FILE: Makefile.am --
13 # AUTHOR: W. Michael Petullo <mike@flyn.org>
24 # DATE: 06 October 2002
1820 # along with this program; if not, write to the Free Software
1921 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2022
21 AUTOMAKE_OPTIONS = gnu
22
2323 bin_SCRIPTS = mkehd autoehd passwdehd mount_ehd
2424 ssbindir = @ssbindir@
2525 ssbin_SCRIPTS = mount.crypt umount.crypt
1313
1414 @SET_MAKE@
1515
16 # -*- Makefile -*-
17 #
1618 # FILE: Makefile.am --
1719 # AUTHOR: W. Michael Petullo <mike@flyn.org>
1820 # DATE: 06 October 2002
5961 subdir = scripts
6062 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
6163 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
62 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
64 am__aclocal_m4_deps = $(top_srcdir)/m4lib/gcc4_visibility.m4 \
65 $(top_srcdir)/configure.ac
6366 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
6467 $(ACLOCAL_M4)
6568 mkinstalldirs = $(install_sh) -d
6972 binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
7073 ssbinSCRIPT_INSTALL = $(INSTALL_SCRIPT)
7174 SCRIPTS = $(bin_SCRIPTS) $(ssbin_SCRIPTS)
75 AM_LIBTOOL_SILENT = $(if $(V),,--silent)
76 AM_VERBOSE_CC = $(if $(V),,@echo " CC " $@;)
77 AM_VERBOSE_CCLD = $(if $(V),,@echo " CCLD " $@;)
78 AM_VERBOSE_CXX = $(if $(V),,@echo " CXX " $@;)
79 AM_VERBOSE_CXXLD = $(if $(V),,@echo " CXXLD " $@;)
80 AM_VERBOSE_OBJC = $(if $(V),,@echo " OBJC " $@;)
81 AM_VERBOSE_OBJCLD = $(if $(V),,@echo " OBJCLD " $@;)
82 AM_VERBOSE_YACC = $(if $(V),,@echo " YACC " $@;)
83 AM_VERBOSE_LEX = $(if $(V),,@echo " LEX " $@;)
84 AM_VERBOSE_AS = $(if $(V),,@echo " AS " $@;)
85 AM_VERBOSE_F77 = $(if $(V),,@echo " F77 " $@;)
86 AM_VERBOSE_F77LD = $(if $(V),,@echo " F77LD " $@;)
87 AM_VERBOSE_FC = $(if $(V),,@echo " FC " $@;)
88 AM_VERBOSE_FCLD = $(if $(V),,@echo " FCLD " $@;)
89 AM_VERBOSE_GCJ = $(if $(V),,@echo " GCJ " $@;)
90 AM_VERBOSE_GCJLD = $(if $(V),,@echo " GCJLD " $@;)
91 AM_VERBOSE_GEN = $(if $(V),,@echo " GEN " $@;)
7292 SOURCES =
7393 DIST_SOURCES =
7494 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
101121 EXEEXT = @EXEEXT@
102122 F77 = @F77@
103123 FFLAGS = @FFLAGS@
104 FLYN_FALSE = @FLYN_FALSE@
105 FLYN_TRUE = @FLYN_TRUE@
106124 GCC_FVISIBILITY_HIDDEN = @GCC_FVISIBILITY_HIDDEN@
107125 GLIB_CFLAGS = @GLIB_CFLAGS@
108126 GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
109127 GLIB_LIBS = @GLIB_LIBS@
110128 GLIB_MKENUMS = @GLIB_MKENUMS@
111129 GOBJECT_QUERY = @GOBJECT_QUERY@
130 GREP = @GREP@
112131 INSTALL_DATA = @INSTALL_DATA@
113132 INSTALL_PROGRAM = @INSTALL_PROGRAM@
114133 INSTALL_SCRIPT = @INSTALL_SCRIPT@
119138 LIBTOOL = @LIBTOOL@
120139 LN_S = @LN_S@
121140 LTLIBOBJS = @LTLIBOBJS@
122 MAJOR_VERSION = @MAJOR_VERSION@
123141 MAKEINFO = @MAKEINFO@
124 MICRO_VERSION = @MICRO_VERSION@
125 MINOR_VERSION = @MINOR_VERSION@
126142 OBJEXT = @OBJEXT@
127143 PACKAGE = @PACKAGE@
128144 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
138154 SHELL = @SHELL@
139155 STRIP = @STRIP@
140156 VERSION = @VERSION@
141 VER_INFO = @VER_INFO@
142 ac_ct_AR = @ac_ct_AR@
157 XML2_CONFIG = @XML2_CONFIG@
158 XML_CPPFLAGS = @XML_CPPFLAGS@
159 XML_LIBS = @XML_LIBS@
143160 ac_ct_CC = @ac_ct_CC@
144161 ac_ct_CXX = @ac_ct_CXX@
145162 ac_ct_F77 = @ac_ct_F77@
146 ac_ct_RANLIB = @ac_ct_RANLIB@
147 ac_ct_STRIP = @ac_ct_STRIP@
148163 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
149164 am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
150165 am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
161176 build_os = @build_os@
162177 build_vendor = @build_vendor@
163178 datadir = @datadir@
179 datarootdir = @datarootdir@
180 docdir = @docdir@
181 dvidir = @dvidir@
164182 exec_prefix = @exec_prefix@
165183 host = @host@
166184 host_alias = @host_alias@
167185 host_cpu = @host_cpu@
168186 host_os = @host_os@
169187 host_vendor = @host_vendor@
188 htmldir = @htmldir@
170189 includedir = @includedir@
171190 infodir = @infodir@
172191 install_sh = @install_sh@
173192 libdir = @libdir@
174193 libexecdir = @libexecdir@
194 localedir = @localedir@
175195 localstatedir = @localstatedir@
176196 mandir = @mandir@
177197 mkdir_p = @mkdir_p@
178198 oldincludedir = @oldincludedir@
199 pdfdir = @pdfdir@
179200 prefix = @prefix@
180201 program_transform_name = @program_transform_name@
202 psdir = @psdir@
203 regular_CFLAGS = @regular_CFLAGS@
181204 sbindir = @sbindir@
182205 sharedstatedir = @sharedstatedir@
183206 slibdir = @slibdir@
184207 ssbindir = @ssbindir@
185208 sysconfdir = @sysconfdir@
186209 target_alias = @target_alias@
187 AUTOMAKE_OPTIONS = gnu
188210 bin_SCRIPTS = mkehd autoehd passwdehd mount_ehd
189211 ssbin_SCRIPTS = mount.crypt umount.crypt
190212 EXTRA_DIST = mkehd autoehd passwdehd mount_ehd mount.crypt umount.crypt
2929
3030 while :; do
3131 case "$1" in
32 -h | "-?" )
32 (-h|"-?")
3333 echo -e usage: ${0##*/} "$USAGE" >&2
3434 exit 1 ;;
35 -?* )
35 (-?*)
3636 echo "${0##*/}: unrecognized option: $1" >&2;
3737 exit 1 ;;
38 * )
38 (*)
3939 break ;;
4040 esac
4141 shift
5353 REGEX="^volume[[:space:]]\+\($USER\|*\|@$GROUP\)[[:space:]]\+";
5454 LINE=`grep -m1 "$REGEX" "$CONF"`;
5555 if [ -z "$LINE" ]; then
56 echo "${0##*/}: could not find configuration for $USER in $CONF" >&2;
57 exit 1;
56 echo "${0##*/}: could not find configuration for $USER in $CONF" >&2;
57 exit 1;
5858 fi
5959
6060 MNTPT=`echo "$LINE" | awk '{ print $6 }'`;
0 #!/usr/bin/perl -w
1 #
2 # convert tool for pam_mount.conf
3 #
4 # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
5 # This file is under the same license as pam_mount itself.
6 #
7 # Please submit bugfixes or comments via http://bugs.opensuse.org/
8 #
9 use Data::Dumper;
10 use Getopt::Long;
11 use IO::File;
12 use XML::Writer;
13 use strict;
14
15 my $OLD_CONF = "-";
16 my $NEW_CONF = "-";
17 my $debug = 0;
18
19 &Getopt::Long::Configure(qw(bundling));
20 &GetOptions(
21 "i=s" => \$OLD_CONF,
22 "o=s" => \$NEW_CONF,
23 "d" => \$debug,
24 );
25
26 my %callbacks = (
27 "debug" => \&callback_debug,
28 "mkmountpoint" => \&callback_mkmountpoint,
29 "fsckloop" => \&callback_fsckloop,
30 "luserconf" => \&callback_luserconf,
31 "options_allow" => \&callback_options_allow,
32 "options_deny" => \&callback_options_deny,
33 "options_require" => \&callback_options_require,
34 "lsof" => \&callback_lsof,
35 "fsck" => \&callback_fsck,
36 "losetup" => \&callback_losetup,
37 "unlosetup" => \&callback_unlosetup,
38 "cifsmount" => \&callback_cifsmount,
39 "smbmount" => \&callback_smbmount,
40 "ncpmount" => \&callback_ncpmount,
41 "smbumount" => \&callback_smbumount,
42 "ncpumount" => \&callback_ncpumount,
43 "fusemount" => \&callback_fusemount,
44 "fuseumount" => \&callback_fuseumount,
45 "umount" => \&callback_umount,
46 "lclmount" => \&callback_lclmount,
47 "cryptmount" => \&callback_cryptmount,
48 "nfsmount" => \&callback_nfsmount,
49 "mntagain" => \&callback_mntagain,
50 "mntcheck" => \&callback_mntcheck,
51 "pmvarrun" => \&callback_pmvarrun,
52 "volume" => \&callback_volume,
53 );
54
55 my $output = new IO::File("> $NEW_CONF");
56 my $writer = new XML::Writer(OUTPUT => $output, UNSAFE => 1);
57
58 $writer->xmlDecl("UTF-8");
59 $writer->startTag("pam_mount");
60 $writer->raw("\n\n");
61
62 sub callback_debug(@)
63 {
64 my @fields = @_;
65
66 $writer->emptyTag("debug", "enable" => $fields[1]);
67 }
68
69 sub callback_mkmountpoint(@)
70 {
71 my @fields = @_;
72
73 $writer->emptyTag("mkmountpoint", "enable" => $fields[1]);
74 }
75
76 sub callback_fsckloop(@)
77 {
78 my @fields = @_;
79
80 $writer->emptyTag("fsckloop", "device" => $fields[1]);
81 }
82
83 sub callback_luserconf(@)
84 {
85 my @fields = @_;
86
87 $writer->emptyTag("luserconf", "name" => $fields[1]);
88 }
89
90 sub callback_options_allow(@)
91 {
92 my @fields = @_;
93
94 $writer->emptyTag("mntoptions", "allow" => $fields[1]);
95 }
96
97 sub callback_options_deny(@)
98 {
99 my @fields = @_;
100
101 $writer->emptyTag("mntoptions", "deny" => $fields[1]);
102 }
103
104 sub callback_options_require(@)
105 {
106 my @fields = @_;
107
108 $writer->emptyTag("mntoptions", "require" => $fields[1]);
109 }
110
111 sub callback_lsof(@)
112 {
113 my @fields = @_;
114
115 shift @fields;
116
117 $writer->startTag("lsof");
118 $writer->characters(join(" ", @fields));
119 $writer->endTag("lsof");
120 }
121
122 sub callback_fsck(@)
123 {
124 my @fields = @_;
125
126 shift @fields;
127 $writer->startTag("fsck");
128 $writer->characters(join(" ", @fields));
129 $writer->endTag("fsck");
130 }
131
132 sub callback_losetup(@)
133 {
134 my @fields = @_;
135
136 shift @fields;
137 $writer->startTag("losetup");
138 $writer->characters(join(" ", @fields));
139 $writer->endTag("losetup");
140 }
141
142 sub callback_unlosetup(@)
143 {
144 my @fields = @_;
145
146 shift @fields;
147 $writer->startTag("unlosetup");
148 $writer->characters(join(" ", @fields));
149 $writer->endTag("unlosetup");
150 }
151
152 sub callback_cifsmount(@)
153 {
154 my @fields = @_;
155
156 shift @fields;
157 $writer->startTag("cifsmount");
158 $writer->characters(join(" ", @fields));
159 $writer->endTag("cifsmount");
160 }
161
162 sub callback_smbmount(@)
163 {
164 my @fields = @_;
165
166 shift @fields;
167 $writer->startTag("smbmount");
168 $writer->characters(join(" ", @fields));
169 $writer->endTag("smbmount");
170 }
171
172 sub callback_ncpmount(@)
173 {
174 my @fields = @_;
175
176 shift @fields;
177 $writer->startTag("ncpmount");
178 $writer->characters(join(" ", @fields));
179 $writer->endTag("ncpmount");
180 }
181
182 sub callback_smbumount(@)
183 {
184 my @fields = @_;
185
186 shift @fields;
187 $writer->startTag("smbumount");
188 $writer->characters(join(" ", @fields));
189 $writer->endTag("smbumount");
190 }
191
192 sub callback_ncpumount(@)
193 {
194 my @fields = @_;
195
196 shift @fields;
197 $writer->startTag("ncpumount");
198 $writer->characters(join(" ", @fields));
199 $writer->endTag("ncpumount");
200 }
201
202 sub callback_fusemount(@)
203 {
204 my @fields = @_;
205
206 shift @fields;
207 $writer->startTag("fusemount");
208 $writer->characters(join(" ", @fields));
209 $writer->endTag("fusemount");
210 }
211
212 sub callback_fuseumount(@)
213 {
214 my @fields = @_;
215
216 shift @fields;
217 $writer->startTag("fuseumount");
218 $writer->characters(join(" ", @fields));
219 $writer->endTag("fuseumount");
220 }
221
222 sub callback_umount(@)
223 {
224 my @fields = @_;
225
226 shift @fields;
227 $writer->startTag("umount");
228 $writer->characters(join(" ", @fields));
229 $writer->endTag("umount");
230 }
231
232 sub callback_lclmount(@)
233 {
234 my @fields = @_;
235
236 shift @fields;
237 $writer->startTag("lclmount");
238 $writer->characters(join(" ", @fields));
239 $writer->endTag("lclmount");
240 }
241
242 sub callback_cryptmount(@)
243 {
244 my @fields = @_;
245
246 shift @fields;
247 $writer->startTag("cryptmount");
248 $writer->characters(join(" ", @fields));
249 $writer->endTag("cryptmount");
250 }
251
252 sub callback_nfsmount(@)
253 {
254 my @fields = @_;
255
256 shift @fields;
257 $writer->startTag("nfsmount");
258 $writer->characters(join(" ", @fields));
259 $writer->endTag("nfsmount");
260 }
261
262 sub callback_mntagain(@)
263 {
264 my @fields = @_;
265
266 shift @fields;
267 $writer->startTag("mntagain");
268 $writer->characters(join(" ", @fields));
269 $writer->endTag("mntagain");
270 }
271
272 sub callback_mntcheck(@)
273 {
274 my @fields = @_;
275
276 shift @fields;
277 $writer->startTag("mntcheck");
278 $writer->characters(join(" ", @fields));
279 $writer->endTag("mntcheck");
280 }
281
282 sub callback_pmvarrun(@)
283 {
284 my @fields = @_;
285
286 shift @fields;
287 $writer->startTag("pmvarrun");
288 $writer->characters(join(" ", @fields));
289 $writer->endTag("pmvarrun");
290 }
291
292 sub callback_volume(@)
293 {
294 my @fields = @_;
295
296 shift @fields;
297
298 my %attr = (
299 "invert" => 0,
300 "fstype" => "auto",
301 );
302
303 if ($fields[0] =~ /^\@\@(.*)/) {
304 $attr{sgrp} = "$1";
305 } elsif ($fields[0] =~ /^\@(.*)/) {
306 $attr{pgrp} = "$1";
307 } else {
308 $attr{user} = "$fields[0]";
309 }
310
311 # search for wrong splits
312 # happens at 'a value' or "a value"
313 # and remove quotes around a single value. "value" or 'value'
314 my @new_fields;
315 my($nf, $char);
316
317 foreach my $f (@fields) {
318 if (!defined $nf && $f =~ /^'(.+)'$/) {
319 push(@new_fields, $1);
320 } elsif (!defined $nf && $f =~ /^"(.+)"$/) {
321 push(@new_fields, $1);
322 } elsif (!defined $nf && $f =~ /^'([^']+)$/) {
323 $nf = $1;
324 $char = "'";
325 } elsif (!defined $nf && $f =~ /^"([^"]+)$/) {
326 $nf = $1;
327 $char = "\"";
328 } elsif (defined $nf && $f =~ /^([^$char]+)$char$/) {
329 $nf .= " $1";
330 push(@new_fields, $nf);
331 $nf = undef;
332 $char = undef;
333 } elsif(defined $nf) {
334 $nf .= " $f";
335 } else {
336 push(@new_fields, $f);
337 }
338 }
339 @fields = @new_fields;
340 if ($debug) {
341 print STDERR Data::Dumper->Dump([@new_fields])
342 }
343
344 foreach my $i (2..7) {
345 $fields[$i] =~ s/&/\%(USER)/g;
346 $fields[$i] =~ s/\\\s/ /g;
347 }
348
349 if (defined($fields[1])) {
350 $attr{fstype} = $fields[1];
351 }
352 if (defined($fields[2])) {
353 $attr{server} = $fields[2];
354 }
355 if (defined($fields[3])) {
356 $attr{path} = $fields[3];
357 }
358 if (defined($fields[4])) {
359 $attr{mountpoint} = $fields[4];
360 }
361 if (defined($fields[5])) {
362 $attr{options} = $fields[5];
363 }
364 if (defined($fields[6])) {
365 $attr{fskeycipher}= $fields[6];
366 }
367 if (defined($fields[7])) {
368 $attr{fskeypath} = $fields[7];
369 }
370
371 $writer->emptyTag("volume", %attr );
372 }
373
374 sub parse_conf()
375 {
376 my @file;
377 open(OUT, "< $OLD_CONF") || die "Cannot open $OLD_CONF: $!\n";
378 @file = <OUT>;
379 close OUT;
380
381 foreach my $line (@file) {
382 chomp $line;
383
384 next if ($line =~ /^\s*#/);
385 next if ($line =~ /^\s*$/);
386
387 my @fields = split(/(?<!\\)\s+/, $line);
388 for (my $i = 0; $i <= $#fields; ++$i) {
389 if ($fields[$i] eq "#") {
390 #
391 # Old-style config file had this oddity in
392 # one spot, so need to trim it.
393 #
394 splice(@fields, $i);
395 last;
396 }
397 }
398
399 if (exists $callbacks{$fields[0]}) {
400 if ($debug) {
401 print STDERR "callback_$fields[0] called: ",
402 join(" ", @fields), "\n";
403 }
404
405 $callbacks{$fields[0]}->(@fields);
406 $writer->raw("\n\n");
407 } else {
408 print STDERR "Unknown command: $fields[0]\n";
409 }
410 }
411 }
412
413 &parse_conf();
414
415 $writer->endTag("pam_mount");
416 $writer->end();
417 $output->close();
2222 #==============================================================================
2323
2424 # Sanitize environment
25 export PATH="/bin:/sbin:/usr/bin:/usr/sbin";
25 export PATH="/sbin:/bin:/usr/sbin:/usr/bin";
2626 export IFS=`echo -en " \t\n"`;
27
28 # Commands
29 LOSETUP=/sbin/losetup
30 CRYPTSETUP=/sbin/cryptsetup
31 MOUNT=/bin/mount
32 FSCK="/sbin/fsck";
3327
3428 OPTIONS=""
3529 FSTYPE="";
3832
3933 -o options set the mount options [ $OPTIONS ]"
4034
41 _losetup() {
35 function _losetup()
36 {
37 local DEVICE;
38 local LOOPDEV;
39
4240 DEVICE="$1";
4341 LOOPDEV=0
4442 while [ "$LOOPDEV" -le 15 ]; do
45 if "$LOSETUP" "/dev/loop$LOOPDEV" "$DEVICE" 2>/dev/null; then
43 if losetup "/dev/loop$LOOPDEV" "$DEVICE" 2>/dev/null; then
4644 echo "/dev/loop$LOOPDEV";
4745 return 0
4846 fi
5856
5957 while :; do
6058 case "$1" in
61 -h | "-?" )
59 (-h|"-?")
6260 echo -e usage: ${0##*/} "$USAGE" >&2
6361 exit 1 ;;
64 -o )
62 (-o)
6563 OPTIONS="$2";
6664 shift ;;
67 -?* )
65 (-?*)
6866 echo "${0##*/}: unrecognized option: $1" >&2
6967 exit 1 ;;
70 * )
68 (*)
7169 break ;;
7270 esac
7371 shift
7573
7674 if [ -z "$DEVICE" ]; then
7775 echo "${0##*/}: device to mount not specified" >&2
76 exit 1;
7877 fi
7978
8079 if [ ! -f "$DEVICE" -a ! -b "$DEVICE" ]; then
9089 CIPHER=""
9190 KEYSIZE=""
9291 HASH=""
92 luks_ro="";
9393 LOOP=false
9494 DOFSCK=false;
9595 MOUNTOPTIONS=""
9696 OLDIFS="$IFS";
9797 IFS=", ";
98
9899 for opt in $OPTIONS; do
99 KEY=${opt%=*};
100 VAL=${opt#*=};
100 KEY="${opt%=*}";
101 VAL="${opt#*=}";
101102 case "$KEY" in
102 cipher )
103 CIPHER="$VAL"
104 ;;
105 keysize )
106 KEYSIZE="$VAL"
107 ;;
108 hash )
109 HASH="$VAL"
110 ;;
111 loop )
112 LOOP=true
113 ;;
114 fstype)
115 FSTYPE="$VAL";
116 ;;
117 fsck)
118 DOFSCK=true;
119 ;;
120 * )
103 (cipher) CIPHER="$VAL";;
104 (keysize) KEYSIZE="$VAL";;
105 (hash) HASH="$VAL";;
106 (loop) LOOP="true";;
107 (fstype) FSTYPE="$VAL";;
108 (fsck) DOFSCK="true";;
109 (*)
110 if [ "$opt" == "ro" ]; then
111 luks_ro="--readonly";
112 elif [ "$opt" == "rw" ]; then
113 luks_ro="";
114 fi;
121115 if [ -z "$MOUNTOPTIONS" ]; then
122116 MOUNTOPTIONS="$opt"
123117 else
129123 IFS="$OLDIFS";
130124
131125 if [ "$LOOP" == true ]; then
132 DEVICE=`_losetup "$DEVICE"`;
126 DEVICE=`_losetup "$DEVICE"`;
133127 fi
134128
135129 # if loop device, make device mapper name based on file pointed to
136130 case "$DEVICE" in
137131 /dev/loop*)
138 DMDEVICE=` "$LOSETUP" "$DEVICE" 2>/dev/null | sed 's/.*(\(.\+\)).*/\1/'`;
132 DMDEVICE=`losetup "$DEVICE" 2>/dev/null | sed 's/.*(\(.\+\)).*/\1/'`;
139133 esac;
140134 # if not a loop device or previous command fails use $DEVICE
141135 : ${DMDEVICE:=$DEVICE}
144138 DMDEVICE=`echo "$DMDEVICE" | sed 's/\//_/g'`;
145139
146140 # Check for LUKS
147 if "$CRYPTSETUP" isLuks "$DEVICE" 2>/dev/null; then
148 LUKS=true;
149 "$CRYPTSETUP" luksOpen "$DEVICE" "$DMDEVICE";
141 if cryptsetup isLuks "$DEVICE" 2>/dev/null; then
142 LUKS=true;
143 cryptsetup luksOpen $luks_ro "$DEVICE" "$DMDEVICE";
150144 else
151 LUKS=false;
152 "$CRYPTSETUP" -c "${CIPHER:-aes}" -h "${HASH:-ripemd160}" \
153 -s ${KEYSIZE:-256} create "$DMDEVICE" "$DEVICE";
145 LUKS=false;
146 cryptsetup -c "${CIPHER:-aes}" -h "${HASH:-ripemd160}" \
147 -s ${KEYSIZE:-256} create "$DMDEVICE" "$DEVICE";
154148 fi;
155149
156150 if [ $? -ne 0 ]; then
157151 echo "${0##*/}: error creating $DMDEVICE" >&2
158 [ "$LOOP" == true ] && "$LOSETUP" -d "$DEVICE";
152 [ "$LOOP" == true ] && losetup -d "$DEVICE";
159153 exit 1
160154 fi
161155
162156 if [ "$DOFSCK" == "true" ]; then
163 "$FSCK" -p "/dev/mapper/$DMDEVICE";
164 if [ $? -gt 1 ]; then
165 echo "${0##*/}: filesystem $DMDEVICE has errors" >&2;
166 if [ "$LUKS" == true ]; then
167 "$CRYPTSETUP" luksClose "$DMDEVICE";
168 else
169 "$CRYPTSETUP" remove "$DMDEVICE";
170 fi;
171 [ "$LOOP" == true ] && "$LOSETUP" -d "$DEVICE";
172 exit 1;
173 fi;
157 fsck -p "/dev/mapper/$DMDEVICE";
158 if [ $? -gt 1 ]; then
159 echo "${0##*/}: filesystem $DMDEVICE has errors" >&2;
160 if [ "$LUKS" == true ]; then
161 cryptsetup luksClose "$DMDEVICE";
162 else
163 cryptsetup remove "$DMDEVICE";
164 fi;
165 [ "$LOOP" == true ] && losetup -d "$DEVICE";
166 exit 1;
167 fi;
174168 fi;
175169
176170 # $MOUNT_POINT might not exist as mount can try to read it from /etc/fstab
177 "$MOUNT" ${FSTYPE:+-t "$FSTYPE"} ${MOUNTOPTIONS:+-o "$MOUNTOPTIONS"} \
178 "/dev/mapper/$DMDEVICE" "$MOUNT_POINT";
171 mount ${FSTYPE:+-t "$FSTYPE"} ${MOUNTOPTIONS:+-o "$MOUNTOPTIONS"} \
172 "/dev/mapper/$DMDEVICE" "$MOUNT_POINT";
173
179174 if [ $? -ne 0 ]; then
180 echo "${0##*/}: error mounting $DMDEVICE" >&2;
181 if [ "$LUKS" == true ]; then
182 "$CRYPTSETUP" luksClose "$DMDEVICE";
183 else
184 "$CRYPTSETUP" remove "$DMDEVICE";
185 fi;
186 [ "$LOOP" == true ] && "$LOSETUP" -d "$DEVICE";
187 exit 1;
175 echo "${0##*/}: error mounting $DMDEVICE" >&2;
176 if [ "$LUKS" == true ]; then
177 cryptsetup luksClose "$DMDEVICE";
178 else
179 cryptsetup remove "$DMDEVICE";
180 fi;
181 [ "$LOOP" == true ] && losetup -d "$DEVICE";
182 exit 1;
188183 fi;
(No changes)
2323 #==============================================================================
2424
2525 # Sanitize environment
26 export PATH="/bin:/sbin:/usr/bin:/usr/sbin";
26 export PATH="/sbin:/bin:/usr/sbin:/usr/bin";
2727 export IFS=`echo -en " \t\n"`;
2828
29 LOSETUP=/sbin/losetup
30 CRYPTSETUP=/sbin/cryptsetup
31 MOUNT=/bin/mount
32 UMOUNT=/bin/umount
33 READLINK="/usr/bin/readlink";
29 READLINK="`which readlink`";
3430 OPTIONS=""
3531 USAGE="dir"
3632
3733 if [ -z "$1" ]; then
3834 echo "${0##*/}: directory to unmount not specified" >&2
35 exit 1;
3936 fi
4037
4138 if [ ! -d "$1" ]; then
4441 fi
4542
4643 if [ -x "$READLINK" ]; then
47 DEVICEDIR=` "$READLINK" -f "$1"`;
44 DEVICEDIR=` "$READLINK" -f "$1"`;
4845 else
49 DEVICEDIR="$1";
46 DEVICEDIR="$1";
5047 fi;
5148 DEVICEDIR="${DEVICEDIR%/}";
52 DMDEVICE=` "$MOUNT" | grep " $DEVICEDIR " | awk '{ print $1 }' | sed 's/^\/dev\/mapper\///g'`;
49 DMDEVICE=`mount | grep " $DEVICEDIR " | awk '{ print $1 }' | sed 's/^\/dev\/mapper\///g'`;
5350
5451 if [ -z "$DMDEVICE" ]; then
55 echo "Could not map $DEVICEDIR to a DM device";
56 exit 1;
52 echo "Could not map $DEVICEDIR to a DM device";
53 exit 1;
5754 fi;
5855
5956 # ask cryptsetup about the underlying device
6057 #
61 REALDEVICE=` "$CRYPTSETUP" status "$DMDEVICE" | sed -n '/device/s/[ ]*device:[ ]*//p'`;
58 REALDEVICE=`cryptsetup status "$DMDEVICE" | sed -n '/device/s/[ ]*device:[ ]*//p'`;
6259
63 "$UMOUNT" "$1";
60 for ((x = 5; x >= 0; --x)); do
61 fuser -m "$1" || break;
62 echo "Some program is blocking our unmount. Not nice.";
63 sleep 1;
64 done;
65
66 umount "$1";
6467 if [ $? -ne 0 ]; then
6568 echo "${0##*/}: error unmounting $1" >&2
6669 exit 1
6871
6972 # Check for LUKS
7073 #
71 if "$CRYPTSETUP" isLuks "$DEVICE" 2>/dev/null; then
72 "$CRYPTSETUP" luksClose "$DMDEVICE";
74 if cryptsetup isLuks "$DEVICE" 2>/dev/null; then
75 cryptsetup luksClose "$DMDEVICE";
7376 else
74 "$CRYPTSETUP" remove "$DMDEVICE";
77 cryptsetup remove "$DMDEVICE";
7578 fi;
7679
7780 if [ $? -ne 0 ]; then
8083 fi
8184
8285 if echo "$REALDEVICE" | grep ^/dev/loop >/dev/null; then
83 "$LOSETUP" -d "$REALDEVICE";
86 losetup -d "$REALDEVICE";
8487 if [ $? -ne 0 ]; then
8588 echo "${0##*/}: error removing $REALDEVICE" >&2
8689 exit 1
0 # -*- Makefile -*-
1 #
02 # FILE: Makefile.am --
13 # AUTHOR: W. Michael Petullo <mike@flyn.org>
24 # DATE: 03 August 2002
1820 # along with this program; if not, write to the Free Software
1921 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2022
21 AUTOMAKE_OPTIONS = gnu
22
2323 moduledir = @PAM_MODDIR@
2424 module_LTLIBRARIES = pam_mount.la
2525 sbin_PROGRAMS = pmvarrun
2626
27 pam_mount_la_SOURCES = crypto.c misc.c pam_mount.c readconfig.c dotconf.c mount.c pair.c optlist.c fmt_ptrn.c modifiers.c template.c buffer.c spawn.c xstdlib.c
28 pam_mount_la_LDFLAGS = -module -avoid-version -lz $(GLIB_LIBS)
27 pam_mount_la_SOURCES = crypto.c misc.c pam_mount.c rdconf1.c rdconf2.c mount.c pair.c optlist.c buffer.c spawn.c xstdlib.c
28 pam_mount_la_LIBADD = -lHX
29 pam_mount_la_LDFLAGS = -module -avoid-version $(GLIB_LIBS) $(XML_LIBS)
2930
30 # [JE] There does not seem to be a difference between compiling with or without
31 # libtool, but automake sadly fails when the sources list contains
32 # "misc.c fmt_ptrn.c..."
33 pmvarrun_SOURCES = pmvarrun.c misc-nolibtool.c fmt_ptrn-nolibtool.c modifiers-nolibtool.c buffer-nolibtool.c template-nolibtool.c pair-nolibtool.c xstdlib-nolibtool.c
34 pmvarrun_LDFLAGS = -lz $(GLIB_LIBS)
31 pmvarrun_SOURCES = pmvarrun.c misc-nolibtool.c buffer-nolibtool.c pair-nolibtool.c xstdlib-nolibtool.c
32 pmvarrun_LDADD = -lHX
33 pmvarrun_LDFLAGS = $(GLIB_LIBS)
3534
36 INCLUDES = -I$(srcdir)/../include
37
38 AM_CFLAGS = $(GLIB_CFLAGS) -DG_DISABLE_DEPRECATED \
39 -D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 \
40 -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations \
41 -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \
42 -Winline -pipe @GCC_FVISIBILITY_HIDDEN@
35 AM_CFLAGS = $(GLIB_CFLAGS) $(XML_CPPFLAGS) -DG_DISABLE_DEPRECATED \
36 $(regular_CFLAGS) $(GCC_FVISIBILITY_HIDDEN)
4337
4438 install-data-hook:
45 ( \
46 cd $(DESTDIR)$(moduledir) && \
47 $(LN_S) pam_mount.so pam_mount_auth.so && \
48 $(LN_S) pam_mount.so pam_mount_session.so \
49 )
50
51 uninstall-hook:
52 rm -f $(DESTDIR)$(libdir)/pam_mount_auth.so
53 rm -f $(DESTDIR)$(libdir)/pam_mount_session.so
39 rm -f $(DESTDIR)$(moduledir)/pam_mount.la;
1313
1414 @SET_MAKE@
1515
16 # -*- Makefile -*-
17 #
1618 # FILE: Makefile.am --
1719 # AUTHOR: W. Michael Petullo <mike@flyn.org>
1820 # DATE: 03 August 2002
6163 subdir = src
6264 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
6365 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
64 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
66 am__aclocal_m4_deps = $(top_srcdir)/m4lib/gcc4_visibility.m4 \
67 $(top_srcdir)/configure.ac
6568 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
6669 $(ACLOCAL_M4)
6770 mkinstalldirs = $(install_sh) -d
7679 am__installdirs = "$(DESTDIR)$(moduledir)" "$(DESTDIR)$(sbindir)"
7780 moduleLTLIBRARIES_INSTALL = $(INSTALL)
7881 LTLIBRARIES = $(module_LTLIBRARIES)
79 pam_mount_la_LIBADD =
80 am_pam_mount_la_OBJECTS = crypto.lo misc.lo pam_mount.lo readconfig.lo \
81 dotconf.lo mount.lo pair.lo optlist.lo fmt_ptrn.lo \
82 modifiers.lo template.lo buffer.lo spawn.lo xstdlib.lo
82 pam_mount_la_DEPENDENCIES =
83 am_pam_mount_la_OBJECTS = crypto.lo misc.lo pam_mount.lo rdconf1.lo \
84 rdconf2.lo mount.lo pair.lo optlist.lo buffer.lo spawn.lo \
85 xstdlib.lo
8386 pam_mount_la_OBJECTS = $(am_pam_mount_la_OBJECTS)
8487 sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
8588 PROGRAMS = $(sbin_PROGRAMS)
8689 am_pmvarrun_OBJECTS = pmvarrun.$(OBJEXT) misc-nolibtool.$(OBJEXT) \
87 fmt_ptrn-nolibtool.$(OBJEXT) modifiers-nolibtool.$(OBJEXT) \
88 buffer-nolibtool.$(OBJEXT) template-nolibtool.$(OBJEXT) \
89 pair-nolibtool.$(OBJEXT) xstdlib-nolibtool.$(OBJEXT)
90 buffer-nolibtool.$(OBJEXT) pair-nolibtool.$(OBJEXT) \
91 xstdlib-nolibtool.$(OBJEXT)
9092 pmvarrun_OBJECTS = $(am_pmvarrun_OBJECTS)
91 pmvarrun_LDADD = $(LDADD)
93 pmvarrun_DEPENDENCIES =
94 AM_LIBTOOL_SILENT = $(if $(V),,--silent)
95 AM_VERBOSE_CC = $(if $(V),,@echo " CC " $@;)
96 AM_VERBOSE_CCLD = $(if $(V),,@echo " CCLD " $@;)
97 AM_VERBOSE_CXX = $(if $(V),,@echo " CXX " $@;)
98 AM_VERBOSE_CXXLD = $(if $(V),,@echo " CXXLD " $@;)
99 AM_VERBOSE_OBJC = $(if $(V),,@echo " OBJC " $@;)
100 AM_VERBOSE_OBJCLD = $(if $(V),,@echo " OBJCLD " $@;)
101 AM_VERBOSE_YACC = $(if $(V),,@echo " YACC " $@;)
102 AM_VERBOSE_LEX = $(if $(V),,@echo " LEX " $@;)
103 AM_VERBOSE_AS = $(if $(V),,@echo " AS " $@;)
104 AM_VERBOSE_F77 = $(if $(V),,@echo " F77 " $@;)
105 AM_VERBOSE_F77LD = $(if $(V),,@echo " F77LD " $@;)
106 AM_VERBOSE_FC = $(if $(V),,@echo " FC " $@;)
107 AM_VERBOSE_FCLD = $(if $(V),,@echo " FCLD " $@;)
108 AM_VERBOSE_GCJ = $(if $(V),,@echo " GCJ " $@;)
109 AM_VERBOSE_GCJLD = $(if $(V),,@echo " GCJLD " $@;)
110 AM_VERBOSE_GEN = $(if $(V),,@echo " GEN " $@;)
92111 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
93112 depcomp = $(SHELL) $(top_srcdir)/depcomp
94113 am__depfiles_maybe = depfiles
95114 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
96115 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
97 LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
98 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
99 $(AM_CFLAGS) $(CFLAGS)
116 LTCOMPILE = $(LIBTOOL) $(AM_LIBTOOL_SILENT) --tag=CC --mode=compile \
117 $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
118 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
100119 CCLD = $(CC)
101 LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
102 $(AM_LDFLAGS) $(LDFLAGS) -o $@
120 LINK = $(LIBTOOL) $(AM_LIBTOOL_SILENT) --tag=CC --mode=link $(CCLD) \
121 $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
103122 SOURCES = $(pam_mount_la_SOURCES) $(pmvarrun_SOURCES)
104123 DIST_SOURCES = $(pam_mount_la_SOURCES) $(pmvarrun_SOURCES)
105124 ETAGS = etags
134153 EXEEXT = @EXEEXT@
135154 F77 = @F77@
136155 FFLAGS = @FFLAGS@
137 FLYN_FALSE = @FLYN_FALSE@
138 FLYN_TRUE = @FLYN_TRUE@
139156 GCC_FVISIBILITY_HIDDEN = @GCC_FVISIBILITY_HIDDEN@
140157 GLIB_CFLAGS = @GLIB_CFLAGS@
141158 GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
142159 GLIB_LIBS = @GLIB_LIBS@
143160 GLIB_MKENUMS = @GLIB_MKENUMS@
144161 GOBJECT_QUERY = @GOBJECT_QUERY@
162 GREP = @GREP@
145163 INSTALL_DATA = @INSTALL_DATA@
146164 INSTALL_PROGRAM = @INSTALL_PROGRAM@
147165 INSTALL_SCRIPT = @INSTALL_SCRIPT@
152170 LIBTOOL = @LIBTOOL@
153171 LN_S = @LN_S@
154172 LTLIBOBJS = @LTLIBOBJS@
155 MAJOR_VERSION = @MAJOR_VERSION@
156173 MAKEINFO = @MAKEINFO@
157 MICRO_VERSION = @MICRO_VERSION@
158 MINOR_VERSION = @MINOR_VERSION@
159174 OBJEXT = @OBJEXT@
160175 PACKAGE = @PACKAGE@
161176 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
171186 SHELL = @SHELL@
172187 STRIP = @STRIP@
173188 VERSION = @VERSION@
174 VER_INFO = @VER_INFO@
175 ac_ct_AR = @ac_ct_AR@
189 XML2_CONFIG = @XML2_CONFIG@
190 XML_CPPFLAGS = @XML_CPPFLAGS@
191 XML_LIBS = @XML_LIBS@
176192 ac_ct_CC = @ac_ct_CC@
177193 ac_ct_CXX = @ac_ct_CXX@
178194 ac_ct_F77 = @ac_ct_F77@
179 ac_ct_RANLIB = @ac_ct_RANLIB@
180 ac_ct_STRIP = @ac_ct_STRIP@
181195 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
182196 am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
183197 am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
194208 build_os = @build_os@
195209 build_vendor = @build_vendor@
196210 datadir = @datadir@
211 datarootdir = @datarootdir@
212 docdir = @docdir@
213 dvidir = @dvidir@
197214 exec_prefix = @exec_prefix@
198215 host = @host@
199216 host_alias = @host_alias@
200217 host_cpu = @host_cpu@
201218 host_os = @host_os@
202219 host_vendor = @host_vendor@
220 htmldir = @htmldir@
203221 includedir = @includedir@
204222 infodir = @infodir@
205223 install_sh = @install_sh@
206224 libdir = @libdir@
207225 libexecdir = @libexecdir@
226 localedir = @localedir@
208227 localstatedir = @localstatedir@
209228 mandir = @mandir@
210229 mkdir_p = @mkdir_p@
211230 oldincludedir = @oldincludedir@
231 pdfdir = @pdfdir@
212232 prefix = @prefix@
213233 program_transform_name = @program_transform_name@
234 psdir = @psdir@
235 regular_CFLAGS = @regular_CFLAGS@
214236 sbindir = @sbindir@
215237 sharedstatedir = @sharedstatedir@
216238 slibdir = @slibdir@
217239 ssbindir = @ssbindir@
218240 sysconfdir = @sysconfdir@
219241 target_alias = @target_alias@
220 AUTOMAKE_OPTIONS = gnu
221242 moduledir = @PAM_MODDIR@
222243 module_LTLIBRARIES = pam_mount.la
223 pam_mount_la_SOURCES = crypto.c misc.c pam_mount.c readconfig.c dotconf.c mount.c pair.c optlist.c fmt_ptrn.c modifiers.c template.c buffer.c spawn.c xstdlib.c
224 pam_mount_la_LDFLAGS = -module -avoid-version -lz $(GLIB_LIBS)
225
226 # [JE] There does not seem to be a difference between compiling with or without
227 # libtool, but automake sadly fails when the sources list contains
228 # "misc.c fmt_ptrn.c..."
229 pmvarrun_SOURCES = pmvarrun.c misc-nolibtool.c fmt_ptrn-nolibtool.c modifiers-nolibtool.c buffer-nolibtool.c template-nolibtool.c pair-nolibtool.c xstdlib-nolibtool.c
230 pmvarrun_LDFLAGS = -lz $(GLIB_LIBS)
231 INCLUDES = -I$(srcdir)/../include
232 AM_CFLAGS = $(GLIB_CFLAGS) -DG_DISABLE_DEPRECATED \
233 -D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 \
234 -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations \
235 -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \
236 -Winline -pipe @GCC_FVISIBILITY_HIDDEN@
244 pam_mount_la_SOURCES = crypto.c misc.c pam_mount.c rdconf1.c rdconf2.c mount.c pair.c optlist.c buffer.c spawn.c xstdlib.c
245 pam_mount_la_LIBADD = -lHX
246 pam_mount_la_LDFLAGS = -module -avoid-version $(GLIB_LIBS) $(XML_LIBS)
247 pmvarrun_SOURCES = pmvarrun.c misc-nolibtool.c buffer-nolibtool.c pair-nolibtool.c xstdlib-nolibtool.c
248 pmvarrun_LDADD = -lHX
249 pmvarrun_LDFLAGS = $(GLIB_LIBS)
250 AM_CFLAGS = $(GLIB_CFLAGS) $(XML_CPPFLAGS) -DG_DISABLE_DEPRECATED \
251 $(regular_CFLAGS) $(GCC_FVISIBILITY_HIDDEN)
237252
238253 all: all-am
239254
296311 rm -f "$${dir}/so_locations"; \
297312 done
298313 pam_mount.la: $(pam_mount_la_OBJECTS) $(pam_mount_la_DEPENDENCIES)
314 $(AM_VERBOSE_CCLD) \
299315 $(LINK) -rpath $(moduledir) $(pam_mount_la_LDFLAGS) $(pam_mount_la_OBJECTS) $(pam_mount_la_LIBADD) $(LIBS)
300316 install-sbinPROGRAMS: $(sbin_PROGRAMS)
301317 @$(NORMAL_INSTALL)
327343 done
328344 pmvarrun$(EXEEXT): $(pmvarrun_OBJECTS) $(pmvarrun_DEPENDENCIES)
329345 @rm -f pmvarrun$(EXEEXT)
346 $(AM_VERBOSE_CCLD) \
330347 $(LINK) $(pmvarrun_LDFLAGS) $(pmvarrun_OBJECTS) $(pmvarrun_LDADD) $(LIBS)
331348
332349 mostlyclean-compile:
338355 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffer-nolibtool.Po@am__quote@
339356 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffer.Plo@am__quote@
340357 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crypto.Plo@am__quote@
341 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dotconf.Plo@am__quote@
342 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fmt_ptrn-nolibtool.Po@am__quote@
343 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fmt_ptrn.Plo@am__quote@
344358 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc-nolibtool.Po@am__quote@
345359 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Plo@am__quote@
346 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modifiers-nolibtool.Po@am__quote@
347 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modifiers.Plo@am__quote@
348360 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount.Plo@am__quote@
349361 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/optlist.Plo@am__quote@
350362 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pair-nolibtool.Po@am__quote@
351363 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pair.Plo@am__quote@
352364 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pam_mount.Plo@am__quote@
353365 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pmvarrun.Po@am__quote@
354 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readconfig.Plo@am__quote@
366 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdconf1.Plo@am__quote@
367 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdconf2.Plo@am__quote@
355368 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn.Plo@am__quote@
356 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/template-nolibtool.Po@am__quote@
357 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/template.Plo@am__quote@
358369 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstdlib-nolibtool.Po@am__quote@
359370 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstdlib.Plo@am__quote@
360371
361372 .c.o:
373 @am__fastdepCC_TRUE@ $(AM_VERBOSE_CC) \
362374 @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
363375 @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
364376 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
366378 @am__fastdepCC_FALSE@ $(COMPILE) -c $<
367379
368380 .c.obj:
381 @am__fastdepCC_TRUE@ $(AM_VERBOSE_CC) \
369382 @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
370383 @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
371384 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
373386 @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
374387
375388 .c.lo:
389 @am__fastdepCC_TRUE@ $(AM_VERBOSE_CC) \
376390 @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
377391 @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
378392 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
548562
549563 uninstall-am: uninstall-info-am uninstall-moduleLTLIBRARIES \
550564 uninstall-sbinPROGRAMS
551 @$(NORMAL_INSTALL)
552 $(MAKE) $(AM_MAKEFLAGS) uninstall-hook
553565
554566 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
555567 clean-libtool clean-moduleLTLIBRARIES clean-sbinPROGRAMS ctags \
562574 installcheck installcheck-am installdirs maintainer-clean \
563575 maintainer-clean-generic mostlyclean mostlyclean-compile \
564576 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
565 tags uninstall uninstall-am uninstall-hook uninstall-info-am \
577 tags uninstall uninstall-am uninstall-info-am \
566578 uninstall-moduleLTLIBRARIES uninstall-sbinPROGRAMS
567579
568580
569581 install-data-hook:
570 ( \
571 cd $(DESTDIR)$(moduledir) && \
572 $(LN_S) pam_mount.so pam_mount_auth.so && \
573 $(LN_S) pam_mount.so pam_mount_session.so \
574 )
575
576 uninstall-hook:
577 rm -f $(DESTDIR)$(libdir)/pam_mount_auth.so
578 rm -f $(DESTDIR)$(libdir)/pam_mount_session.so
582 rm -f $(DESTDIR)$(moduledir)/pam_mount.la;
579583 # Tell versions [3.59,3.63) of GNU make to not export all variables.
580584 # Otherwise a system limit (for SysV at least) may be exceeded.
581585 .NOEXPORT:
00 /*=============================================================================
1 buffer.c
1 pam_mount - buffer.c
22 Copyright (C) W. Michael Putello <mike@flyn.org>, 1999 - 2001
3 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
3 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2007
44
55 This program is free software; you can redistribute it and/or modify
66 it under the terms of the GNU Lesser General Public License as
2626 #include "buffer.h"
2727 #include "xstdlib.h"
2828
29 //-----------------------------------------------------------------------------
30 /* buffer_valid
31 @b: buffer to check
32
33 Verifies that the buffer structure is consistent.
34 */
35 int buffer_valid(const struct buffer *b) {
29 /* buffer_valid -
30 * @b: buffer to check
31 *
32 * Verifies that the buffer structure is consistent.
33 */
34 int buffer_valid(const struct buffer *b)
35 {
3636 int i;
3737 if (b == NULL)
38 return FALSE;
39 if((b->data == NULL) ^ (b->size == 0))
40 return FALSE;
41 if(b->data != NULL) {
42 for (i = 0; i < b->size; i++) {
43 if(b->data[i] == '\0')
44 return TRUE;
45 }
46 }
47 return TRUE;
38 return 0;
39 if ((b->data == NULL) ^ (b->size == 0))
40 return 0;
41 if (b->data != NULL)
42 for (i = 0; i < b->size; i++)
43 if (b->data[i] == '\0')
44 return 1;
45 return 1;
4846 }
4947
48 /* buffer_clear -
49 * @b: buffer to clear
50 *
51 * Clears the contents of the buffer.
52 */
53 void buffer_clear(struct buffer *buf)
54 {
55 assert(buffer_valid(buf));
5056
51 /* buffer_clear
52 @b: buffer to clear
53
54 Clears the contents of the buffer.
55 */
56 void buffer_clear(struct buffer *buf) {
57 assert(buffer_valid(buf));
58
59 if(buf->data != NULL) {
60 free(buf->data);
61 buf->data = NULL;
62 }
63 buf->size = 0;
64
65 assert(buffer_valid(buf));
66 return;
57 if (buf->data != NULL) {
58 free(buf->data);
59 buf->data = NULL;
60 }
61 buf->size = 0;
62 assert(buffer_valid(buf));
63 return;
6764 }
6865
66 /* buffer_eat -
67 * @buf: buffer to edit
68 * @n: haracters to consume
69 *
70 * Removes the first @n characters off the beginning of the buffer.
71 */
72 void buffer_eat(struct buffer *buf, size_t n)
73 {
74 size_t z;
6975
70 /* buffer_eat
71 @buf: buffer to edit
72 @n: characters to consume
73
74 Removes the first @n characters off the beginning of the buffer.
75 */
76 void buffer_eat(struct buffer *buf, size_t n) {
77 size_t z;
78
79 assert(buffer_valid(buf));
80 z = strlen(buf->data);
81 if(n > z)
82 n = z;
83 memmove(buf->data, buf->data + n, n + 1); // +1 to copy the '\0' also
84 assert(buffer_valid(buf));
85 return;
76 assert(buffer_valid(buf));
77 z = strlen(buf->data);
78 if (n > z)
79 n = z;
80 /* +1 to copy the '\0' too */
81 memmove(buf->data, buf->data + n, n + 1);
82 assert(buffer_valid(buf));
83 return;
8684 }
8785
88
89 /* buffer_len
90 @b: buffer to analyze
91
92 Returns the string length of the buffer @b.
93 */
94 size_t buffer_len(const struct buffer *buf) {
95 assert(buffer_valid(buf));
96 return (buf->data == NULL) ? 0 : strlen(buf->data);
86 /* buffer_len -
87 * @b: buffer to analyze
88 *
89 * Returns the string length of the buffer @b.
90 */
91 size_t buffer_len(const struct buffer *buf)
92 {
93 assert(buffer_valid(buf));
94 return (buf->data == NULL) ? 0 : strlen(buf->data);
9795 }
9896
97 /*
98 * realloc_n_cat -
99 * @dest: destination buffer
100 * @src: source string
101 *
102 * Append @src to the buffer pointed to by @dest, necessarily reallocating
103 * @dest's buffer.
104 */
105 void realloc_n_cat(struct buffer *dest, const char *src)
106 {
107 size_t new_len;
99108
100 /* realloc_n_cat
101 @dest: destination buffer
102 @src: source string
109 assert(buffer_valid(dest));
110 assert(src != NULL);
103111
104 Append @src to the buffer pointed to by @dest, necessarily reallocating
105 @dest's buffer.
106 */
107 void realloc_n_cat(struct buffer *dest, const char *src) {
108 size_t new_len;
109
110 assert(buffer_valid(dest));
111 assert(src != NULL);
112
113 new_len = strlen(src) + ((dest != NULL && dest->data != NULL) ?
114 strlen(dest->data) : 0);
115 if(dest->data == NULL) {
116 dest->size = new_len * 2 + 1;
117 dest->data = xmalloc(dest->size);
118 *dest->data = '\0';
119 } else if (new_len + 1 > dest->size) {
120 dest->size = new_len * 2 + 1;
121 dest->data = xrealloc(dest->data, dest->size);
122 }
123 g_strlcat(dest->data, src, dest->size);
124
125 assert(buffer_valid(dest));
126 return;
112 new_len = strlen(src) + ((dest != NULL && dest->data != NULL) ?
113 strlen(dest->data) : 0);
114 if (dest->data == NULL) {
115 dest->size = new_len * 2 + 1;
116 dest->data = xmalloc(dest->size);
117 *dest->data = '\0';
118 } else if (new_len + 1 > dest->size) {
119 dest->size = new_len * 2 + 1;
120 dest->data = xrealloc(dest->data, dest->size);
121 }
122 g_strlcat(dest->data, src, dest->size);
123 assert(buffer_valid(dest));
124 return;
127125 }
128126
127 /* realloc_n_ncat -
128 * @dest: destination buffer
129 * @src: source string
130 * @nc: maximum length of string
131 *
132 * Append at most @nc characters from @src to the buffer pointed to by @dest,
133 * necessarily reallocating @dest's buffer.
134 */
135 void realloc_n_ncat(struct buffer *dest, const char *src, const size_t nc)
136 {
137 size_t src_len, new_len;
129138
130 /* realloc_n_ncat
131 @dest: destination buffer
132 @src: source string
133 @nc: maximum length of string
139 assert(buffer_valid(dest));
140 assert(src != NULL);
134141
135 Append at most @nc characters from @src to the buffer pointed to by @dest,
136 necessarily reallocating @dest's buffer.
137 */
138 void realloc_n_ncat(struct buffer *dest, const char *src, const size_t nc) {
139 size_t src_len, new_len;
142 src_len = strlen(src);
143 new_len = ((dest != NULL && dest->data != NULL) ? strlen(dest->data) : 0) +
144 ((src_len < nc) ? src_len : nc);
140145
141 assert(buffer_valid(dest));
142 assert(src != NULL);
146 if (dest->data == NULL) {
147 dest->size = new_len * 2 + 1;
148 dest->data = xmalloc(dest->size);
149 *dest->data = '\0';
150 } else if (new_len + 1 > dest->size) {
151 dest->size = new_len * 2 + 1;
152 dest->data = xrealloc(dest->data, dest->size);
153 }
143154
144 src_len = strlen(src);
145 new_len = ((dest != NULL && dest->data != NULL) ? strlen(dest->data) : 0) +
146 ((src_len < nc) ? src_len : nc);
155 /*
156 * g_strlcat() will not work because there is no way to pass @nc.
157 * HX_strlncat(dest->data, src, dest->size, nc) would be the ideal
158 * solution.
159 */
160 strncat(dest->data, src, nc);
161 dest->data[dest->size - 1] = '\0';
147162
148 if(dest->data == NULL) {
149 dest->size = new_len * 2 + 1;
150 dest->data = xmalloc(dest->size);
151 *dest->data = '\0';
152 } else if (new_len + 1 > dest->size) {
153 dest->size = new_len * 2 + 1;
154 dest->data = xrealloc(dest->data, dest->size);
155 }
156
157 /* g_strlcat() will not work because there is no way to pass @nc.
158 HX_strlncat(dest->data, src, dest->size, nc) would be the ideal solution. */
159 strncat(dest->data, src, nc);
160 dest->data[dest->size - 1] = '\0';
161
162 assert(buffer_valid(dest));
163 return;
163 assert(buffer_valid(dest));
164 return;
164165 }
165166
167 /* realloc_n_cpy -
168 * @dest: destination buffer
169 * @src: source string
170 *
171 * Copies @src to the buffer pointed to by @dest, necessarily reallocating
172 * @dest's buffer.
173 */
174 void realloc_n_cpy(struct buffer *dest, const char *src)
175 {
176 assert(buffer_valid(dest));
177 assert(src != NULL);
166178
167 /* realloc_n_cpy
168 @dest: destination buffer
169 @src: source string
179 if (dest->data != NULL)
180 *dest->data = '\0';
181 realloc_n_cat(dest, src);
170182
171 Copies @src to the buffer pointed to by @dest, necessarily reallocating
172 @dest's buffer.
173 */
174 void realloc_n_cpy(struct buffer *dest, const char *src) {
175 assert(buffer_valid(dest));
176 assert(src != NULL);
177
178 if(dest->data != NULL)
179 *dest->data = '\0';
180 realloc_n_cat(dest, src);
181
182 assert(buffer_valid(dest));
183 return;
183 assert(buffer_valid(dest));
184 return;
184185 }
185
186 //=============================================================================
0 /*=============================================================================
1 buffer.h
2 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of
7 the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to:
16 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 Boston, MA 02110-1301 USA
18
19 -- For details, see the file named "LICENSE.LGPL2"
20 =============================================================================*/
210 #ifndef PMT_BUFFER_H
221 #define PMT_BUFFER_H 1
232
243 #include <sys/types.h>
254 #include <stdio.h>
265
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
316 struct buffer {
32 char *data; // '\0'-terminated string
33 size_t size; // malloc()'ated length, not string length
7 char *data; /* '\0'-terminated string */
8 size_t size; /* allocated length, not string length */
349 };
3510
3611 /*
37 * BUFFER.C
12 * BUFFER.C
3813 */
3914 extern void buffer_clear(struct buffer *);
4015 extern void buffer_eat(struct buffer *, size_t);
4520 extern void realloc_n_ncat(struct buffer *, const char *, size_t);
4621
4722 /*
48 * INLINE FUNCTIONS
23 * INLINE FUNCTIONS
4924 */
50 static inline void buffer_init(struct buffer *x) {
51 x->size = 0;
52 x->data = NULL;
53 return;
25 static inline void buffer_init(struct buffer *x)
26 {
27 x->size = 0;
28 x->data = NULL;
29 return;
5430 }
5531
56 #ifdef __cplusplus
57 } // extern "C"
58 #endif
59
60 #endif // PMT_BUFFER_H
61
62 //=============================================================================
32 #endif /* PMT_BUFFER_H */
0 /*=============================================================================
1 compiler.h
2 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2006
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of
7 the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to:
16 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 Boston, MA 02110-1301 USA
18
19 -- For details, see the file named "LICENSE.LGPL2"
20 =============================================================================*/
210 #ifndef PMT_COMPILER_H
221 #define PMT_COMPILER_H 1
232
24 #ifdef __cplusplus
25 extern "C" {
3 #include "config.h"
4 #include <libHX.h>
5
6 #ifdef HAVE_VISIBILITY_HIDDEN
7 # define EXPORT_SYMBOL __attribute__((visibility("default")))
8 #else
9 # define EXPORT_SYMBOL
2610 #endif
2711
28 #include <config.h>
29
30 #ifdef HAVE_VISIBILITY_HIDDEN
31 # define EXPORT_SYMBOL __attribute__((visibility("default")))
32 #else
33 # define EXPORT_SYMBOL
34 #endif
35
36 // These are just code annotations
12 /* These are just code annotations */
3713 #define const_cast(type, expr) ((type)(expr))
3814 #define signed_cast(type, expr) ((type)(expr))
3915 #define reinterpret_cast(type, expr) ((type)(expr))
4016 #define static_cast(type, expr) ((type)(expr))
4117
42 #ifdef __cplusplus
43 } // extern "C"
44 #endif
18 /* Short wrappers */
19 static inline void format_add(struct HXbtree *table, const char *key,
20 const char *value)
21 {
22 HXformat_add(table, key, value, HXTYPE_STRING | HXFORMAT_IMMED);
23 return;
24 }
4525
46 #endif // PMT_COMPILER_H
47
48 //=============================================================================
26 #endif /* PMT_COMPILER_H */
00 /*=============================================================================
1 crypto.c
1 pam_mount - crypto.c
22 Copyright (C) W. Michael Putello <mike@flyn.org>, 2002
3 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
3 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2007
44
55 This program is free software; you can redistribute it and/or modify
66 it under the terms of the GNU Lesser General Public License as
2525 #include <stdio.h>
2626 #include <string.h>
2727 #ifdef HAVE_LIBCRYPTO
28 # include <openssl/ssl.h>
29 # include <openssl/evp.h>
30 # include <openssl/err.h>
31 # ifndef EVP_MAX_BLOCK_LENGTH
32 # define EVP_MAX_BLOCK_LENGTH 32 /* some older openssl versions need this */
33 # endif
34 #else
35 # define EVP_MAX_BLOCK_LENGTH 0 /* FIXME: this is ugly, but needed */
28 # include <openssl/ssl.h>
29 # include <openssl/evp.h>
30 # include <openssl/err.h>
3631 #endif
3732 #include "compiler.h"
3833 #include "crypto.h"
3934 #include "misc.h"
4035 #include "private.h"
4136
42 // Functions
37 /* Functions */
4338 #ifdef HAVE_LIBCRYPTO
4439 static int hash_authtok(FILE *, const EVP_CIPHER *, const char *,
45 unsigned char *, unsigned char *);
40 unsigned char *, unsigned char *);
4641 static void sslerror(const char *);
4742 #endif
4843
4944 //-----------------------------------------------------------------------------
5045 #ifdef HAVE_LIBCRYPTO
51 /* sslerror
52 @msg: Prefix to display
53
54 Print the human-readable form of the current SSL error.
55 */
56 static void sslerror(const char *msg) {
46 /*
47 * sslerror -
48 * @msg: Prefix to display
49 *
50 * Print the human-readable form of the current SSL error.
51 */
52 static void sslerror(const char *msg)
53 {
5754 unsigned long err = ERR_get_error();
58 if(err != 0)
59 l0g(PMPREFIX "%s: %s", msg, ERR_error_string(err, NULL));
60 }
61
62
63 /* hash_authtok
64 @fp: stream containing encrypted stream
65 @cipher: OpenSSL cipher struct
66 @authtok: key to unlock stream
67 @hash:
68 @iv: initialization vector for @fp
69
70 Returns zero on error or positive non-zero on success.
71 */
55 if (err != 0)
56 l0g("%s: %s", msg, ERR_error_string(err, NULL));
57 return;
58 }
59
60 /*
61 * hash_authtok -
62 * @fp: stream containing encrypted stream
63 * @cipher: OpenSSL cipher struct
64 * @authtok: key to unlock stream
65 * @hash:
66 * @iv: initialization vector for @fp
67 *
68 * Returns zero on error or positive non-zero on success.
69 */
7270 static int hash_authtok(FILE *fp, const EVP_CIPHER *cipher,
73 const char *authtok, unsigned char *hash, unsigned char *iv)
71 const char *authtok, unsigned char *hash, unsigned char *iv)
7472 {
7573 const EVP_MD *md;
7674 unsigned char salt[PKCS5_SALT_LEN];
77 char magic[sizeof("Salted__") - 1];
75 char magic[sizeof_z("Salted__")];
7876
7977 assert(fp != NULL); /* FIXME: check if valid, open file */
8078 assert(cipher != NULL); /* FIXME: check if cipher is valid OpenSSL cipher */
8280 assert(hash != NULL); /* FIXME: check hash is big enough? */
8381 assert(iv != NULL); /* FIXME: check iv is big enough? */
8482
85 if(fread(magic, 1, sizeof(magic), fp) != sizeof("Salted__") - 1
86 || fread(salt, 1, sizeof(salt), fp) != PKCS5_SALT_LEN) {
87 l0g(PMPREFIX "error reading salt from encrypted filesystem key\n");
83 if (fread(magic, 1, sizeof(magic), fp) != sizeof_z("Salted__") ||
84 fread(salt, 1, sizeof(salt), fp) != PKCS5_SALT_LEN) {
85 l0g("error reading salt from encrypted filesystem key\n");
8886 return 0;
8987 }
90 if(memcmp(magic, "Salted__", sizeof(magic)) != 0) {
91 l0g(PMPREFIX "magic string Salted__ not in filesystem key file\n");
88 if (memcmp(magic, "Salted__", sizeof(magic)) != 0) {
89 l0g("magic string Salted__ not in filesystem key file\n");
9290 return 0;
9391 }
9492 md = EVP_md5();
95 if(EVP_BytesToKey(cipher, md, salt,
96 signed_cast(const unsigned char *, authtok),
97 strlen(authtok), 1, hash, iv) <= 0) {
98 l0g(PMPREFIX "failed to hash system password\n");
93 if (EVP_BytesToKey(cipher, md, salt,
94 signed_cast(const unsigned char *, authtok),
95 strlen(authtok), 1, hash, iv) <= 0) {
96 l0g("failed to hash system password\n");
9997 return 0;
10098 }
10199
102100 return 1;
103101 }
104102
105
106 /* decrypted_key
107 @pt_fs_key: filesystem key
108 @pt_fs_key_len: filesystem key length
109 @fs_key_path: path to an encrypted file (EFSK)
110 @fs_key_cipher: the cipher used to encrypt the file
111 @authtok: key to unlock the file at @fs_key_path
112
113 Returns zero on error or positive non-zero on success.
114
115 NOTES:
116 * @pt_fs_key must point to a memory block large enough to hold fsk
117 (MAX_PAR + EVP_MAX_BLOCK_LENGTH -- length of @ct_fs_key + one block)
118 * efsk = encrypted filesystem key (stored in filesystem)
119 * fsk = filesystem key (D(efsk))
120 * @pt_fs_key will contain binary data; do not use strlen(), strcpy(), etc.
121 * @pt_fs_key may contain trailing garbage; use @pt_fs_key_len
122
123 FIXME: this function may need to be broken up and made more readable.
124 */
103 /*
104 * decrypted_key -
105 * @pt_fs_key: filesystem key
106 * @pt_fs_key_len: filesystem key length
107 * @fs_key_path: path to an encrypted file (EFSK)
108 * @fs_key_cipher: the cipher used to encrypt the file
109 * @authtok: key to unlock the file at @fs_key_path
110 *
111 * Returns zero on error or positive non-zero on success.
112 *
113 * NOTES:
114 * - @pt_fs_key must point to a memory block large enough to hold fsk
115 * (MAX_PAR + EVP_MAX_BLOCK_LENGTH -- length of @ct_fs_key + one block)
116 * - efsk = encrypted filesystem key (stored in filesystem)
117 * - fsk = filesystem key (D(efsk))
118 * - @pt_fs_key will contain binary data; do not use strlen(), strcpy(), etc.
119 * - @pt_fs_key may contain trailing garbage; use @pt_fs_key_len
120 *
121 * FIXME: this function may need to be broken up and made more readable.
122 */
125123 int decrypted_key(unsigned char *pt_fs_key, size_t *pt_fs_key_len,
126 const char *fs_key_path, const char *fs_key_cipher, const char *authtok)
124 const char *fs_key_path, const char *fs_key_cipher, const char *authtok)
127125 {
128126 int ret = 1;
129127 int segment_len;
145143 OpenSSL_add_all_ciphers();
146144 EVP_CIPHER_CTX_init(&ctx);
147145 SSL_load_error_strings();
148 if((fs_key_fp = fopen(fs_key_path, "r")) == NULL) {
149 l0g(PMPREFIX "error opening %s\n", fs_key_path);
146 if ((fs_key_fp = fopen(fs_key_path, "r")) == NULL) {
147 l0g("error opening %s\n", fs_key_path);
150148 ret = 0;
151149 goto _return_no_close;
152150 }
153 if((cipher = EVP_get_cipherbyname(fs_key_cipher)) == NULL) {
154 l0g(PMPREFIX "error getting cipher \"%s\"\n",
155 fs_key_cipher);
156 ret = 0;
157 goto _return;
158 }
159 if(hash_authtok(fs_key_fp, cipher, authtok, hashed_authtok, iv) == 0) {
160 ret = 0;
161 goto _return;
162 }
163 if ((ct_fs_key_len = fread(ct_fs_key, 1, sizeof(ct_fs_key), fs_key_fp)) == 0) {
164 l0g(PMPREFIX "failed to read encrypted filesystem key from %s\n", fs_key_path);
165 ret = 0;
166 goto _return;
167 }
168 if(EVP_DecryptInit_ex(&ctx, cipher, NULL, hashed_authtok, iv) == 0) {
151 if ((cipher = EVP_get_cipherbyname(fs_key_cipher)) == NULL) {
152 l0g("error getting cipher \"%s\"\n", fs_key_cipher);
153 ret = 0;
154 goto _return;
155 }
156 if (hash_authtok(fs_key_fp, cipher, authtok,
157 hashed_authtok, iv) == 0) {
158 ret = 0;
159 goto _return;
160 }
161 ct_fs_key_len = fread(ct_fs_key, 1, sizeof(ct_fs_key), fs_key_fp);
162 if (ct_fs_key_len == 0) {
163 l0g("failed to read encrypted filesystem key from %s\n",
164 fs_key_path);
165 ret = 0;
166 goto _return;
167 }
168 if (EVP_DecryptInit_ex(&ctx, cipher, NULL, hashed_authtok, iv) == 0) {
169169 sslerror("failed to initialize decryption code");
170170 ret = 0;
171171 goto _return;
172172 }
173 /* assumes plaintexts is always <= ciphertext + EVP_MAX_BLOCK_LEN in length
174 * OpenSSL's documentation seems to promise this */
175 if(EVP_DecryptUpdate(&ctx, pt_fs_key, &segment_len, ct_fs_key,
176 ct_fs_key_len) == 0) {
173 /*
174 * assumes plaintexts is always <= ciphertext + EVP_MAX_BLOCK_LEN in
175 * length OpenSSL's documentation seems to promise this
176 */
177 if (EVP_DecryptUpdate(&ctx, pt_fs_key, &segment_len,
178 ct_fs_key, ct_fs_key_len) == 0) {
177179 sslerror("failed to decrypt key");
178180 ret = 0;
179181 goto _return;
180182 }
181183 *pt_fs_key_len = segment_len;
182 if(EVP_DecryptFinal_ex(&ctx, &pt_fs_key[*pt_fs_key_len],
183 &segment_len) == 0) {
184 sslerror
185 ("bad pad on end of encrypted file (wrong algorithm or key size?)");
184 if (EVP_DecryptFinal_ex(&ctx, &pt_fs_key[*pt_fs_key_len],
185 &segment_len) == 0) {
186 sslerror("bad pad on end of encrypted file (wrong algorithm "
187 "or key size?)");
186188 ret = 0;
187189 goto _return;
188190 }
189191 *pt_fs_key_len += segment_len;
190 _return:
192 _return:
191193 if (fclose(fs_key_fp) != 0) {
192 l0g(PMPREFIX "error closing file pointer\n");
193 ret = 0;
194 }
195 _return_no_close:
194 l0g("error closing file pointer\n");
195 ret = 0;
196 }
197 _return_no_close:
196198 if (EVP_CIPHER_CTX_cleanup(&ctx) == 0) {
197199 sslerror("error cleaning up cipher context");
198200 ret = 0;
200202
201203 ERR_free_strings();
202204 /* pt_fs_key_len is unsigned */
203 assert(ret == 0 || *pt_fs_key_len <= MAX_PAR + EVP_MAX_BLOCK_LENGTH);
204
205 assert(ret == 0 || *pt_fs_key_len <= MAX_PAR + EVP_MAX_BLOCK_LENGTH);
205206 return ret;
206207 }
207208
208 #else // HAVE_LIBCRYPTO
209 #else /* HAVE_LIBCRYPTO */
209210
210211 int decrypted_key(unsigned char *pt_fs_key, size_t *pt_fs_key_len,
211 const char *fs_key_path, const char *fs_key_cipher, const char *authtok)
212 {
213 l0g(PMPREFIX "encrypted filesystem key not supported: no openssl\n");
214 return 0;
215 }
216
217 #endif // HAVE_LIBCRYPTO
218
219 //=============================================================================
212 const char *fs_key_path, const char *fs_key_cipher, const char *authtok)
213 {
214 l0g("encrypted filesystem key not supported: no openssl\n");
215 return 0;
216 }
217
218 #endif /* HAVE_LIBCRYPTO */
0 /*=============================================================================
1 crypto.h
2 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of
7 the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to:
16 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 Boston, MA 02110-1301 USA
18
19 -- For details, see the file named "LICENSE.LGPL2"
20 =============================================================================*/
210 #ifndef PMT_CRYPTO_H
221 #define PMT_CRYPTO_H 1
232
243 #include <sys/types.h>
254
26 #ifdef __cplusplus
27 extern "C" {
5 #ifdef HAVE_LIBCRYPTO
6 # ifndef EVP_MAX_BLOCK_LENGTH
7 /* some older openssl versions need this */
8 # define EVP_MAX_BLOCK_LENGTH 32
9 # endif
10 #else
11 /* FIXME: this is ugly, but needed */
12 # define EVP_MAX_BLOCK_LENGTH 0
2813 #endif
2914
3015 int decrypted_key(unsigned char *, size_t *, const char *, const char *,
31 const char *);
16 const char *);
3217
33 #ifdef __cplusplus
34 } // extern "C"
35 #endif
36
37 #endif // PMT_CRYPTO_H
38
39 //=============================================================================
18 #endif /* PMT_CRYPTO_H */
+0
-1279
src/dotconf.c less more
0 /*=============================================================================
1 dotconf.c
2 Copyright (C) Lukas Schroeder <lukas@azzit.de>, 1999 - 2002
3 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
4 and others
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as
8 published by the Free Software Foundation; either version 2.1 of
9 the License, or (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with this program; if not, write to:
18 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 Boston, MA 02110-1301 USA
20
21 -- For details, see the file named "LICENSE.LGPL2"
22 =============================================================================*/
23 /* -- dotconf.c - this code is responsible for the input, parsing and dispatching of options */
24
25 /* Added by Stephen W. Boyer <sboyer@caldera.com>
26 * for wildcard support in Include file paths
27 */
28 /* -- AIX 4.3 compile time fix
29 * by Eduardo Marcel Macan <macan@colband.com.br>
30 * modified by Stephen W. Boyer <sboyer@caldera.com>
31 * for Unixware and OpenServer
32 */
33
34 #include <config.h>
35 #include <sys/stat.h>
36 #include <sys/types.h>
37 #include <ctype.h>
38 #include <dirent.h>
39 #include <stdarg.h>
40 #include <stdio.h>
41 #include <stdlib.h>
42 #include <string.h>
43 #include <unistd.h>
44 #ifdef HAVE_SYSLOG
45 # include <syslog.h>
46 #endif
47 #include "compiler.h"
48 #include "dotconf.h"
49 #include "xstdlib.h"
50
51 // some buffersize definitions
52 #define CFG_BUFSIZE 4096 // max length of one line */
53 #define CFG_MAX_OPTION 32 // max length of any option name */
54 #define CFG_MAX_VALUE 4064 // max length of any options value */
55 #define CFG_MAX_FILENAME 256 // max length of a filename */
56 #define CFG_VALUES 16 // max # of arguments an option takes */
57
58 #define CFG_INCLUDEPATH_ENV "DC_INCLUDEPATH"
59 #define WILDCARDS "*?" // list of supported wild-card characters
60
61 #define CFG_TOGGLED(_val) ( \
62 (*_val == 'Y' || *_val == 'y') || \
63 (*_val == '1') || ( \
64 (_val[0] == 'o' || _val[0] == 'O') && \
65 (_val[1] == 'n' || _val[1] == 'N') \
66 ) \
67 )
68
69 // for convenience of terminating the dotconf_options list
70 #define LAST_CONTEXT_OPTION {""}
71
72 // some flags that change the runtime behaviour of dotconf
73 #define NONE 0
74 #define CASE_INSENSITIVE (1 << 0) // match option names case insensitive
75 #define DONT_SUBSTITUTE (1 << 1) // do not call substitute_env after read_arg
76 #define NO_INLINE_COMMENTS (1 << 2) // do not allow inline comments
77 #define DUPLICATE_OPTION_NAMES (1 << 3) // allow for duplicate option names
78
79 // syslog style errors as suggested by Sander Steffann <sander@steffann.nl>
80 #ifdef HAVE_SYSLOG
81 # define DCLOG_EMERG LOG_EMERG
82 # define DCLOG_ALERT LOG_ALERT
83 # define DCLOG_CRIT LOG_CRIT
84 # define DCLOG_ERR LOG_ERR
85 # define DCLOG_WARNING LOG_WARNING
86 # define DCLOG_NOTICE LOG_NOTICE
87 # define DCLOG_INFO LOG_INFO
88 # define DCLOG_DEBUG LOG_DEBUG
89 # define DCLOG_LEVELMASK LOG_PRIMASK
90 #else
91 enum {
92 DCLOG_EMERG = 0,
93 DCLOG_ALERT,
94 DCLOG_CRIT,
95 DCLOG_ERR,
96 DCLOG_WARNING,
97 DCLOG_NOTICE,
98 DCLOG_INFO,
99 DCLOG_DEBUG,
100 };
101 # define DCLOG_LEVELMASK 7 // mask off the level value
102 #endif // HAVE_SYSLOG
103
104 // error constants
105 enum {
106 ERR_NOERROR = 0,
107 ERR_PARSE_ERROR,
108 ERR_UNKNOWN_OPTION,
109 ERR_WRONG_ARG_COUNT,
110 ERR_INCLUDE_ERROR,
111 ERR_NOACCESS,
112 ERR_USER = 0x1000, // base for userdefined errno's
113 };
114
115 enum callback_types
116 {
117 ERROR_HANDLER = 1,
118 CONTEXT_CHECKER
119 };
120
121 typedef enum callback_types callback_types;
122
123 // Functions
124 static const struct configoption *get_argname_fallback(const struct configoption *);
125 static void copy_word(char **, char **, int, char);
126 static DOTCONF_CB(dotconf_cb_include); // internal 'Include'
127 static DOTCONF_CB(dotconf_cb_includepath); // internal 'IncludePath'
128 static int dotconf_continue_line(char *, size_t);
129 static int dotconf_find_wild_card(const char *, char *, char **, char **, const char **);
130 static void dotconf_free_command(struct command *);
131 static char *dotconf_get_here_document(struct configfile *, const char *);
132 static int dotconf_get_next_line(char *, size_t, struct configfile *);
133 static const char *dotconf_handle_command(struct configfile *, char *);
134 static int dotconf_handle_star(const struct command *, const char *, const char *, const char *);
135 static int dotconf_handle_question_mark(const struct command *, const char *, const char *, const char *);
136 static int dotconf_handle_wild_card(const struct command *, char, const char *, const char *, const char *);
137 static const char *dotconf_invoke_command(const struct configfile *, const struct command *);
138 static int dotconf_is_wild_card(char);
139 static int dotconf_question_mark_match(const char *, const char *, const char *);
140 static char *dotconf_read_arg(const struct configfile *, char **);
141 static void dotconf_register_options(struct configfile *, const struct configoption *);
142 static void dotconf_set_command(struct configfile *, const struct configoption *, char *, struct command *);
143 static int dotconf_star_match(const char *, const char *, const char *);
144 static int dotconf_strcmp_from_back(const char *, const char *);
145 static char *dotconf_substitute_env(const struct configfile *, char *);
146 static int dotconf_warning(const struct configfile *, int, unsigned long, const char *, ...);
147 static void dotconf_wild_card_cleanup(char *, char *);
148 static void skip_whitespace(char **, int, char);
149 static inline long MIN(long, long);
150
151 // Variables
152 static struct configoption dotconf_options[] =
153 {
154 { "Include", ARG_STR, dotconf_cb_include, NULL, CTX_ALL },
155 { "IncludePath", ARG_STR, dotconf_cb_includepath, NULL, CTX_ALL },
156 LAST_CONTEXT_OPTION,
157 };
158
159 static char name[CFG_MAX_OPTION + 1]; // option name
160
161 //-----------------------------------------------------------------------------
162 static void skip_whitespace(char **cp, int n, char term)
163 {
164 char *cp1 = *cp;
165 while(isspace(*cp1) && *cp1 != term && n--)
166 cp1++;
167 *cp = cp1;
168 }
169
170 static void copy_word(char **dest, char **src, int max, char term)
171 {
172 char *cp1 = *src;
173 char *cp2 = *dest;
174 while(max-- && !isspace(*cp1) && *cp1 != term)
175 *cp2++ = *cp1++;
176 *cp2 = '\0';
177
178 *src = cp1;
179 *dest = cp2;
180 }
181
182 static const struct configoption *
183 get_argname_fallback(const struct configoption *options)
184 {
185 int i;
186
187 for(i = 0; options[i].name != NULL && options[i].name[0] != '\0'; i++);
188 if(options[i].type == ARG_NAME && options[i].callback != NULL)
189 return &options[i];
190 return NULL;
191 }
192
193 static char *dotconf_substitute_env(const struct configfile *configfile,
194 char *str)
195 {
196 // {{ editor lineup
197 char *cp1, *cp2, *cp3, *eos, *eob;
198 char *env_value;
199 char env_name[CFG_MAX_VALUE + 1];
200 char env_default[CFG_MAX_VALUE + 1];
201 char tmp_value[CFG_MAX_VALUE + 1];
202
203 memset(env_name, 0, sizeof(env_name));
204 memset(env_default, 0, sizeof(env_default));
205 memset(tmp_value, 0, sizeof(tmp_value));
206
207 cp1 = str;
208 eob = cp1 + strlen(str) + 1;
209 cp2 = tmp_value;
210 eos = cp2 + sizeof(tmp_value);
211
212 while(cp1 < eob && cp2 < eos && *cp1 != '\0') {
213 /* substitution needed ?? */
214 if (*cp1 == '$' && *(cp1 + 1) == '{')
215 {
216 cp1 += 2; /* skip ${ */
217 cp3 = env_name;
218 while(cp1 < eob && !(*cp1 == '}' || *cp1 == ':'))
219 *cp3++ = *cp1++;
220 *cp3 = '\0'; /* terminate */
221
222 /* default substitution */
223 if (*cp1 == ':' && *(cp1 + 1) == '-')
224 {
225 cp1 += 2; /* skip :- */
226 cp3 = env_default;
227 while(cp1 < eob && *cp1 != '}')
228 *cp3++ = *cp1++;
229 *cp3 = '\0'; /* terminate */
230 }
231 else
232 {
233 while(cp1 < eob && *cp1 != '}')
234 cp1++;
235 }
236
237 if (*cp1 != '}')
238 {
239 dotconf_warning(configfile, DCLOG_WARNING, ERR_PARSE_ERROR,
240 "Unbalanced '{'");
241 }
242 else
243 {
244 cp1++; /* skip } */
245 if ((env_value = getenv(env_name)) != NULL)
246 {
247 strncat(cp2, env_value, eos - cp2);
248 cp2 += strlen(env_value);
249 }
250 else
251 {
252 strncat(cp2, env_default, eos - cp2);
253 cp2 += strlen(env_default);
254 }
255 }
256
257 }
258
259 *cp2++ = *cp1++;
260 }
261 *cp2 = '\0'; /* terminate buffer */
262
263 free(str);
264 return xstrdup(tmp_value);
265 }
266
267 static int dotconf_warning(const struct configfile *configfile, int type,
268 unsigned long errnum, const char *fmt, ...)
269 {
270 va_list args;
271 int retval = 0;
272
273 va_start(args, fmt);
274 if(configfile->errorhandler != NULL) { /* an errorhandler is registered */
275 char msg[CFG_BUFSIZE];
276 vsnprintf(msg, sizeof(msg), fmt, args);
277 retval = configfile->errorhandler(configfile, type, errnum, msg);
278 }
279 else /* no errorhandler, do-it-yourself */
280 {
281 retval = 0;
282 fprintf(stderr, "%s:%ld: ", configfile->filename, configfile->line);
283 vfprintf(stderr, fmt, args);
284 fprintf(stderr, "\n");
285 }
286 va_end(args);
287
288 return retval;
289 }
290
291 static void dotconf_register_options(struct configfile *configfile,
292 const struct configoption *options)
293 {
294 int num = configfile->config_option_count;
295
296 #define GROW_BY 10
297 /* resize memoryblock for options blockwise */
298 if (configfile->config_options == NULL)
299 configfile->config_options = malloc(sizeof(void *) * (GROW_BY + 1));
300 else if((num % GROW_BY) == 0)
301 configfile->config_options = realloc(configfile->config_options,
302 sizeof(void *) * (num + GROW_BY + 1));
303 #undef GROW_BY
304
305 /* append new options */
306 configfile->config_options[configfile->config_option_count] = options;
307 configfile->config_options[++configfile->config_option_count] = NULL;
308
309 }
310
311 static int dotconf_continue_line(char *buffer, size_t length) {
312 /* ------ match [^\\]\\[\r]\n ------------------------------ */
313 char *cp1 = buffer + length - 1;
314
315 if (length < 2)
316 return 0;
317
318 if (*cp1-- != '\n')
319 return 0;
320
321 if (*cp1 == '\r')
322 cp1--;
323
324 if (*cp1-- != '\\')
325 return 0;
326
327 cp1[1] = '\0'; /* strip escape character and/or newline */
328 return *cp1 != '\\';
329 }
330
331 static int dotconf_get_next_line(char *buffer, size_t bufsize,
332 struct configfile *configfile)
333 {
334 char *cp1, *cp2;
335 char buf2[CFG_BUFSIZE];
336 int length;
337
338 if (configfile->eof)
339 return 1;
340
341 cp1 = fgets(buffer, CFG_BUFSIZE, configfile->stream);
342
343 if(cp1 == NULL) {
344 configfile->eof = 1;
345 return 1;
346 }
347
348 configfile->line++;
349 length = strlen(cp1);
350 while ( dotconf_continue_line(cp1, length) )
351 {
352 cp2 = fgets(buf2, sizeof(buf2), configfile->stream);
353 if(cp2 == NULL) {
354 fprintf(stderr, "[dotconf] Parse error. Unexpected end of file at "
355 "line %ld in file %s\n", configfile->line, configfile->filename);
356 configfile->eof = 1;
357 return 1;
358 }
359 configfile->line++;
360 strcpy(cp1 + length - 2, cp2);
361 length = strlen(cp1);
362 }
363
364 return 0;
365 }
366
367 static char *dotconf_get_here_document(struct configfile *configfile,
368 const char *delimit)
369 {
370 /* it's a here-document: yeah, what a cool feature ;) */
371 unsigned int limit_len;
372 char here_string;
373 char buffer[CFG_BUFSIZE];
374 char *here_doc = NULL;
375 char here_limit[9]; /* max length for here-document delimiter: 8 */
376 struct stat finfo;
377 int offset = 0;
378
379 if (configfile->size <= 0)
380 {
381 if(stat(configfile->filename, &finfo) != 0)
382 {
383 dotconf_warning(configfile, DCLOG_EMERG, ERR_NOACCESS,
384 "[emerg] could not stat currently read file (%s)\n",
385 configfile->filename);
386 return NULL;
387 }
388 configfile->size = finfo.st_size;
389 }
390
391 /*
392 * allocate a buffer of filesize bytes; should be enough to
393 * prevent buffer overflows
394 */
395 here_doc = xzalloc(configfile->size); /* allocate buffer memory */
396
397 here_string = 1;
398 limit_len = snprintf(here_limit, 9, "%s", delimit);
399 while (!dotconf_get_next_line(buffer, sizeof(buffer), configfile))
400 {
401 if(strncmp(here_limit, buffer, limit_len - 1) == 0) {
402 here_string = 0;
403 break;
404 }
405 offset += snprintf(here_doc + offset, configfile->size - offset - 1, "%s", buffer);
406 }
407 if (here_string)
408 dotconf_warning(configfile, DCLOG_WARNING, ERR_PARSE_ERROR, "Unterminated here-document!");
409
410 here_doc[offset-1] = '\0'; /* strip newline */
411
412 return realloc(here_doc, offset);
413 }
414
415 static const char *dotconf_invoke_command(const struct configfile *configfile,
416 const struct command *cmd)
417 {
418 return cmd->option->callback(cmd, configfile->context);
419 }
420
421 static char *dotconf_read_arg(const struct configfile *configfile,
422 char **line)
423 {
424 int sq = 0, dq = 0; /* single quote, double quote */
425 int done = 0;
426 char *cp1 = *line;
427 char *cp2, *eos;
428 char buf[CFG_MAX_VALUE];
429
430 memset(buf, 0, sizeof(buf));
431 cp2 = buf;
432 eos = cp2 + sizeof(buf) - 1;
433
434 if(*cp1 == '#' || *cp1 == '\0')
435 return NULL;
436
437 skip_whitespace(&cp1, CFG_MAX_VALUE, '\0');
438
439 while(*cp1 != '\0' && cp2 != eos && !done) {
440 switch (*cp1) {
441 case '\'': /* single quote */
442 if (dq)
443 break; /* already double quoting, break out */
444 if (sq)
445 sq--; /* already single quoting, clear state */
446 else if (!sq)
447 sq++; /* set state for single quoting */
448 break;
449 case '"': /* double quote */
450 if (sq)
451 break; /* already single quoting, break out */
452 if (dq)
453 dq--; /* already double quoting, clear state */
454 else if (!dq)
455 dq++; /* set state for double quoting */
456 break;
457 case '\\': /* protected chars */
458 if(cp1[1] == '\0') /* dont protect NUL */
459 break;
460 if (sq) /* preserve '\' if in single quote */
461 break;
462 else {
463 *cp2++ = *++cp1;
464 cp1++; /* skip the protected one */
465 continue;
466 }
467 break;
468 default:
469 break;
470 }
471
472 /* unquoted space: start a new option argument */
473 if (isspace(*cp1) && !dq && !sq) {
474 *cp2 = '\0';
475 break;
476 }
477 /* unquoted, unescaped comment-hash ; break out, unless NO_INLINE_COMMENTS is set */
478 else if (*cp1 == '#' && !dq && !sq && !(configfile->flags & NO_INLINE_COMMENTS)) {
479 /*
480 * NOTE: 1.0.8a got the NO_INLINE_COMMENTS feature wrong: it
481 * skipped every argument starting with a #, instead of simply eating it!
482 */
483
484 *cp2 = *cp1 = '\0';
485 *line = cp1;
486 return NULL;
487 }
488 /* not space or quoted: eat it; dont take quote if quoting */
489 else if((!isspace(*cp1) && !dq && !sq && *cp1 != '"' && *cp1 != '\'')
490 || (dq && *cp1 != '"') || (sq && *cp1 != '\'')) {
491 *cp2++ = *cp1;
492 }
493
494 cp1++;
495 }
496
497 *line = cp1;
498
499 /* FIXME: escaping substitutes does not work
500 Subst ${HOME} \$\{HOME\}
501 BOTH! will be substituted, which is somewhat wrong, ain't it ?? :-(
502 */
503 if(configfile->flags & DONT_SUBSTITUTE)
504 return (buf[0] != '\0') ? xstrdup(buf) : NULL;
505 return (buf[0] != '\0') ? dotconf_substitute_env(configfile, xstrdup(buf)) : NULL;
506 }
507
508 static void dotconf_set_command(struct configfile *configfile,
509 const struct configoption *option, char *args, struct command *cmd)
510 {
511 char *eob = args + strlen(args);
512
513 /* fill in the command structure with values we already know */
514 cmd->name = (option->type == ARG_NAME) ? name : option->name;
515 cmd->option = const_cast(struct configoption *, option);
516 cmd->context = configfile->context;
517 cmd->configfile = configfile;
518 cmd->data.list = xzalloc(CFG_VALUES * sizeof(char *));
519 cmd->data.str = NULL;
520
521 if (option->type == ARG_RAW) {
522 /* if it is an ARG_RAW type, save some time and call the
523 callback now */
524 cmd->data.str = xstrdup(args);
525 }
526 else if (option->type == ARG_STR) {
527 char *cp = args;
528
529 /* check if it's a here-document and act accordingly */
530 skip_whitespace(&cp, eob - cp, '\0');
531
532 if(strncmp("<<", cp, 2) == 0) {
533 cmd->data.str = dotconf_get_here_document(configfile, cp + 2);
534 cmd->arg_count = 1;
535 }
536 }
537
538 if (!(option->type == ARG_STR && cmd->data.str != NULL)) {
539 /* we only get here for non-heredocument lines */
540
541 skip_whitespace(&args, eob - args, '\0');
542
543 cmd->arg_count = 0;
544 while(cmd->arg_count < CFG_VALUES - 1 &&
545 (cmd->data.list[cmd->arg_count] =
546 dotconf_read_arg(configfile, &args)) != NULL)
547 cmd->arg_count++;
548
549 skip_whitespace(&args, eob - args, '\0');
550
551 if(cmd->arg_count > 0 && cmd->data.list[cmd->arg_count-1] != NULL && *args != '\0')
552 cmd->data.list[cmd->arg_count++] = xstrdup(args);
553
554 /* has an option entry been found before or do we have to use a fallback? */
555 if((option->name != NULL && option->name[0] > ' ') || option->type == ARG_NAME) {
556 /* found it, now check the type of args it wants */
557 switch (option->type) {
558 case ARG_TOGGLE:
559 /* the value is true if the argument is Yes, On or 1 */
560 if (cmd->arg_count < 1) {
561 dotconf_warning(configfile, DCLOG_WARNING, ERR_WRONG_ARG_COUNT,
562 "Missing argument to option '%s'", name);
563 return;
564 }
565
566 cmd->data.value = CFG_TOGGLED(cmd->data.list[0]);
567 break;
568 case ARG_INT:
569 if (cmd->arg_count < 1) {
570 dotconf_warning(configfile, DCLOG_WARNING, ERR_WRONG_ARG_COUNT,
571 "Missing argument to option '%s'", name);
572 return;
573 }
574
575 if (sscanf(cmd->data.list[0], "%li", &cmd->data.value) < 1) {
576 dotconf_warning(configfile, DCLOG_WARNING, ERR_WRONG_ARG_COUNT,
577 "Error parsing '%s'", cmd->data.list[0]);
578 return;
579 }
580 break;
581 case ARG_STR:
582 if (cmd->arg_count < 1) {
583 dotconf_warning(configfile, DCLOG_WARNING, ERR_WRONG_ARG_COUNT,
584 "Missing argument to option '%s'", name);
585 return;
586 }
587
588 cmd->data.str = xstrdup(cmd->data.list[0]);
589 break;
590 case ARG_NAME: /* fall through */
591 case ARG_LIST:
592 case ARG_NONE:
593 case ARG_RAW: /* this has been handled before */
594 default:
595 break;
596 }
597 }
598 }
599 }
600
601 static void dotconf_free_command(struct command *command) {
602 int i;
603
604 free(command->data.str);
605 for (i = 0; i < command->arg_count; i++)
606 free(command->data.list[i]);
607 free(command->data.list);
608 }
609
610 static const char *dotconf_handle_command(struct configfile *configfile,
611 char *buffer)
612 {
613 char *cp1;
614 char *cp2;
615 /* generic char pointer */
616 char *eob; /* end of buffer; end of string */
617 const char *error = NULL; /* error message we'll return */
618 const char *context_error = NULL; /* error message returned by contextchecker */
619 struct command command; /* command structure */
620 int mod = 0;
621 int next_opt_idx = 0;
622
623 memset(&command, 0, sizeof(command));
624 name[0] = '\0';
625
626 cp1 = buffer;
627 eob = cp1 + strlen(cp1);
628
629 skip_whitespace(&cp1, eob - cp1, '\0');
630
631 /* ignore comments and empty lines */
632 if(cp1 == NULL || *cp1 == '\0' || *cp1 == '#' || *cp1 == '\n' || *cp1 == EOF)
633 return NULL;
634
635 /* skip line if it only contains whitespace */
636 if (cp1 == eob)
637 return NULL;
638
639 /* get first token: read the name of a possible option */
640 cp2 = name;
641 copy_word(&cp2, &cp1, MIN(eob - cp1, CFG_MAX_OPTION), '\0');
642
643 while (1) {
644 const struct configoption *option;
645 int done = 0;
646 int opt_idx = 0;
647
648 for(option = 0; configfile->config_options[mod] != NULL && !done; mod++) {
649 for(opt_idx = next_opt_idx; configfile->config_options[mod][opt_idx].name[0] != '\0'; opt_idx++) {
650 if(configfile->cmp_func(name, configfile->config_options[mod][opt_idx].name, CFG_MAX_OPTION) == 0) {
651 /* TODO: this could be flagged: option overwriting by modules */
652 option = &configfile->config_options[mod][opt_idx];
653 done = 1;
654 break; /* found one; break out */
655 }
656 }
657 }
658
659 if(option == NULL)
660 option = get_argname_fallback(configfile->config_options[1]);
661
662 if(option == NULL || option->callback == NULL) {
663 if(error != NULL)
664 return error;
665 dotconf_warning(configfile, DCLOG_INFO, ERR_UNKNOWN_OPTION,
666 "Unknown Config-Option: '%s'", name);
667 return NULL;
668 }
669
670 /* set up the command structure (contextchecker wants this) */
671 dotconf_set_command(configfile, option, cp1, &command);
672
673 if(configfile->contextchecker != NULL)
674 context_error = configfile->contextchecker(&command, command.option->context);
675
676 if(context_error == NULL)
677 error = dotconf_invoke_command(configfile, &command);
678 else if(error == NULL)
679 /* Avoid returning another error then the first. This makes
680 it easier to reproduce problems. */
681 error = context_error;
682
683 dotconf_free_command(&command);
684
685 if(context_error == NULL || !(configfile->flags & DUPLICATE_OPTION_NAMES))
686 /* don't try more, just quit now. */
687 break;
688 }
689
690 return error;
691 }
692
693 int dotconf_command_loop(struct configfile *configfile) {
694 /* ------ returns: 0 for failure -- !0 for success ------------------------------------------ */
695 char buffer[CFG_BUFSIZE];
696
697 while(!(dotconf_get_next_line(buffer, sizeof(buffer), configfile))) {
698 const char *error = dotconf_handle_command(configfile, buffer);
699 if ( error != NULL )
700 if ( dotconf_warning(configfile, DCLOG_ERR, 0, error) )
701 return 0;
702 }
703 return 1;
704 }
705
706 struct configfile *dotconf_create(const char *fname,
707 const struct configoption *options, context_t *context, unsigned long flags)
708 {
709 struct configfile *new = NULL;
710 char *dc_env;
711
712 if (access(fname, R_OK))
713 {
714 fprintf(stderr, "Error opening configuration file '%s'\n", fname);
715 return NULL;
716 }
717
718 new = xzalloc(sizeof(struct configfile));
719 if((new->stream = fopen(fname, "r")) == NULL) {
720 fprintf(stderr, "Error opening configuration file '%s'\n", fname);
721 free(new);
722 return NULL;
723 }
724
725 new->flags = flags;
726 new->filename = xstrdup(fname);
727
728 new->includepath = malloc(CFG_MAX_FILENAME);
729 new->includepath[0] = '\0';
730
731 /* take includepath from environment if present */
732 if ((dc_env = getenv(CFG_INCLUDEPATH_ENV)) != NULL)
733 snprintf(new->includepath, CFG_MAX_FILENAME, "%s", dc_env);
734
735 new->context = context;
736
737 dotconf_register_options(new, dotconf_options);
738 dotconf_register_options(new, options);
739
740 if ( new->flags & CASE_INSENSITIVE )
741 new->cmp_func = strncasecmp;
742 else
743 new->cmp_func = strncmp;
744
745 return new;
746 }
747
748 void dotconf_cleanup(struct configfile *configfile) {
749 fclose(configfile->stream);
750 free(configfile->filename);
751 free(configfile->config_options);
752 free(configfile->includepath);
753 free(configfile);
754 return;
755 }
756
757 /* ------ internal utility function that verifies if a character is in the WILDCARDS list -- */
758 static int dotconf_is_wild_card(char value) {
759 int retval = 0;
760 int i;
761 int wildcards_len = strlen(WILDCARDS);
762
763 for (i=0;i<wildcards_len;i++)
764 {
765 if (value == WILDCARDS[i])
766 {
767 retval = 1;
768 break;
769 }
770 }
771
772 return retval;
773 }
774
775 /* ------ internal utility function that calls the appropriate routine for the wildcard passed in -- */
776 static int dotconf_handle_wild_card(const struct command *cmd, char wild_card,
777 const char *path, const char *pre, const char *ext)
778 {
779 int retval = 0;
780
781 switch (wild_card)
782 {
783 case '*':
784
785 retval = dotconf_handle_star(cmd,path,pre,ext);
786
787 break;
788
789 case '?':
790
791 retval = dotconf_handle_question_mark(cmd,path,pre,ext);
792
793 break;
794
795 default:
796 retval = -1;
797 }
798
799 return retval;
800 }
801
802
803 /* ------ internal utility function that frees allocated memory from dotcont_find_wild_card -- */
804 static void dotconf_wild_card_cleanup(char *path, char *pre) {
805 free(path);
806 free(pre);
807 return;
808 }
809
810 /* ------ internal utility function to check for wild cards in file path -- */
811 /* ------ path and pre must be freed by the developer ( dotconf_wild_card_cleanup) -- */
812 static int dotconf_find_wild_card(const char *filename, char *wildcard,
813 char **path, char **pre, const char **ext)
814 {
815 int retval = -1;
816 int prefix_len = 0;
817 int tmp_count = 0;
818 const char *tmp = NULL;
819 int found_path = 0;
820
821 int len = strlen(filename);
822
823 if (wildcard != NULL && len > 0 && path != NULL && pre != NULL && ext != NULL )
824 {
825 prefix_len = strcspn(filename,WILDCARDS); /* find any wildcard in WILDCARDS */
826
827 if ( prefix_len < len ) /* Wild card found */
828 {
829 tmp = filename + prefix_len;
830 tmp_count = prefix_len + 1;
831
832 while(tmp != filename && *tmp != '/') {
833 tmp--;
834 tmp_count--;
835 }
836
837 if(*tmp == '/') {
838 *path = malloc(tmp_count+1);
839 found_path = 1;
840
841 } else
842
843 *path = malloc(1);
844
845 *pre = malloc(prefix_len - (tmp_count - (found_path ? 0 : 1)) + 1);
846
847 if(*path != NULL && *pre != NULL) {
848 if (found_path)
849 strncpy(*path,filename,tmp_count);
850 (*path)[tmp_count] = '\0';
851
852 strncpy(*pre, tmp + (found_path ? 1 : 0),
853 prefix_len - (tmp_count - (found_path ? 0 : 1)));
854 (*pre)[prefix_len - (tmp_count - (found_path ? 0 : 1))] = '\0';
855
856 *ext = filename + prefix_len;
857 *wildcard = **ext;
858 ++*ext;
859
860 retval = prefix_len;
861
862 }
863
864 }
865
866 }
867
868 return retval;
869 }
870
871 /* ------ internal utility function that compares two stings from back to front -- */
872 static int dotconf_strcmp_from_back(const char *s1, const char *s2) {
873 int retval = 0;
874 int i,j;
875 int len_1 = strlen(s1);
876 int len_2 = strlen(s2);
877
878 for(i = len_1, j = len_2; i >= 0 && j >= 0; i--, j--) {
879 if (s1[i] != s2[j])
880 {
881 retval = -1;
882 break;
883 }
884 }
885
886 return retval;
887 }
888
889 /* ------ internal utility function that determins if a string matches the '?' criteria -- */
890 static int dotconf_question_mark_match(const char *dir_name, const char *pre,
891 const char *ext)
892 {
893 int retval = -1;
894 int dir_name_len = strlen(dir_name);
895 int pre_len = strlen(pre);
896 int ext_len = strlen(ext);
897 int w_card_check = strcspn(ext,WILDCARDS);
898
899 if(w_card_check < ext_len && strncmp(dir_name, pre, pre_len) == 0 &&
900 strcmp(dir_name, ".") != 0 && strcmp(dir_name, "..") != 0)
901 retval = 1; /* Another wildcard found */
902
903 else if(dir_name_len >= pre_len && strncmp(dir_name, pre, pre_len) == 0 &&
904 strcmp(dir_name, ".") != 0 && strcmp(dir_name, "..") != 0)
905 retval = 0; /* Matches no other wildcards */
906
907 return retval;
908 }
909
910 /* ------ internal utility function that determins if a string matches the '*' criteria -- */
911 static int dotconf_star_match(const char *dir_name, const char *pre,
912 const char *ext)
913 {
914 int retval = -1;
915 int dir_name_len = strlen(dir_name);
916 int pre_len = strlen(pre);
917 int ext_len = strlen(ext);
918 int w_card_check = strcspn(ext,WILDCARDS);
919
920 if(w_card_check < ext_len && strncmp(dir_name, pre, pre_len) == 0 &&
921 strcmp(dir_name, ".") != 0 && strcmp(dir_name, "..") != 0)
922 retval = 1; /* Another wildcard found */
923
924 else if(dir_name_len >= ext_len + pre_len &&
925 dotconf_strcmp_from_back(dir_name, ext) == 0 &&
926 strncmp(dir_name, pre, pre_len) == 0 && strcmp(dir_name, ".") != 0 &&
927 strcmp(dir_name, "..") != 0)
928 retval = 0; /* Matches no other wildcards */
929
930 return retval;
931 }
932
933 /* ------ internal utility function that determins matches for filenames with -- */
934 /* ------ a '?' in name and calls the Internal Include function on that filename -- */
935 static int dotconf_handle_question_mark(const struct command *cmd,
936 const char *path, const char *pre, const char *ext)
937 {
938 struct configfile *included;
939 DIR *dh = NULL;
940 struct dirent *dirptr = NULL;
941 int i;
942
943 char new_pre[CFG_MAX_FILENAME];
944 char already_matched[CFG_MAX_FILENAME];
945 char wc = '\0';
946 char *new_path = NULL, *wc_path = NULL, *wc_pre = NULL;
947 const char *wc_ext = NULL;
948
949 int pre_len;
950 int new_path_len;
951 int name_len = 0;
952 int alloced = 0;
953 int match_state = 0;
954
955 pre_len = strlen(pre);
956
957 if ((dh = opendir(path)) != NULL)
958 {
959 while ( (dirptr = readdir(dh)) != NULL )
960 {
961 match_state = dotconf_question_mark_match(dirptr->d_name,pre,ext);
962
963 if (match_state >= 0)
964 {
965 name_len = strlen(dirptr->d_name);
966 new_path_len = strlen(path) + name_len + strlen(ext) + 1;
967
968 if ( !alloced )
969 {
970 if((new_path = malloc(new_path_len)) == NULL)
971 return -1;
972
973 alloced = new_path_len;
974
975 } else if(new_path_len > alloced &&
976 realloc(new_path,new_path_len) == NULL) {
977 free(new_path);
978 return -1;
979 }
980
981 if (match_state == 1)
982 {
983
984 strncpy(new_pre, dirptr->d_name, (name_len > pre_len) ? pre_len + 1 : pre_len);
985 new_pre[(name_len > pre_len) ? pre_len + 1 : pre_len] = '\0';
986
987 sprintf(new_path,"%s%s%s",path,new_pre,ext);
988
989 if (strcmp(new_path,already_matched) == 0)
990 continue; /* Already searched this expression */
991 else
992 strcpy(already_matched,new_path);
993
994 if (dotconf_find_wild_card(new_path,&wc,&wc_path,&wc_pre,&wc_ext) >= 0)
995 {
996 if ( dotconf_handle_wild_card(cmd,wc,wc_path,wc_pre,wc_ext) < 0)
997 {
998 dotconf_warning(cmd->configfile, DCLOG_WARNING, ERR_INCLUDE_ERROR,
999 "Error occured while processing wildcard %c\n"
1000 "Filename is '%s'\n", wc, new_path);
1001
1002 free(new_path);
1003 dotconf_wild_card_cleanup(wc_path,wc_pre);
1004 return -1;
1005 }
1006
1007 dotconf_wild_card_cleanup(wc_path,wc_pre);
1008 continue;
1009 }
1010
1011 }
1012
1013 sprintf(new_path,"%s%s",path,dirptr->d_name);
1014
1015 if (access(new_path, R_OK))
1016 {
1017 dotconf_warning(cmd->configfile, DCLOG_WARNING, ERR_INCLUDE_ERROR,
1018 "Cannot open %s for inclusion.\n"
1019 "IncludePath is '%s'\n", new_path, cmd->configfile->includepath);
1020 return -1;
1021 }
1022
1023 included = dotconf_create(new_path, cmd->configfile->config_options[1],
1024 cmd->configfile->context, cmd->configfile->flags);
1025 if(included != NULL) {
1026 for (i = 2; cmd->configfile->config_options[i]; i++)
1027 dotconf_register_options(included, cmd->configfile->config_options[i]);
1028 included->errorhandler = cmd->configfile->errorhandler;
1029 included->contextchecker = cmd->configfile->contextchecker;
1030 dotconf_command_loop(included);
1031 dotconf_cleanup(included);
1032 }
1033
1034 }
1035
1036 }
1037
1038 closedir(dh);
1039 free(new_path);
1040
1041 }
1042
1043 return 0;
1044 }
1045
1046 /* ------ internal utility function that determins matches for filenames with --- */
1047 /* ------ a '*' in name and calls the Internal Include function on that filename -- */
1048 static int dotconf_handle_star(const struct command *cmd, const char *path,
1049 const char *pre, const char *ext)
1050 {
1051 struct configfile *included;
1052 DIR *dh = NULL;
1053 struct dirent *dirptr = NULL;
1054
1055 char new_pre[CFG_MAX_FILENAME];
1056 char new_ext[CFG_MAX_FILENAME];
1057 char already_matched[CFG_MAX_FILENAME];
1058 char wc = '\0';
1059 const char *s_ext = NULL, *t_ext = NULL, *wc_ext = NULL;
1060 char *new_path = NULL, *sub = NULL, *wc_path = NULL, *wc_pre = NULL;
1061
1062 int pre_len;
1063 int new_path_len;
1064 int name_len = 0;
1065 int alloced = 0;
1066 int match_state = 0;
1067 int t_ext_count = 0;
1068 int sub_count = 0;
1069
1070 pre_len = strlen(pre);
1071 memset(already_matched, 0, sizeof(already_matched));
1072 s_ext = ext;
1073
1074 while (dotconf_is_wild_card(*s_ext)) /* remove trailing wild-cards proceeded by * */
1075 s_ext++;
1076
1077 t_ext = s_ext;
1078
1079 while(t_ext != NULL && !dotconf_is_wild_card(*t_ext) && *t_ext != '\0')
1080 {
1081 t_ext++; /* find non-wild-card string */
1082 t_ext_count++;
1083 }
1084
1085 strncpy(new_ext,s_ext,t_ext_count);
1086 new_ext[t_ext_count] = '\0';
1087
1088 if ((dh = opendir(path)) != NULL)
1089 {
1090 while ( (dirptr = readdir(dh)) != NULL )
1091 {
1092 sub_count = 0;
1093 t_ext_count = 0;
1094
1095 match_state = dotconf_star_match(dirptr->d_name,pre,s_ext);
1096
1097 if (match_state >= 0)
1098 {
1099 name_len = strlen(dirptr->d_name);
1100 new_path_len = strlen(path) + name_len + strlen(s_ext) + 1;
1101
1102 if ( !alloced )
1103 {
1104 if((new_path = malloc(new_path_len)) == NULL)
1105 return -1;
1106
1107 alloced = new_path_len;
1108
1109 } else if(new_path_len > alloced &&
1110 realloc(new_path,new_path_len) == NULL) {
1111 free(new_path);
1112 return -1;
1113 }
1114
1115 if (match_state == 1)
1116 {
1117
1118 if ((sub = strstr((dirptr->d_name+pre_len),new_ext)) == NULL)
1119 {
1120 continue;
1121 }
1122
1123 while (sub != dirptr->d_name)
1124 {
1125 sub--;
1126 sub_count++;
1127 }
1128
1129 if (sub_count + t_ext_count > name_len)
1130 continue;
1131
1132 strncpy(new_pre, dirptr->d_name, sub_count + t_ext_count);
1133 new_pre[sub_count+t_ext_count] = '\0';
1134 strcat(new_pre,new_ext);
1135
1136 sprintf(new_path,"%s%s%s",path,new_pre,t_ext);
1137
1138 if (strcmp(new_path,already_matched) == 0)
1139 continue; /* Already searched this expression */
1140 else
1141 strcpy(already_matched,new_path);
1142
1143 if (dotconf_find_wild_card(new_path,&wc,&wc_path,&wc_pre,&wc_ext) >= 0)
1144 {
1145 if ( dotconf_handle_wild_card(cmd,wc,wc_path,wc_pre,wc_ext) < 0)
1146 {
1147 dotconf_warning(cmd->configfile, DCLOG_WARNING, ERR_INCLUDE_ERROR,
1148 "Error occured while processing wildcard %c\n"
1149 "Filename is '%s'\n", wc, new_path);
1150
1151 free(new_path);
1152 dotconf_wild_card_cleanup(wc_path,wc_pre);
1153 return -1;
1154 }
1155
1156 dotconf_wild_card_cleanup(wc_path,wc_pre);
1157 continue;
1158 }
1159
1160 }
1161
1162 sprintf(new_path,"%s%s",path,dirptr->d_name);
1163
1164 if (access(new_path, R_OK))
1165 {
1166 dotconf_warning(cmd->configfile, DCLOG_WARNING, ERR_INCLUDE_ERROR,
1167 "Cannot open %s for inclusion.\n"
1168 "IncludePath is '%s'\n", new_path, cmd->configfile->includepath);
1169 return -1;
1170 }
1171
1172 included = dotconf_create(new_path, cmd->configfile->config_options[1],
1173 cmd->configfile->context, cmd->configfile->flags);
1174 if(included != NULL) {
1175 included->errorhandler = cmd->configfile->errorhandler;
1176 included->contextchecker = cmd->configfile->contextchecker;
1177 dotconf_command_loop(included);
1178 dotconf_cleanup(included);
1179 }
1180
1181 }
1182
1183 }
1184
1185 closedir(dh);
1186 free(new_path);
1187
1188 }
1189
1190 return 0;
1191 }
1192
1193 /* ------ callbacks of the internal option (Include, IncludePath) ------------------------------- */
1194 static DOTCONF_CB(dotconf_cb_include) {
1195 char *filename = NULL, *path = NULL, *pre = NULL;
1196 const char *ext = NULL;
1197 struct configfile *included;
1198 char wild_card;
1199
1200 if (cmd->configfile->includepath != NULL
1201 && cmd->data.str[0] != '/' && cmd->configfile->includepath[0] != '\0')
1202 {
1203 /* relative file AND include path is used */
1204 int len, inclen;
1205 char *sl;
1206
1207 inclen = strlen(cmd->configfile->includepath);
1208 if((len = strlen(cmd->data.str) + inclen + 1) == CFG_MAX_FILENAME)
1209 {
1210 dotconf_warning(cmd->configfile, DCLOG_WARNING, ERR_INCLUDE_ERROR,
1211 "Absolute filename too long (>%d)", CFG_MAX_FILENAME);
1212 return NULL;
1213 }
1214
1215 if (cmd->configfile->includepath[inclen - 1] == '/')
1216 sl = "";
1217 else
1218 {
1219 sl = "/";
1220 len++;
1221 }
1222
1223 filename = malloc(len);
1224 snprintf(filename, len, "%s%s%s",
1225 cmd->configfile->includepath, sl, cmd->data.str);
1226 }
1227 else /* fully qualified, or no includepath */
1228 filename = xstrdup(cmd->data.str);
1229
1230 /* Added wild card support here */
1231 if (dotconf_find_wild_card(filename,&wild_card,&path,&pre,&ext) >= 0)
1232 {
1233 if ( dotconf_handle_wild_card(cmd,wild_card,path,pre,ext) < 0)
1234 {
1235 dotconf_warning(cmd->configfile, DCLOG_WARNING, ERR_INCLUDE_ERROR,
1236 "Error occured while attempting to process %s for inclusion.\n"
1237 "IncludePath is '%s'\n", filename, cmd->configfile->includepath);
1238 }
1239
1240 dotconf_wild_card_cleanup(path,pre);
1241 free(filename);
1242 return NULL;
1243 }
1244
1245 if (access(filename, R_OK))
1246 {
1247 dotconf_warning(cmd->configfile, DCLOG_WARNING, ERR_INCLUDE_ERROR,
1248 "Cannot open %s for inclusion.\n"
1249 "IncludePath is '%s'\n", filename, cmd->configfile->includepath);
1250 free(filename);
1251 return NULL;
1252 }
1253
1254 included = dotconf_create(filename, cmd->configfile->config_options[1],
1255 cmd->configfile->context, cmd->configfile->flags);
1256 if(included != NULL) {
1257 included->contextchecker = (dotconf_contextchecker_t) cmd->configfile->contextchecker;
1258 included->errorhandler = (dotconf_errorhandler_t) cmd->configfile->errorhandler;
1259
1260 dotconf_command_loop(included);
1261 dotconf_cleanup(included);
1262 }
1263
1264 free(filename);
1265 return NULL;
1266 }
1267
1268 static DOTCONF_CB(dotconf_cb_includepath) {
1269 char *env = getenv(CFG_INCLUDEPATH_ENV);
1270 /* environment overrides configuration file setting */
1271 if(env == NULL)
1272 snprintf(cmd->configfile->includepath, CFG_MAX_FILENAME, "%s", cmd->data.str);
1273 return NULL;
1274 }
1275
1276 static inline long MIN(long a, long b) {
1277 return (a < b) ? a : b;
1278 }
+0
-125
src/dotconf.h less more
0 /*=============================================================================
1 dotconf.h
2 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of
7 the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to:
16 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 Boston, MA 02110-1301 USA
18
19 -- For details, see the file named "LICENSE.LGPL2"
20 =============================================================================*/
21 #ifndef PMT_DOTCONF_H
22 #define PMT_DOTCONF_H 1
23
24 #include <sys/types.h>
25 #include <stdio.h>
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 #define DOTCONF_CB(__name) \
32 const char *__name(const struct command *cmd, context_t *ctx)
33 #define CTX_ALL 0 // context: option can be used anywhere
34 #define LAST_OPTION {"", 0, NULL, NULL}
35 #define FUNC_ERRORHANDLER(_name) \
36 int _name(const struct configfile *configfile, int type, \
37 long dc_errno, const char *msg)
38
39 // constants for type of option
40 enum {
41 ARG_TOGGLE = 0,
42 ARG_INT,
43 ARG_STR,
44 ARG_LIST,
45 ARG_NAME,
46 ARG_RAW,
47 ARG_NONE,
48 };
49
50 struct configfile;
51 struct command;
52
53 typedef void info_t;
54 typedef void context_t;
55 typedef const char *(*dotconf_callback_t)(const struct command *, context_t *);
56 typedef int (*dotconf_errorhandler_t)(const struct configfile *, int, long, const char *);
57 typedef const char *(*dotconf_contextchecker_t)(struct command *, unsigned long);
58
59 struct command {
60 const char *name; /* name of the command */
61 struct configoption *option; /* the option as given in the app; READ ONLY */
62
63 // argument data filled in for each line / command
64 struct {
65 long value; // ARG_INT, ARG_TOGGLE
66 char *str; // ARG_STR
67 char **list; // ARG_LIST
68 } data;
69 int arg_count; // number of arguments (in data.list)
70
71 // misc context information
72 const struct configfile *configfile;
73 context_t *context;
74 };
75
76 struct configfile {
77 /* ------ the fields in struct configfile are provided to the app
78 via "struct command"s ; READ ONLY! --- */
79
80 FILE *stream;
81 char eof; // end of file reached?
82 size_t size; // file size; cached on-demand for here-documents
83
84 context_t *context;
85
86 const struct configoption **config_options;
87 int config_option_count;
88
89 // misc read-only fields
90 char *filename; // name of file this option was found in
91 unsigned long line; // line number we're currently at
92 unsigned long flags; // runtime flags given to dotconf_open
93
94 char *includepath;
95
96 // some callbacks for interactivity
97 dotconf_errorhandler_t errorhandler;
98 dotconf_contextchecker_t contextchecker;
99 int (*cmp_func)(const char *, const char *, size_t);
100 };
101
102 struct configoption {
103 const char *name; /* name of configuration option */
104 int type; /* for possible values, see above */
105 dotconf_callback_t callback; // callback function
106 info_t *info; /* additional info for multi-option callbacks */
107 unsigned long context; // context sensitivity flags
108 };
109
110 /*
111 * DOTCONF.C
112 */
113 extern void dotconf_cleanup(struct configfile *);
114 extern int dotconf_command_loop(struct configfile *);
115 extern struct configfile *dotconf_create(const char *,
116 const struct configoption *, context_t *, unsigned long);
117
118 #ifdef __cplusplus
119 } // extern "C"
120 #endif
121
122 #endif // PMT_DOTCONF_H
123
124 //=============================================================================
+0
-1
src/fmt_ptrn-nolibtool.c less more
0 #include "fmt_ptrn.c"
+0
-747
src/fmt_ptrn.c less more
0 /*=============================================================================
1 fmt_ptrn.c
2 Copyright (C) W. Michael Putello <new@flyn.org>, 1999 - 2000
3 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of
8 the License, or (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this program; if not, write to:
17 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18 Boston, MA 02110-1301 USA
19
20 -- For details, see the file named "LICENSE.LGPL2"
21 =============================================================================*/
22 #include <assert.h>
23 #include <glib.h>
24 #include <stdarg.h>
25 #include <stdio.h>
26 #include <stdlib.h>
27 #include <string.h>
28 #include <zlib.h>
29 #include "buffer.h"
30 #include "compiler.h"
31 #include "modifiers.h"
32 #include "fmt_ptrn.h"
33 #include "pair.h"
34 #include "xstdlib.h"
35
36 // Definitions
37 #define KEY_LEN 80
38 #define PARSE_ERR_LEN BUFSIZ
39 #define STACK_MAX_ITEMS 10
40
41 struct mystack {
42 struct modifier data[STACK_MAX_ITEMS];
43 int size;
44 };
45
46 // Functions
47 static void _apply_modifiers(struct fmt_ptrn *, struct buffer *, struct mystack *);
48 static gint _cmp(gconstpointer, gconstpointer);
49 static bool _copy_fillers(gpointer, gpointer, gpointer);
50 static void _eat_alternate(struct fmt_ptrn *, const char **);
51 static bool _fill_it(struct fmt_ptrn *, const char *);
52 static int _fmt_ptrn_copy_fillers(struct fmt_ptrn *, struct fmt_ptrn *);
53 static int fmt_ptrn_valid(const struct fmt_ptrn *);
54 static bool _free_tree_node(gpointer, gpointer, gpointer);
55 static void _handle_fmt_str(struct fmt_ptrn *, const char **);
56 static bool _is_literal(struct fmt_ptrn *, const char *);
57 static bool _lookup(const struct fmt_ptrn *, const char *, struct buffer *);
58 static char * _matching_paren(const char *);
59 static inline bool modifier_valid(const struct modifier *);
60 static void _read_alternate(struct fmt_ptrn *, const char **, struct buffer *);
61 static void _read_key(struct fmt_ptrn *, char *, const char **);
62 static void _read_literal(struct fmt_ptrn *, char *, struct buffer *);
63 static bool _read_modifier(struct fmt_ptrn *, const char **, struct mystack *);
64 static void _read_modifier_arg(struct fmt_ptrn *, const char **, struct modifier *);
65 static void _read_modifiers(struct fmt_ptrn *, const char **, struct mystack *);
66 static int _stack_contains(const struct mystack, const char *);
67 static inline void _stack_init(struct mystack *);
68 static bool _stack_pop(struct mystack *, struct modifier *);
69 static bool _stack_push(struct fmt_ptrn *, struct mystack *, const struct modifier *);
70 static inline bool mystack_valid(const struct mystack *);
71
72 //-----------------------------------------------------------------------------
73 /* fmt_ptrn_valid
74 @x: fmt_ptrn to check
75
76 Verifies that the fmt_ptrn strucutre is consistent.
77 */
78 static int fmt_ptrn_valid(const struct fmt_ptrn *x) {
79 if (x == NULL)
80 return FALSE;
81 /* FIXME */
82 /* gzFile template_fp; */
83 /* char template_path[PATH_MAX + 1]; */
84 /* long line_num; */
85 if(!buffer_valid(&x->raw_buf) || !buffer_valid(&x->filled_buf) ||
86 !buffer_valid(&x->lookup_buf))
87 return FALSE;
88 /* char errmsg[BUFSIZ + 1]; */
89 /* GQueue *parse_errmsg; */
90 /* GTree *fillers; */
91 return TRUE;
92 }
93
94 /* ============================ fmt_ptrn_parse_err () ====================== */
95 bool fmt_ptrn_parse_err(const struct fmt_ptrn *x) {
96 assert(fmt_ptrn_valid(x));
97 return !g_queue_is_empty(x->parse_errmsg);
98 }
99
100 /* ============================ fmt_ptrn_parse_strerror () ================= */
101 char *fmt_ptrn_parse_strerror(struct fmt_ptrn *x) {
102 char *errmsg;
103 char *fnval;
104
105 assert(fmt_ptrn_valid(x));
106
107 if((errmsg = g_queue_pop_tail(x->parse_errmsg)) == NULL)
108 fnval = xstrdup("no error"); // leak
109 else
110 fnval = errmsg; // g_queue_pop_tail: possible leak
111
112 assert(fmt_ptrn_valid(x));
113 assert(fnval != NULL);
114
115 return fnval;
116 }
117
118 /* ============================ enqueue_parse_errmsg () =================== */
119 void enqueue_parse_errmsg(struct fmt_ptrn *x, const char *msg, ...) {
120 va_list args;
121 char *err;
122
123 assert(fmt_ptrn_valid(x));
124 assert(msg != NULL);
125
126 err = xmalloc(PARSE_ERR_LEN + 1);
127 va_start(args, msg);
128 vsnprintf(err, PARSE_ERR_LEN, msg, args);
129 va_end(args);
130 g_queue_push_head(x->parse_errmsg, err);
131
132 assert(fmt_ptrn_valid(x));
133 }
134
135 /* ============================ modifier_valid () ======================= */
136 static inline bool modifier_valid(const struct modifier *m) {
137 /* FIXME */
138 return TRUE;
139 }
140
141 /* ============================ mystack_valid () ========================== */
142 static inline bool mystack_valid(const struct mystack *s) {
143 return (s == NULL && s->size != 0) ? FALSE : TRUE;
144 }
145
146 /* ============================ _stack_init () ============================= */
147 static inline void _stack_init(struct mystack *s) {
148 s->size = 0;
149 assert(mystack_valid(s));
150 }
151
152 /* ============================ _stack_push () ============================= */
153 static bool _stack_push(struct fmt_ptrn *x, struct mystack *s,
154 const struct modifier *data)
155 {
156 bool fnval = FALSE;
157
158 assert(fmt_ptrn_valid(x));
159 assert(mystack_valid(s));
160 assert(modifier_valid(data));
161 if (s->size == STACK_MAX_ITEMS) {
162 enqueue_parse_errmsg(x, "%s: %ld: more than %d modifiers",
163 x->template_path, x->line_num,
164 STACK_MAX_ITEMS);
165 fnval = FALSE;
166 } else {
167 s->data[s->size++] = *data;
168 fnval = TRUE;
169 }
170
171 assert(fmt_ptrn_valid(x));
172 assert(mystack_valid(s));
173 return fnval;
174 }
175
176 /* ============================ _stack_pop () ============================== */
177 static bool _stack_pop(struct mystack *s, struct modifier *data) {
178 bool fnval = FALSE;
179 assert(mystack_valid(s));
180 assert(modifier_valid(data));
181 if(s->size == 0)
182 fnval = FALSE;
183 else {
184 *data = s->data[--s->size];
185 fnval = TRUE;
186 }
187
188 assert(mystack_valid(s));
189 assert(modifier_valid(data));
190 return fnval;
191 }
192
193 /* ============================ _stack_contains () ========================= */
194 static int _stack_contains(const struct mystack s, const char *n)
195 {
196 int i;
197 assert(mystack_valid(&s));
198 for (i = 0; i < s.size; i++)
199 if (s.data[i].fn.id == n)
200 return 1;
201 return 0;
202 }
203
204 /* ============================ fmt_ptrn_update_kv () ====================== */
205 void fmt_ptrn_update_kv(struct fmt_ptrn *x, const char *key, const char *val) {
206 assert(fmt_ptrn_valid(x));
207 assert(key != NULL);
208 assert(val != NULL);
209 /* FIXME: getting rid of the const is silly, but I didn't write g_tree_insert */
210 // string not duplicated but freed? see above
211 g_tree_insert(x->fillers, const_cast(char *, key), const_cast(char *, val));
212 assert(fmt_ptrn_valid(x));
213 }
214
215 /* ============================ _matching_paren () ========================= */
216 static char *_matching_paren(const char *str) {
217 /* Feed it a pointer just after a '(' and it will return a pointer to the
218 matching ')'. Note that it must return CHAR *, not CONST CHAR *, just as
219 strchr() does for example. */
220 int count = 1;
221 assert(str != NULL);
222 while(*str != '\0') {
223 if (*str == '(')
224 count++;
225 else if (*str == ')')
226 count--;
227 if (count == 0)
228 return const_cast(char *, str);
229 str++;
230 }
231 return NULL;
232 }
233
234 /* ============================ _copy_fillers () =========================== */
235 static bool _copy_fillers(gpointer key, gpointer val, gpointer data) {
236 assert(key != NULL);
237 assert(val != NULL);
238 assert(fmt_ptrn_valid(data));
239
240 g_tree_insert(static_cast(struct fmt_ptrn *, data)->fillers,
241 xstrdup(key), xstrdup(val));
242
243 assert(fmt_ptrn_valid(data));
244
245 return FALSE;
246 }
247
248 /* ============================ _fmt_ptrn_copy_fillers () ================== */
249 static int _fmt_ptrn_copy_fillers(struct fmt_ptrn *x, struct fmt_ptrn *y) {
250 /* Copies fillers from one fmt_ptrn to another. */
251 assert(fmt_ptrn_valid(x));
252 assert(fmt_ptrn_valid(y));
253
254 /* FIXME: tried using g_node_copy but that did not seem to work */
255 g_tree_foreach(y->fillers, _copy_fillers, x);
256
257 assert(fmt_ptrn_valid(x));
258 assert(fmt_ptrn_valid(y));
259
260 return 1;
261 }
262
263 /* ============================ _read_alternate () ========================= */
264 static void _read_alternate(struct fmt_ptrn *x, const char **p,
265 struct buffer *buf)
266 {
267 char *alt_end;
268 assert(fmt_ptrn_valid(x));
269 assert(p != NULL);
270 assert(*p != NULL);
271 assert(buffer_valid(buf));
272 if(**p == '\0') /* Already queued error, hopefully. */
273 return;
274 if (**p == ':') {
275 ++*p;
276 if((alt_end = _matching_paren(*p)) != NULL) {
277 /* FIXME: clean up? */
278 struct fmt_ptrn y;
279 char *alt, *filled_alt;
280 alt = xstrndup(*p, (alt_end - *p));
281 fmt_ptrn_init(&y);
282 _fmt_ptrn_copy_fillers(&y, x);
283 filled_alt = fmt_ptrn_filled(&y, alt);
284 realloc_n_ncat(buf, filled_alt, (alt_end - *p));
285 while (fmt_ptrn_parse_err(&y))
286 enqueue_parse_errmsg(x,
287 fmt_ptrn_parse_strerror
288 (&y));
289 *p += (alt_end - *p);
290 free(alt);
291 free(filled_alt);
292 fmt_ptrn_close(&y);
293 } else
294 enqueue_parse_errmsg(x, "%s: %ld: end of input",
295 x->template_path,
296 x->line_num);
297 } else
298 /* We know there is no value for the format string because
299 * this function was called. There is also no alternate.
300 * Call this a parse error to be safe.
301 */
302 enqueue_parse_errmsg(x, "%s: %ld: key has no value",
303 x->template_path, x->line_num);
304 assert(fmt_ptrn_valid(x));
305 assert(p != NULL);
306 assert(*p != NULL);
307 assert(buffer_valid(buf));
308 }
309
310 /* ============================ _eat_alternate () ========================== */
311 static void _eat_alternate(struct fmt_ptrn *x, const char **pattern) {
312 char *alt_end;
313 assert(fmt_ptrn_valid(x));
314 assert(pattern != NULL);
315 assert(*pattern != NULL);
316 if(**pattern == '\0' || **pattern != ':')
317 /* No alternate provided to eat. */
318 return;
319 if((alt_end = _matching_paren(*pattern)) != NULL)
320 *pattern += (alt_end - *pattern);
321 if(**pattern == '\0')
322 enqueue_parse_errmsg(x, "%s: %ld: end of input",
323 x->template_path, x->line_num);
324 assert(fmt_ptrn_valid(x));
325 assert(pattern != NULL);
326 assert(*pattern != NULL);
327 }
328
329 /* ============================ _read_modifier_arg () ====================== */
330 static void _read_modifier_arg(struct fmt_ptrn *x, const char **pattern,
331 struct modifier *i)
332 {
333 size_t arg_len;
334 char *end_quote, *end_paren;
335
336 assert(fmt_ptrn_valid(x));
337 assert(pattern != NULL);
338 assert(*pattern != NULL);
339 assert(modifier_valid(i));
340
341 end_quote = strchr(*pattern, '"');
342 end_paren = strchr(*pattern, ')');
343 if(end_quote == NULL || (end_paren != NULL && end_quote > end_paren))
344 enqueue_parse_errmsg(x, "%s: %ld: no end quote",
345 x->template_path, x->line_num);
346 else {
347 arg_len = end_quote - *pattern;
348 if (arg_len > MODIFIER_ARG_LEN) {
349 g_strlcpy(i->arg, *pattern, MODIFIER_ARG_LEN + 1);
350 enqueue_parse_errmsg(x,
351 "%s: %ld: modifier arg. too long",
352 x->template_path,
353 x->line_num);
354 } else
355 g_strlcpy(i->arg, *pattern, arg_len + 1);
356 if (*(*pattern + arg_len + 1) != ' ')
357 enqueue_parse_errmsg(x,
358 "%s: %ld: no space after arg",
359 x->template_path,
360 x->line_num);
361 *pattern += arg_len + 2; /* Add 2 for end quote and space. */
362 }
363
364 assert(fmt_ptrn_valid(x));
365 assert(pattern != NULL);
366 assert(*pattern != NULL);
367 assert(modifier_valid(i));
368 }
369
370 /* ============================ _read_modifier () ========================== */
371 static bool _read_modifier(struct fmt_ptrn *x, const char **ptrn,
372 struct mystack *modifier)
373 {
374 int i = 0;
375 struct modifier m;
376 bool fnval = FALSE;
377
378 assert(fmt_ptrn_valid(x));
379 assert(ptrn != NULL);
380 assert(*ptrn != NULL);
381 assert(mystack_valid(modifier));
382
383 while(mod_fn[i].id != NULL) {
384 if(strncmp(mod_fn[i].id, *ptrn, strlen(mod_fn[i].id)) == 0) {
385 *ptrn +=
386 strlen(mod_fn[i].id) +
387 (mod_fn[i].has_arg ? 0 : 1);
388 m.fn = mod_fn[i];
389 if (mod_fn[i].has_arg)
390 _read_modifier_arg(x, ptrn, &m);
391 else
392 *m.arg = '\0';
393 _stack_push(x, modifier, &m);
394 fnval = TRUE;
395 break;
396 }
397 i++;
398 }
399
400 assert(fmt_ptrn_valid(x));
401 assert(ptrn != NULL);
402 assert(*ptrn != NULL);
403 assert(mystack_valid(modifier));
404
405 return fnval;
406 }
407
408 /* ============================ _read_modifiers () ========================= */
409 static void _read_modifiers(struct fmt_ptrn *x, const char **ptrn,
410 struct mystack *modifier)
411 {
412 assert(fmt_ptrn_valid(x));
413 assert(ptrn != NULL);
414 assert(*ptrn != NULL);
415 assert(mystack_valid(modifier));
416
417 while(_read_modifier(x, ptrn, modifier)) /* noop */;
418
419 assert(fmt_ptrn_valid(x));
420 assert(ptrn != NULL);
421 assert(*ptrn != NULL);
422 assert(mystack_valid(modifier));
423
424 return;
425 }
426
427 /* ============================ _read_key () =============================== */
428 static void _read_key(struct fmt_ptrn *x, char *key, const char **p) {
429 int i;
430
431 assert(fmt_ptrn_valid(x));
432 assert(key != NULL);
433 assert(p != NULL);
434 assert(*p != NULL);
435
436 *key = '\0';
437 for(i = 0; i < KEY_LEN && **p != '\0' && strchr(":)", **p) == NULL; i++)
438 strncat(key, (*p)++, 1);
439 if(**p != '\0' && strchr(":)", **p) == NULL) {
440 /* Uh oh, key is too many characters, eat the rest. */
441 while(**p != '\0' && **p != ':' && **p != ')')
442 ++*p;
443 enqueue_parse_errmsg(x, "%s: %ld: key too long",
444 x->template_path, x->line_num);
445 }
446 if(**p == '\0')
447 enqueue_parse_errmsg(x, "%s: %ld: end of input",
448 x->template_path, x->line_num);
449
450 assert(fmt_ptrn_valid(x));
451 assert(p != NULL);
452 assert(*p != NULL);
453 }
454
455 /* ============================ _apply_modifiers () ======================== */
456 static void _apply_modifiers(struct fmt_ptrn *x, struct buffer *str,
457 struct mystack *modifier)
458 {
459 struct modifier m;
460
461 assert(fmt_ptrn_valid(x));
462 assert(buffer_valid(str));
463 assert(mystack_valid(modifier));
464
465 if (buffer_len(str) > 0) /* error should have been queued elsewhere */
466 while(_stack_pop(modifier, &m))
467 if(m.fn.fn != NULL && !m.fn.fn(str, x, m.arg))
468 enqueue_parse_errmsg(x, "%s: %ld: error applying %s modifier to %s",
469 x->template_path, x->line_num, m.fn.id, str->data);
470
471 assert(fmt_ptrn_valid(x));
472 assert(buffer_valid(str));
473 assert(mystack_valid(modifier));
474 }
475
476 /* ============================ _lookup () ================================= */
477 static bool _lookup(const struct fmt_ptrn *x, const char *key,
478 struct buffer *value)
479 {
480 char *tmp;
481 bool fnval = FALSE;
482
483 assert(fmt_ptrn_valid(x));
484 assert(key != NULL);
485 assert(buffer_valid(value));
486
487 tmp = g_tree_lookup(x->fillers, key);
488 if(tmp != NULL) {
489 realloc_n_cpy(value, tmp);
490 fnval = TRUE;
491 } else {
492 if (buffer_len(value) > 0) /* error should have been queue elsewhere */
493 *value->data = '\0'; /* Otherwise _read_alternate will append onto garbage. */
494 fnval = FALSE;
495 }
496
497 assert(buffer_valid(value));
498
499 return fnval;
500 }
501
502 /* ============================ _is_literal () ============================= */
503 static bool _is_literal(struct fmt_ptrn *x, const char *str) {
504 bool fnval = FALSE;
505
506 assert(fmt_ptrn_valid(x));
507 assert(str != NULL);
508
509 if (*str == '"') {
510 if(strchr(str + 1, '"') != NULL)
511 enqueue_parse_errmsg(x, "%s: %ld: no end quote",
512 x->template_path,
513 x->line_num);
514 fnval = TRUE;
515 }
516
517 assert(fmt_ptrn_valid(x));
518
519 return fnval;
520 }
521
522 /* ============================ _read_literal () =========================== */
523 /* FIXME: is this right? it does not seem to look for closing '"' */
524 static void _read_literal(struct fmt_ptrn *x, char *str, struct buffer *buf) {
525 assert(fmt_ptrn_valid(x));
526 assert(str != NULL);
527 assert(buffer_valid(buf));
528
529 str++;
530 str[strlen(str) - 1] = '\0';
531 if(strlen(str) > 0)
532 realloc_n_cpy(buf, str);
533 else
534 enqueue_parse_errmsg(x, "%s: %ld: no literal found in quotes",
535 x->template_path,
536 x->line_num);
537
538 assert(fmt_ptrn_valid(x));
539 assert(buffer_valid(buf));
540 }
541
542 /* ============================ _handle_fmt_str () ========================= */
543 static void _handle_fmt_str(struct fmt_ptrn *x, const char **p) {
544 /* format string -> %(<modifier_0> ... <modifier_n> <key>:<alt>) */
545 struct mystack modifier;
546 char key[KEY_LEN + 1];
547
548 assert(fmt_ptrn_valid(x));
549 assert(p != NULL);
550 assert(*p != NULL);
551
552 _stack_init(&modifier);
553 *p += 2; /* Skip "%(". */
554 _read_modifiers(x, p, &modifier);
555 if (_stack_contains(modifier, "#")) {
556 /* NOOP. */
557 } else {
558 _read_key(x, key, p);
559 if (_is_literal(x, key)) {
560 _read_literal(x, key, &x->lookup_buf);
561 _apply_modifiers(x, &x->lookup_buf, &modifier);
562 } else if (_lookup(x, key, &x->lookup_buf)) {
563 _eat_alternate(x, p);
564 _apply_modifiers(x, &x->lookup_buf, &modifier);
565 } else
566 _read_alternate(x, p, &x->lookup_buf);
567 if (buffer_len(&x->lookup_buf))
568 /* error should have been queued elsewhere */
569 realloc_n_cat(&x->filled_buf, x->lookup_buf.data);
570 }
571 if(**p != '\0')
572 ++*p; /* Skip ')'. */
573
574 assert(fmt_ptrn_valid(x));
575 assert(p != NULL);
576 assert(*p != NULL);
577 }
578
579 /* ============================ _fill_it () ================================ */
580 static bool _fill_it(struct fmt_ptrn *x, const char *p) {
581 const char *pattern;
582 char *orig_ptr;
583 bool fnval = TRUE;
584
585 assert(fmt_ptrn_valid(x));
586 assert(p != NULL);
587
588 pattern = orig_ptr = xstrdup(p);
589 while(*pattern != '\0') {
590 if (*pattern == '%' && *(pattern + 1) == '%') {
591 /* Handle %%(...), which should be filled as %(...). */
592 realloc_n_ncat(&x->filled_buf, pattern, 1);
593 pattern += 2;
594 } else if(*pattern == '%' && *(pattern + 1) == '(') {
595 _handle_fmt_str(x, &pattern);
596 } else {
597 if (*pattern == '\n')
598 x->line_num++;
599 realloc_n_ncat(&x->filled_buf, pattern++, 1);
600 }
601 }
602 free(orig_ptr);
603
604 assert(fmt_ptrn_valid(x));
605
606 return fnval;
607 }
608
609 /* ============================ fmt_ptrn_filled () ========================= */
610 char *fmt_ptrn_filled(struct fmt_ptrn *x, const char *p) {
611 char *fnval = NULL;
612
613 assert(fmt_ptrn_valid(x));
614 assert(p != NULL);
615
616 buffer_clear(&x->filled_buf);
617 if (!_fill_it(x, p))
618 return NULL;
619 if(buffer_len(&x->filled_buf) > 0)
620 /* FIXME: what if len == 0? protected by assert, but... */
621 fnval = xstrdup(x->filled_buf.data);
622
623 assert(fmt_ptrn_valid(x));
624 /* FIXME: assert(fnval != NULL); WHY DID I THINK THIS WAS NEEDED? */
625
626 return fnval;
627 }
628
629 /* ============================ _cmp () ==================================== */
630 static gint _cmp(gconstpointer a, gconstpointer b) {
631 /* FIXME: why is a and/or b sometimes NULL? */
632 if(a == NULL && b == NULL)
633 return 0;
634 if(a == NULL)
635 return -1;
636 if(b == NULL)
637 return 1;
638 return strcmp(a, b);
639 }
640
641 /* ============================ fmt_ptrn_init () =========================== */
642 int fmt_ptrn_init(struct fmt_ptrn *x) {
643 /* Alternative to open; does everything but open the file. This
644 * should be used when filling strings instead of files.
645 */
646 g_strlcpy(x->errmsg, "no error", sizeof(x->errmsg));
647 x->parse_errmsg = g_queue_new();
648 x->fillers = g_tree_new(_cmp);
649 x->template_fp = NULL;
650 x->line_num = 1;
651 buffer_init(&x->raw_buf);
652 buffer_init(&x->filled_buf);
653 buffer_init(&x->lookup_buf);
654 g_strlcpy(x->template_path, "string", sizeof(x->template_path));
655
656 assert(fmt_ptrn_valid(x));
657
658 return 1;
659 }
660
661 /* ============================ fmt_ptrn_open () =========================== */
662 bool fmt_ptrn_open(const char *path, struct fmt_ptrn *x) {
663 gzFile in_file;
664 bool fnval = TRUE;
665
666 assert(path != NULL);
667 assert(fmt_ptrn_valid(x));
668
669 if((in_file = gzopen(path, "rb")) == NULL) {
670 fnval = FALSE;
671 goto _return;
672 }
673 if (!fmt_ptrn_init(x)) {
674 fnval = FALSE;
675 goto _return;
676 }
677 x->template_fp = in_file; /* init sets this to NULL. */
678 strcpy(x->template_path, path); /* init sets this to "string". */
679 _return:
680 assert(fmt_ptrn_valid(x));
681
682 return fnval;
683 }
684
685 /* ============================ fmt_ptrn_gets () =========================== */
686 char *fmt_ptrn_gets(char *buf, size_t size, struct fmt_ptrn *x) {
687 char *fnval = NULL;
688
689 assert(buf != NULL);
690 assert(fmt_ptrn_valid(x));
691
692 if (buffer_len(&x->filled_buf) == 0) {
693 /* FIXME: potentially, a buffer could be filled with only
694 * half of a format string.
695 */
696 /* Here buf is used as a temp. buffer. */
697 if (gzgets(x->template_fp, buf, size) == Z_NULL) {
698 fnval = NULL;
699 goto _return;
700 }
701 if (!_fill_it(x, buf)) {
702 fnval = NULL;
703 goto _return;
704 }
705 }
706 if (buffer_len(&x->filled_buf) > 0) {
707 g_strlcpy(buf, x->filled_buf.data, size);
708 buffer_eat(&x->filled_buf, strlen(buf));
709 fnval = buf;
710 } else {
711 fnval = NULL;
712 goto _return;
713 }
714 _return:
715 assert(fmt_ptrn_valid(x));
716
717 return fnval;
718 }
719
720 /* ============================ _free_tree_node () ========================= */
721 /* FIXME: this function should take TWO pointers!!!!!! */
722 static bool _free_tree_node(gpointer key, gpointer val, gpointer data) {
723 /* FIXME: this function may not modify tree. need to write pointers to a list and then destroy that list outside of this function. */
724 return FALSE;
725 }
726
727 /* ============================ fmt_ptrn_close () ========================== */
728 int fmt_ptrn_close(struct fmt_ptrn *x) {
729 gpointer ptr;
730
731 assert(fmt_ptrn_valid(x));
732
733 while ((ptr = g_queue_pop_head(x->parse_errmsg)) != NULL)
734 free(ptr);
735 g_tree_foreach(x->fillers, _free_tree_node, NULL);
736 buffer_clear(&x->raw_buf);
737 buffer_clear(&x->filled_buf);
738 buffer_clear(&x->lookup_buf);
739 /* x->template_fp == NULL if fmt_ptrn_init was used instead of
740 * fmt_ptrn_open.
741 */
742 return (x != NULL && x->template_fp != NULL) ?
743 gzclose(x->template_fp) : 1;
744 }
745
746 //=============================================================================
+0
-71
src/fmt_ptrn.h less more
0 /*=============================================================================
1 fmt_ptrn.h
2 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of
7 the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to:
16 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 Boston, MA 02110-1301 USA
18
19 -- For details, see the file named "LICENSE.LGPL2"
20 =============================================================================*/
21 #ifndef PMT_FMT_PTRN_H
22 #define PMT_FMT_PTRN_H 1
23
24 #include <sys/types.h>
25 #include <limits.h>
26 #include <glib.h>
27 #include <stdio.h> // BUFSIZ
28 #include <zlib.h>
29 #include "buffer.h"
30 #include "xstdlib.h"
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 struct pair;
37
38 struct fmt_ptrn {
39 gzFile template_fp;
40 char template_path[PATH_MAX + 1];
41 long line_num;
42 struct buffer raw_buf; // Buffer for unfilled data
43 struct buffer filled_buf; // Buffer for filled data
44 struct buffer lookup_buf; // Lookup buffer; here so it is persistent
45 char errmsg[BUFSIZ + 1]; // General errors
46 GQueue *parse_errmsg; // Parse errors
47 GTree *fillers; // Format pattern / value pairs
48 };
49
50 /*
51 * FMT_PTRN.C
52 */
53 extern int fmt_ptrn_close(struct fmt_ptrn *);
54 extern bool fmt_ptrn_parse_err(const struct fmt_ptrn *);
55 extern void enqueue_parse_errmsg(struct fmt_ptrn *, const char *, ...);
56
57 extern char *fmt_ptrn_filled(struct fmt_ptrn *, const char *);
58 extern char *fmt_ptrn_gets(char *, size_t, struct fmt_ptrn *);
59 extern int fmt_ptrn_init(struct fmt_ptrn *);
60 extern bool fmt_ptrn_open(const char *, struct fmt_ptrn *);
61 extern char *fmt_ptrn_parse_strerror(struct fmt_ptrn *);
62 extern void fmt_ptrn_update_kv(struct fmt_ptrn *, const char *, const char *);
63
64 #ifdef __cplusplus
65 } // extern "C"
66 #endif
67
68 #endif // PMT_FMT_PTRN_H
69
70 //=============================================================================
00 /*=============================================================================
1 misc.c
1 pam_mount - misc.c
22 Copyright (C) Elvis Pfützenreuter <epx@conectiva.com>, 2000
3 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
3 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2007
44 Copyright © Bastian Kleineidam <calvin [at] debian org>, 2005
55
66 This program is free software; you can redistribute it and/or modify
2121 -- For details, see the file named "LICENSE.LGPL2"
2222 =============================================================================*/
2323 #include <config.h>
24 #ifdef HAVE_SETFSUID
25 # include <sys/fsuid.h>
26 #endif
2724 #include <sys/stat.h>
2825 #include <assert.h>
2926 #include <limits.h>
3330 #include <string.h>
3431 #include <syslog.h>
3532 #include <unistd.h>
33 #include <libHX.h>
3634 #include <pwd.h>
37 #include "fmt_ptrn.h"
3835 #include "misc.h"
3936 #include "pam_mount.h"
4037 #include "private.h"
4138 #include "readconfig.h"
4239 #include "xstdlib.h"
4340
44 // Functions
41 /* Functions */
4542 static int static_string_valid(const char *, const size_t);
4643
4744 //-----------------------------------------------------------------------------
48 /* l0g
49 @format: printf(3)-style format specifier
50
51 Message is logged to syslog, and, if debugging is turned on, printed to
52 %stderr. Use this for critical messages or issues that cause(d) pam_mount
53 to fail.
54 */
55 void l0g(const char *format, ...) {
45 /*
46 * misc_log - log to syslog
47 * @format: printf(3)-style format specifier
48 *
49 * Message is logged to syslog, and, if debugging is turned on, printed to
50 * %stderr. Use this for critical messages or issues that cause(d) pam_mount
51 * to fail.
52 */
53 void misc_log(const char *format, ...)
54 {
5655 va_list args, arg2;
5756
5857 assert(format != NULL);
5958
6059 va_start(args, format);
6160 va_copy(arg2, args);
62 if(Debug)
63 vfprintf(stderr, format, args);
61 if (Debug)
62 vfprintf(stderr, format, args);
6463 vsyslog(LOG_AUTHPRIV | LOG_ERR, format, arg2);
6564 va_end(args);
6665 va_end(arg2);
67 return;
68 }
69
70
71 /* w4rn
72 @format: printf(3)-style format specifier
73
74 If debugging is turned on, the message is logged to syslog and %stderr.
75 Use this for debugging messages.
76 */
77 void w4rn(const char *format, ...) {
78 va_list args, arg2;
79
80 assert(format != NULL);
81 if(Debug == 0)
82 return;
83
84 va_start(args, format);
85 va_copy(arg2, args);
86 vfprintf(stderr, format, args);
87 vsyslog(LOG_AUTHPRIV | LOG_ERR, format, arg2);
88 va_end(args);
89 va_end(arg2);
90 return;
91 }
92
93
94 /* exists
95 @file: file to check
96
97 Check if a file exists (if it can be stat()'ed) and return positive
98 non-zero if that was successful. Returns 0 for error. %errno will be set
99 in case of error.
100 */
101 int exists(const char *file) {
102 struct stat sb;
103 assert(file != NULL);
104 return stat(file, &sb) == 0;
105 }
106
107
108 /* owns
109 @user: user to check for
110 @file: file to check
111
112 Checks whether @user owns @file. Returns positive non-zero if this is the
113 case, otherwise zero. If an error occurred, zero is returned and %errno
114 is set. (For the success case, %errno is undefined.)
115 */
116 int owns(const char *user, const char *file) {
66 return;
67 }
68
69 /*
70 * misc_warn - debug logger
71 * @format: printf(3)-style format specifier
72 *
73 * If debugging is turned on, the message is logged to syslog and %stderr.
74 * Use this for debugging messages.
75 */
76 void misc_warn(const char *format, ...)
77 {
78 va_list args, arg2;
79
80 assert(format != NULL);
81 if (Debug == 0)
82 return;
83
84 va_start(args, format);
85 va_copy(arg2, args);
86 vfprintf(stderr, format, args);
87 vsyslog(LOG_AUTHPRIV | LOG_ERR, format, arg2);
88 va_end(args);
89 va_end(arg2);
90 return;
91 }
92
93 /*
94 * exists -
95 * @file: file to check
96 *
97 * Check if a file exists (if it can be stat()'ed) and return positive
98 * non-zero if that was successful. Returns 0 for error. %errno will be set
99 * in case of error.
100 */
101 int exists(const char *file)
102 {
103 struct stat sb;
104 assert(file != NULL);
105 return stat(file, &sb) == 0;
106 }
107
108
109 /* owns -
110 * @user: user to check for
111 * @file: file to check
112 *
113 * Checks whether @user owns @file. Returns positive non-zero if this is the
114 * case, otherwise zero. If an error occurred, zero is returned and %errno
115 * is set. (For the success case, %errno is undefined.)
116 */
117 int owns(const char *user, const char *file)
118 {
117119 struct stat filestat;
118120 struct passwd *userinfo;
119121
120122 assert(user != NULL);
121123 assert(file != NULL);
122124
123 if((userinfo = getpwnam(user)) == NULL) {
124 l0g(PMPREFIX "user %s could not be translated to UID\n",
125 if ((userinfo = getpwnam(user)) == NULL) {
126 l0g("user %s could not be translated to UID\n",
125127 user);
126 return FALSE;
128 return 0;
127129 }
128130
129131 if (stat(file, &filestat) != 0) {
130 w4rn(PMPREFIX "file %s could not be stat'ed\n", file);
131 return FALSE;
132 }
133
134 return filestat.st_uid == userinfo->pw_uid && !S_ISLNK(filestat.st_mode);
135 }
136
137
138 /* str_to_long
139 @n: string to analyze
140
141 Calls @strtol on @n using base 10 and makes sure there were no invalid
142 characters in @n. Returns the value, or %LONG_MAX in case of an
143 over-/underflow.
144 NOTE: This function is only referenced from pmvarrun.c.
145 */
146 long str_to_long(const char *n) {
132 w4rn("file %s could not be stat'ed\n", file);
133 return 0;
134 }
135
136 return filestat.st_uid == userinfo->pw_uid &&
137 !S_ISLNK(filestat.st_mode);
138 }
139
140 /*
141 * str_to_long -
142 * @n: string to analyze
143 *
144 * Calls @strtol on @n using base 10 and makes sure there were no invalid
145 * characters in @n. Returns the value, or %LONG_MAX in case of an
146 * over-/underflow.
147 * NOTE: This function is only referenced from pmvarrun.c.
148 */
149 long str_to_long(const char *n)
150 {
147151 long val;
148152 char *endptr = NULL;
149 if(n == NULL) {
150 l0g(PMPREFIX "count string is NULL\n");
153 if (n == NULL) {
154 l0g("count string is NULL\n");
151155 return LONG_MAX;
152156 }
153157 val = strtol(n, &endptr, 10);
154 if(*endptr != '\0') {
155 l0g(PMPREFIX "count string is not valid\n");
158 if (*endptr != '\0') {
159 l0g("count string is not valid\n");
156160 return LONG_MAX;
157161 }
158162 return val;
159163 }
160164
161
162 /* static_string_valid
163 @s: string to analyze
164 @len: maximum length of string
165
166 Verifies that there is a '\0' byte within the first @len bytes of @s.
167 */
168 static int static_string_valid(const char *s, const size_t len) {
165 /*
166 * static_string_valid -
167 * @s: string to analyze
168 * @len: maximum length of string
169 *
170 * Verifies that there is a '\0' byte within the first @len bytes of @s.
171 */
172 static int static_string_valid(const char *s, const size_t len)
173 {
169174 size_t i;
170175 if (s == NULL)
171 return FALSE;
172 /* make sure there is a terminating NULL */
176 return 0;
177 /* make sure there is a terminating NUL */
173178 for (i = 0; i < len; i++)
174 if(s[i] == '\0')
175 return TRUE;
176 return FALSE;
177 }
178
179
180 /* vol_valid
181 @v: volume to check
182
183 Verifies that the volume structure is consistent.
184 */
179 if (s[i] == '\0')
180 return 1;
181 return 0;
182 }
183
184 /*
185 * vol_valid -
186 * @v: volume to check
187 *
188 * Verifies that the volume structure is consistent.
189 */
185190 int vol_valid(const struct vol *v) {
186191 if (v == NULL)
187 return FALSE;
188 if (!(v->type >= 0 && v->type < COMMAND_MAX))
189 return FALSE;
192 return 0;
193 if (!(v->type >= 0 && v->type < _CMD_MAX))
194 return 0;
190195 /* should be guaranteed by volume_record_sane() */
191196 /* FIXME: hope to have this in util-linux (LCLMOUNT) some day: */
192 if (!(v->type == LCLMOUNT || v->type == CRYPTMOUNT ||
193 v->type == FUSEMOUNT || strlen(v->server) > 0))
194 return FALSE;
197 if (!(v->type == CMD_LCLMOUNT || v->type == CMD_CRYPTMOUNT ||
198 v->type == CMD_FUSEMOUNT || v->type == CMD_TRUECRYPTMOUNT ||
199 strlen(v->server) > 0))
200 return 0;
195201 /* bool globalconf; */
196202 /* bool created_mntpt; */
197 if(!static_string_valid(v->fs_key_cipher, MAX_PAR + 1) ||
198 !static_string_valid(v->fs_key_path, PATH_MAX + 1))
199 return FALSE;
203 if (!static_string_valid(v->fs_key_cipher, MAX_PAR + 1) ||
204 !static_string_valid(v->fs_key_path, PATH_MAX + 1))
205 return 0;
200206 /* should be guaranteed by volume_record_sane(): */
201207 if (!(strlen(v->fs_key_cipher) == 0 || strlen(v->fs_key_path) > 0))
202 return FALSE;
203 if(!static_string_valid(v->server, MAX_PAR + 1) ||
204 !static_string_valid(v->user, MAX_PAR + 1) ||
205 !static_string_valid(v->volume, MAX_PAR + 1))
206 return FALSE;
208 return 0;
209 if (!static_string_valid(v->server, MAX_PAR + 1) ||
210 !static_string_valid(v->user, MAX_PAR + 1) ||
211 !static_string_valid(v->volume, MAX_PAR + 1))
212 return 0;
207213 /* optlist_t * options */
208 if(!static_string_valid(v->mountpoint, PATH_MAX + 1))
209 return FALSE;
214 if (!static_string_valid(v->mountpoint, PATH_MAX + 1))
215 return 0;
210216 /* bool use_fstab */
211 return TRUE;
212 }
213
214
215 /* config_valid
216 @c: config to check
217
218 Verifies that the configuration structure is consistent.
219 */
220 int config_valid(const struct config *c) {
217 return 1;
218 }
219
220 /*
221 * config_valid -
222 * @c: config to check
223 *
224 * Verifies that the configuration structure is consistent.
225 */
226 int config_valid(const struct config *c)
227 {
221228 int i;
222 if(c == NULL || c->user == NULL)
223 return FALSE;
229 if (c == NULL || c->user == NULL)
230 return 0;
224231 /* bool debug */
225232 /* bool mkmountpoint */
226233 /* unsigned int volcount */
227 if(!static_string_valid(c->luserconf, PATH_MAX + 1) ||
228 !static_string_valid(c->fsckloop, PATH_MAX + 1))
229 return FALSE;
234 if (!static_string_valid(c->luserconf, PATH_MAX + 1) ||
235 !static_string_valid(c->fsckloop, PATH_MAX + 1))
236 return 0;
230237 /* FIXME: test char *command[MAX_PAR + 1][COMMAND_MAX]; */
231238 /* optlist_t *options_require; */
232239 /* optlist_t *options_allow; */
233240 /* optlist_t *options_deny; */
234 for(i = 0; i < c->volcount; ++i)
235 if(!vol_valid(c->volume))
236 return FALSE;
237 return TRUE;
238 }
239
240
241 /* log_argv
242 @argv: argument vector
243
244 Log @argv using w4rn() when debugging is turned on.
245 */
246 void log_argv(const char *const *argv) {
241 for (i = 0; i < c->volcount; ++i)
242 if (!vol_valid(c->volume))
243 return 0;
244 return 1;
245 }
246
247 /*
248 * log_argv -
249 * @argv: argument vector
250 * Log @argv using w4rn() when debugging is turned on.
251 */
252 void log_argv(const char *const *argv)
253 {
247254 /* FIXME: UGLY! */
248255 int i;
249256 char str[MAX_PAR + 1];
250 if(!Debug)
257 if (!Debug)
251258 return;
252259 g_strlcpy(str, argv[0], sizeof(str));
253260 g_strlcat(str, " ", sizeof(str));
254 str[sizeof(str)-1] = '\0';
261 str[sizeof_z(str)] = '\0';
255262 for (i = 1; argv[i] != NULL && strlen(str) < sizeof(str) - 2; i++) {
256263 g_strlcat(str, "[", sizeof(str));
257264 g_strlcat(str, argv[i], sizeof(str));
258265 g_strlcat(str, "] ", sizeof(str));
259 str[sizeof(str)-1] = '\0';
260 if(strlen(str) >= sizeof(str) - 1) /* Should never be greater */
266 str[sizeof_z(str)] = '\0';
267 if (strlen(str) >= sizeof_z(str))
268 /* Should never be greater */
261269 break;
262270 }
263 w4rn(PMPREFIX "command: %s\n", str);
264 return;
265 }
266
267
268 /* add_to_argv
269 @argv: argument vector to add to
270 @argc: pointer to current argument count
271 @arg: argument to add
272 @vinfo:
273
274 Expands @arg according to @vinfo and adds it to the @argv vector which is
275 (and will be) NULL-terminated. @argc is increased by one.
276
277 There is a compile-time limit imposed: there can not be more than MAX_PAR-1
278 elements in the @argv vector.
279 */
271 w4rn("command: %s\n", str);
272 return;
273 }
274
275 /* add_to_argv -
276 * @argv: argument vector to add to
277 * @argc: pointer to current argument count
278 * @arg: argument to add
279 * @vinfo:
280 *
281 * Expands @arg according to @vinfo and adds it to the @argv vector which is
282 * (and will be) %NULL-terminated. @argc is increased by one.
283 *
284 * There is a compile-time limit imposed: there can not be more than MAX_PAR-1
285 * elements in the @argv vector.
286 */
280287 void add_to_argv(const char **argv, int *const argc, const char *const arg,
281 struct fmt_ptrn *vinfo)
288 struct HXbtree *vinfo)
282289 {
283290 char *filled;
284291
288295 assert(arg != NULL);
289296 assert(vinfo != NULL);
290297
291 if (*argc == MAX_PAR) { /* FIXME: this is protected by assert above */
292 l0g(PMPREFIX "too many arguments to mount command\n");
298 if (*argc == MAX_PAR) {
299 /* FIXME: this is protected by assert above */
300 l0g("too many arguments to mount command\n");
293301 return;
294302 }
295 if ((filled = fmt_ptrn_filled(vinfo, arg)) == NULL) {
296 /* This case may happen with e.g. %(before="-o" OPTIONS)
297 where OPTIONS is empty. And empty options is certainly
298 valid. */
299 w4rn(PMPREFIX "could not fill %s\n", arg);
300 while (fmt_ptrn_parse_err(vinfo) != 0)
301 l0g(PMPREFIX "%s\n",
302 fmt_ptrn_parse_strerror(vinfo));
303 /* [??] hopefully "key has no value" -- for example:
304 * %(before=\"-k\" KEYBITS) */
303 if (HXformat_aprintf(vinfo, &filled, arg) == 0) {
304 /*
305 * This case may happen with e.g. %(before="-o" OPTIONS) where
306 * OPTIONS is empty. And empty options is certainly valid.
307 */
308 w4rn("could not fill %s\n", arg);
305309 return;
306310 }
307 while (fmt_ptrn_parse_err(vinfo) != 0)
308 l0g(PMPREFIX "%s\n", fmt_ptrn_parse_strerror(vinfo));
309
310 argv[*argc] = filled;
311
312 argv[*argc] = filled;
311313 argv[++*argc] = NULL;
312 return;
313 }
314
315
316 /* set_myuid
317 @data: username
318
319 set_myuid() is called in the child process as a result of the spawn_ap0()
320 fork, before exec() will take place.
321
322 If @user is %NULL, the UID is changed to root. (In most cases, we are
323 already root, though.)
324
325 If @user is not %NULL, the UID of the current process is changed to
326 that of @user. Also, for FUSE daemons, we set the HOME and USER
327 environment variables. setsid() is called so that FUSE daemons (e.g.
328 sshfs) get a new session identifier and do not get killed by the
329 login program after PAM authentication is successful.
330
331 chdir("/") is called so that fusermount does not get stuck in a
332 non-readable directory (by means of doing `su - unprivilegeduser`)
333 */
334 void set_myuid(void *data) {
335 const char *user = data;
336
337 setsid();
338 chdir("/");
339 if(user == NULL) {
340 w4rn(PMPREFIX "%s(pre): real uid/gid=%ld:%ld, "
341 "effective uid/gid=%ld:%ld\n", __FUNCTION__,
342 static_cast(long, getuid()), static_cast(long, getgid()),
343 static_cast(long, geteuid()), static_cast(long, getegid()));
344 if(setuid(0) == -1) {
345 l0g(PMPREFIX "error setting uid to 0\n");
346 return;
347 }
348 #ifdef HAVE_SETFSUID
349 if(setfsuid(0) == -1) {
350 l0g(PMPREFIX "error setting fsuid to 0\n");
351 return;
352 }
353 #endif
354 } else {
355 // Set UID and GID to the user's one.
356 const struct passwd *real_user;
357 w4rn(PMPREFIX "setting uid to user %s\n", user);
358 if((real_user = getpwnam(user)) == NULL) {
359 l0g(PMPREFIX "could not get passwd entry for user %s\n", user);
360 return;
361 }
362 if(setgid(real_user->pw_gid) == -1) {
363 l0g(PMPREFIX "could not set gid to %ld\n",
364 static_cast(long, real_user->pw_gid));
365 return;
366 }
367 if(setuid(real_user->pw_uid) == -1) {
368 l0g(PMPREFIX "could not set uid to %ld\n",
369 static_cast(long, real_user->pw_uid));
370 return;
371 }
372 setenv("HOME", real_user->pw_dir, 1);
373 setenv("USER", real_user->pw_name, 1);
374 }
375 w4rn(PMPREFIX "%s(post): real uid/gid=%ld:%ld, effective uid/gid=%ld:%ld\n",
376 __FUNCTION__, static_cast(long, getuid()), static_cast(long, getgid()),
377 static_cast(long, geteuid()), static_cast(long, getegid()));
378 return;
379 }
380
381
382 /* relookup_user
383 @user: The user to retrieve
384
385 Relookup the user. This is done to account for case-insensitivity of
386 usernames with LDAP. Returns a copy of the real username (as stored in
387 the user database).
388 */
389 char *relookup_user(const char *user) {
390 struct passwd *pe;
391 if((pe = getpwnam(user)) == NULL)
392 return xstrdup(user);
393 else
394 return xstrdup(pe->pw_name);
395 }
396
397 //=============================================================================
314 return;
315 }
316
317 /*
318 * set_myuid -
319 * @data: username
320 *
321 * set_myuid() is called in the child process as a result of the spawn_ap0()
322 * fork, before exec() will take place.
323 *
324 * If @user is %NULL, the UID is changed to root. (In most cases, we are
325 * already root, though.)
326 *
327 * If @user is not %NULL, the UID of the current process is changed to
328 * that of @user. Also, for FUSE daemons, we set the HOME and USER
329 * environment variables. setsid() is called so that FUSE daemons (e.g.
330 * sshfs) get a new session identifier and do not get killed by the
331 * login program after PAM authentication is successful.
332 *
333 * chdir("/") is called so that fusermount does not get stuck in a
334 * non-readable directory (by means of doing `su - unprivilegeduser`)
335 */
336 void set_myuid(void *data)
337 {
338 const char *user = data;
339
340 setsid();
341 chdir("/");
342 if (user == NULL) {
343 w4rn("%s(pre): (uid=%ld, euid=%ld, gid=%ld, egid=%ld)\n", __func__,
344 static_cast(long, getuid()), static_cast(long, geteuid()),
345 static_cast(long, getgid()), static_cast(long, getegid()));
346 if (setuid(0) < 0) {
347 l0g("error setting uid to 0\n");
348 return;
349 }
350 } else {
351 /* Set UID and GID to the user's one */
352 const struct passwd *real_user;
353 w4rn("setting uid to user %s\n", user);
354 if ((real_user = getpwnam(user)) == NULL) {
355 l0g("could not get passwd entry for user %s\n", user);
356 return;
357 }
358 if (setgid(real_user->pw_gid) == -1) {
359 l0g("could not set gid to %ld\n",
360 static_cast(long, real_user->pw_gid));
361 return;
362 }
363 if (setuid(real_user->pw_uid) == -1) {
364 l0g("could not set uid to %ld\n",
365 static_cast(long, real_user->pw_uid));
366 return;
367 }
368 setenv("HOME", real_user->pw_dir, 1);
369 setenv("USER", real_user->pw_name, 1);
370 }
371 w4rn("%s(pre): (uid=%ld, euid=%ld, gid=%ld, egid=%ld)\n", __func__,
372 static_cast(long, getuid()), static_cast(long, geteuid()),
373 static_cast(long, getgid()), static_cast(long, getegid()));
374 return;
375 }
376
377 /*
378 * relookup_user -
379 * @user: The user to retrieve
380 *
381 * Relookup the user. This is done to account for case-insensitivity of
382 * usernames with LDAP. Returns a copy of the real username (as stored in
383 * the user database).
384 */
385 char *relookup_user(const char *user)
386 {
387 struct passwd *pe;
388 if ((pe = getpwnam(user)) == NULL)
389 return xstrdup(user);
390 else
391 return xstrdup(pe->pw_name);
392 }
393
394 /*
395 * misc_add_ntdom -
396 * @v: substitution data
397 * @user: username to add
398 *
399 * Splits up @user into domain and user parts (if applicable) and adds
400 * %(DOMAIN_NAME) and %(DOMAIN_USER) to @v. If @user is not of the form
401 * "domain\user", %(DOMAIN_NAME) will be added as an empty tag, and
402 * %(DOMAIN_USER) will be the same as @v. It is assumed that @user is also
403 * part of @v, and hence, will not go out of scope as long as %(DOMAIN_*) is
404 * in @v.
405 */
406 void misc_add_ntdom(struct HXbtree *v, const char *user)
407 {
408 const char *domain_user, *ptr;
409 char domain[32];
410 *domain = '\0';
411
412 if ((ptr = strchr(user, '\\')) != NULL) {
413 snprintf(domain, sizeof(domain), "%.*s", ptr - user - 1, user);
414 domain_user = ptr + 1;
415 } else {
416 domain_user = user;
417 }
418
419 HXformat_add(v, "DOMAIN_NAME", domain, HXTYPE_STRING | HXFORMAT_IMMED);
420 HXformat_add(v, "DOMAIN_USER", domain_user, HXTYPE_STRING);
421 return;
422 }
0 /*=============================================================================
1 misc.h
2 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of
7 the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to:
16 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 Boston, MA 02110-1301 USA
18
19 -- For details, see the file named "LICENSE.LGPL2"
20 =============================================================================*/
210 #ifndef PMT_MISC_H
221 #define PMT_MISC_H 1
232
243 #include <sys/types.h>
4 #include "compiler.h"
255
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
6 #define __STRINGIFY_EXPAND(s) #s
7 #define __STRINGIFY(s) __STRINGIFY_EXPAND(s)
298
309 struct config;
31 struct fmt_ptrn;
3210 struct vol;
3311
3412 /*
35 * MISC.C
13 * MISC.C
3614 */
15 #define PMPREFIX "pam_mount(" __FILE__ ":" __STRINGIFY(__LINE__) ") "
16 #define l0g(fmt, ...) misc_log((PMPREFIX fmt), ## __VA_ARGS__)
17 #define w4rn(fmt, ...) misc_warn((PMPREFIX fmt), ## __VA_ARGS__)
18
3719 extern void add_to_argv(const char **, int * const, const char * const,
38 struct fmt_ptrn *);
20 struct HXbtree *);
3921 extern int config_valid(const struct config *);
4022 extern int exists(const char *);
41 extern void l0g(const char *, ...);
4223 extern void log_argv(const char * const *);
24 extern void misc_add_ntdom(struct HXbtree *, const char *);
25 extern void misc_log(const char *, ...);
26 extern void misc_warn(const char *, ...);
4327 extern int owns(const char *, const char *);
4428 extern char *relookup_user(const char *);
4529 extern void set_myuid(void *);
4630 extern long str_to_long(const char *);
4731 extern int vol_valid(const struct vol *);
48 extern void w4rn(const char *, ...);
4932
50 #ifdef __cplusplus
51 } // extern "C"
52 #endif
53
54 #endif // PMT_MISC_H
55
56 //=============================================================================
33 #endif /* PMT_MISC_H */
+0
-1
src/modifiers-nolibtool.c less more
0 #include "modifiers.c"
+0
-311
src/modifiers.c less more
0 /*=============================================================================
1 modifiers.c
2 Copyright (C) W. Michael Putello <mike@flyn.org>, 1999 - 2001
3 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of
8 the License, or (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this program; if not, write to:
17 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18 Boston, MA 02110-1301 USA
19
20 -- For details, see the file named "LICENSE.LGPL2"
21 =============================================================================*/
22 #include <ctype.h>
23 #include <stdio.h>
24 #include <stdlib.h>
25 #include <string.h>
26 #include <zlib.h>
27 #include "buffer.h"
28 #include "modifiers.h"
29 #include "fmt_ptrn.h"
30 #include "template.h"
31 #include "xstdlib.h"
32
33 // Definitions
34 typedef int (apply_fn_t)(struct buffer *, struct fmt_ptrn *, char *);
35
36 // Functions
37 static int _apply_comment(struct buffer *, char *, char *);
38 static int _apply_delim(struct buffer *, const char *, const char *);
39 static apply_fn_t
40 apply_after, apply_basename, apply_before, apply_c_comment, apply_c_delim,
41 apply_cpp_comment, apply_cpp_delim, apply_file, apply_fn, apply_lower,
42 apply_newlines, apply_no_newlines, apply_remove_underscore,
43 apply_sh_comment, apply_sh_delim, apply_template, apply_tex_comment,
44 apply_tex_delim, apply_upper, apply_xml_comment;
45
46 // Variables
47 const struct modifier_info mod_fn[] = {
48 {"upper", apply_upper, 0},
49 {"lower", apply_lower, 0},
50 {"basename", apply_basename, 0},
51 {"before=\"", apply_before, 1},
52 {"after=\"", apply_after, 1},
53 {"fn", apply_fn, 0},
54 {"c_delim", apply_c_delim, 0},
55 {"cpp_delim", apply_cpp_delim, 0},
56 {"sh_delim", apply_sh_delim, 0},
57 {"tex_delim", apply_tex_delim, 0},
58 {"c_comment", apply_c_comment, 0},
59 {"cpp_comment", apply_cpp_comment, 0},
60 {"sh_comment", apply_sh_comment, 0},
61 {"tex_comment", apply_tex_comment, 0},
62 {"xml_comment", apply_xml_comment, 0},
63 {"sgml_comment", apply_xml_comment, 0},
64 {"newlines", apply_newlines, 0},
65 {"no_newlines", apply_no_newlines, 0},
66 {"template", apply_template, 0},
67 {"file", apply_file, 0},
68 /* FIXME: The following is handled as a special case. */
69 {"#", NULL, 0},
70 {"remove_underscore", apply_remove_underscore, 0},
71 {NULL, NULL, 0},
72 };
73
74 //-----------------------------------------------------------------------------
75 static int apply_upper(struct buffer *dest, struct fmt_ptrn *x, char *arg) {
76 int n;
77 for(n = 0; n < strlen(dest->data); ++n)
78 dest->data[n] = toupper(dest->data[n]);
79 return 1;
80 }
81
82 static int apply_lower(struct buffer *dest, struct fmt_ptrn *x, char *arg) {
83 int n;
84 for(n = 0; n < strlen(dest->data); ++n)
85 dest->data[n] = tolower(dest->data[n]);
86 return 1;
87 }
88
89 static int apply_basename(struct buffer *dest, struct fmt_ptrn *x, char *arg) {
90 char *ptr = strchr(dest->data, '.');
91 if(ptr != NULL)
92 *ptr = '\0';
93 return 1;
94 }
95
96 static int _apply_delim(struct buffer *str, const char *start_cmnt,
97 const char *end_cmnt)
98 {
99 /* This one is a bit ugly, but not very interesting. */
100 int i;
101 char ptr[81];
102 size_t start_cmnt_len = strlen(start_cmnt) + 1; /* + 1 for ' '. */
103 size_t end_cmnt_len = (end_cmnt != NULL) ? strlen(end_cmnt) + 1 : 0;
104 size_t len;
105 if(str->size < sizeof(ptr)) {
106 /* FIXME: use proper buffer interfaces */
107 str->data = xrealloc(str->data, 81);
108 str->size = sizeof(ptr);
109 }
110 strcpy(ptr, start_cmnt);
111 strcat(ptr, " ");
112 for(i = 0; i < 31 - start_cmnt_len - 2; i++) /* - 2 for spaces. */
113 strcat(ptr, "=");
114 strcat(ptr, " ");
115 len = strlen(ptr);
116 strncat(ptr, str->data, sizeof(ptr) - 1 - len - 2 - end_cmnt_len); /* - 2 for spaces. */
117 strcat(ptr, " ");
118 len = strlen(ptr);
119 for(i = 0; i < sizeof(ptr) - 1 - len - end_cmnt_len; i++)
120 strcat(ptr, "=");
121 strcat(ptr, (end_cmnt != NULL) ? " " : "");
122 strcat(ptr, (end_cmnt != NULL) ? end_cmnt : "");
123 strcpy(str->data, ptr);
124 return 1;
125 }
126
127 static int apply_c_delim(struct buffer *dest, struct fmt_ptrn *x, char *arg) {
128 _apply_delim(dest, "/*", "*/");
129 return 1;
130 }
131
132 static int apply_cpp_delim(struct buffer *dest, struct fmt_ptrn *x,
133 char *arg)
134 {
135 _apply_delim(dest, "//", NULL);
136 return 1;
137 }
138
139 static int apply_sh_delim(struct buffer *dest, struct fmt_ptrn *x, char *arg) {
140 _apply_delim(dest, "#", NULL);
141 return 1;
142 }
143
144 static int apply_tex_delim(struct buffer *dest, struct fmt_ptrn *x,
145 char *arg)
146 {
147 _apply_delim(dest, "%", NULL);
148 return 1;
149 }
150
151 static int _apply_comment(struct buffer *dest, char *c0, char *c1) {
152 int i;
153 struct buffer tmp;
154
155 buffer_init(&tmp);
156 realloc_n_cat(&tmp, c0);
157
158 for (i = 0; i < strlen(dest->data); i++) {
159 if (dest->data[i] == '\n' && c1)
160 realloc_n_cat(&tmp, c1);
161 realloc_n_ncat(&tmp, dest->data + i, 1);
162 if (dest->data[i] == '\n' && i < strlen(dest->data) - 1)
163 realloc_n_cat(&tmp, c0);
164 }
165
166 realloc_n_cpy(dest, tmp.data);
167 buffer_clear(&tmp);
168 return 1;
169 }
170
171 static int apply_c_comment(struct buffer *dest, struct fmt_ptrn *x,
172 char *arg)
173 {
174 return _apply_comment(dest, "/* ", " */");
175 }
176
177 static int apply_xml_comment(struct buffer *dest, struct fmt_ptrn *x,
178 char *arg)
179 {
180 return _apply_comment(dest, "<!-- ", " -->");
181 }
182
183 static int apply_sh_comment(struct buffer *dest, struct fmt_ptrn *x,
184 char *arg)
185 {
186 return _apply_comment(dest, "# ", NULL);
187 }
188
189 static int apply_cpp_comment(struct buffer *dest, struct fmt_ptrn *x,
190 char *arg)
191 {
192 return _apply_comment(dest, "// ", NULL);
193 }
194
195 static int apply_tex_comment(struct buffer *dest, struct fmt_ptrn *x,
196 char *arg)
197 {
198 return _apply_comment(dest, "% ", NULL);
199 }
200
201 static int apply_before(struct buffer *dest, struct fmt_ptrn *x, char *arg) {
202 /* Done with no malloc'd tmp. */
203 size_t i, j, old_len = strlen(dest->data), src_len =
204 strlen(arg), new_len = old_len + src_len;
205 /* FIXME: use proper buffer interface! */
206 if (new_len + 1 > dest->size) {
207 dest->size = new_len + 1;
208 dest->data = xrealloc(dest->data, dest->size);
209 }
210 /* Shift dest over to make room for arg. */
211 if (old_len > 0)
212 /* i is unsigned, so i = old_len - 1 makes no sense if old_len == 0 */
213 for (i = old_len - 1, j = new_len - 1; i > 0; i--, j--)
214 dest->data[j] = dest->data[i];
215 dest->data[src_len] = dest->data[0];
216 dest->data[new_len] = '\0';
217 /* Copy arg into dest. */
218 for (i = 0; i < src_len; i++)
219 dest->data[i] = arg[i];
220 return 1;
221 }
222
223 static int apply_no_newlines(struct buffer *dest, struct fmt_ptrn *x,
224 char *arg)
225 {
226 int i;
227 for (i = 0; i < dest->size; i++)
228 if (dest->data[i] == '\n')
229 dest->data[i] = ' ';
230 return 1;
231 }
232
233 static int apply_newlines(struct buffer *dest, struct fmt_ptrn *x, char *arg) {
234 int i;
235 for (i = 0; i < dest->size; i++)
236 if (dest->data[i] == ' ')
237 dest->data[i] = '\n';
238 return 1;
239 }
240
241 static int apply_remove_underscore(struct buffer *dest, struct fmt_ptrn *x,
242 char *arg)
243 {
244 int i;
245 for (i = 0; i < dest->size; i++)
246 if (dest->data[i] == '_')
247 dest->data[i] = '-';
248 return 1;
249 }
250
251 static int apply_after(struct buffer *dest, struct fmt_ptrn *x, char *arg) {
252 /* Too easy. */
253 realloc_n_cat(dest, arg);
254 return 1;
255 }
256
257 static int apply_fn(struct buffer *dest, struct fmt_ptrn *x, char *arg) {
258 apply_after(dest, x, " ()");
259 return 1;
260 }
261
262 static int apply_file(struct buffer *dest, struct fmt_ptrn *x,
263 /* const */ char *arg)
264 {
265 /* This function handles the case where the FMT_PTRN_FILE modifier is
266 * used.
267 */
268 char b[BUFSIZ];
269 gzFile f;
270 if((f = gzopen(dest->data, "rb")) == NULL)
271 return 0;
272 realloc_n_cpy(dest, "");
273 while(gzgets(f, b, sizeof(b)) != Z_NULL)
274 realloc_n_cat(dest, b);
275 gzclose(f);
276 return 1;
277 }
278
279 static int apply_template(struct buffer *dest, struct fmt_ptrn *x, char *arg) {
280 /* This function handles the case where the FMT_PTRN_TEMPLATE modifier is
281 * used.
282 */
283 struct fmt_ptrn f;
284 char b[BUFSIZ];
285 char template_path[PATH_MAX + 1];
286 if (!fmt_ptrn_open(dest->data, &f)) {
287 if (!template_find(template_path, "", dest->data, 0)) {
288 enqueue_parse_errmsg(x, "%s: %ld: template %s does not exist",
289 x->template_path, x->line_num,
290 dest->data);
291 return 0;
292 } else
293 fmt_ptrn_open(template_path, &f);
294 }
295 f.fillers = x->fillers;
296 realloc_n_cpy(dest, "");
297 while(fmt_ptrn_gets(b, sizeof(b), &f) != NULL)
298 realloc_n_cat(dest, b);
299 while (fmt_ptrn_parse_err(&f))
300 /* Copy parse error messages into the main struct fmt_ptrn
301 data structure. */
302 enqueue_parse_errmsg(x, fmt_ptrn_parse_strerror(&f));
303 /* Avoid freeing the stolen fillers: */
304 /* FIXME: need to port to glib:
305 f.fillers.size = 0;
306 f.fillers.root = NULL;
307 */
308 fmt_ptrn_close(&f);
309 return 1;
310 }
+0
-56
src/modifiers.h less more
0 /*=============================================================================
1 modifiers.h
2 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of
7 the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to:
16 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 Boston, MA 02110-1301 USA
18
19 -- For details, see the file named "LICENSE.LGPL2"
20 =============================================================================*/
21 #ifndef PMT_MODIFIERS_H
22 #define PMT_MODIFIERS_H 1
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 #define MODIFIER_ARG_LEN 80
29
30 struct buffer;
31 struct fmt_ptrn;
32
33 struct modifier_info {
34 const char *id;
35 int (*fn)(struct buffer *, struct fmt_ptrn *, char *);
36 int has_arg;
37 };
38
39 struct modifier {
40 struct modifier_info fn;
41 char arg[MODIFIER_ARG_LEN + 1];
42 };
43
44 /*
45 * MODIFIERS.C
46 */
47 extern const struct modifier_info mod_fn[];
48
49 #ifdef __cplusplus
50 } // extern "C"
51 #endif
52
53 #endif // PMT_MODIFIERS_H
54
55 //=============================================================================
00 /*=============================================================================
1 mount.c
1 pam_mount - mount.c
22 Copyright (C) Elvis Pfützenreuter <epx@conectiva.com>, 2000
3 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
3 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2007
44 Copyright © Bastian Kleineidam <calvin [at] debian org>, 2005
55
66 This program is free software; you can redistribute it and/or modify
3030 #include <glib.h>
3131 #include <limits.h>
3232 #include <signal.h>
33 #include <stdbool.h>
3334 #include <stdio.h>
3435 #include <stdlib.h>
3536 #include <string.h>
3637 #include <unistd.h>
38 #include <libHX.h>
3739 #include <pwd.h>
3840 #include "compiler.h"
3941 #include "crypto.h"
40 #include "fmt_ptrn.h"
4142 #include "misc.h"
4243 #include "mount.h"
4344 #include "optlist.h"
4546 #include "private.h"
4647 #include "readconfig.h"
4748 #include "spawn.h"
48 #include "xstdlib.h"
4949 #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
50 # include <fstab.h>
50 # include <fstab.h>
5151 #elif defined(__linux__)
52 # include <mntent.h>
53 # include <sys/ioctl.h>
54 # include <fcntl.h>
55 # include <linux/loop.h>
56 # include <linux/major.h>
52 # include <mntent.h>
53 # include <sys/ioctl.h>
54 # include <fcntl.h>
55 # include <linux/loop.h>
56 # include <linux/major.h>
5757 #endif
58 #ifdef HAVE_LIBCRYPTO
59 # ifndef EVP_MAX_BLOCK_LENGTH
60 # define EVP_MAX_BLOCK_LENGTH 32 // some older openssl versions need this
61 # endif
62 #else
63 # define EVP_MAX_BLOCK_LENGTH 0 // FIXME: this is ugly, but needed
64 #endif
65
66 // Functions
67 static int already_mounted(const struct config * const, const unsigned int, char * const, struct fmt_ptrn *);
68 static int check_filesystem(const struct config *, const unsigned int, struct fmt_ptrn *, const unsigned char *, size_t);
69 static int do_losetup(const struct config *, const unsigned int, struct fmt_ptrn *, const unsigned char *, size_t);
70 static int do_unlosetup(const struct config *, struct fmt_ptrn *);
58
59 /* Functions */
60 static int already_mounted(const struct config * const, const unsigned int, char * const, struct HXbtree *);
61 static int check_filesystem(const struct config *, const unsigned int, struct HXbtree *, const unsigned char *, size_t);
62 static int do_losetup(const struct config *, const unsigned int, struct HXbtree *, const unsigned char *, size_t);
63 static int do_unlosetup(const struct config *, struct HXbtree *);
7164 static int fstype_nodev(const char *);
7265 static void log_output(int);
7366 static void log_pm_input(const struct config * const, const unsigned int);
67 static bool mkmountpoint(struct vol * const, const char * const);
68 static int pipewrite(int, const void *, size_t);
69 static void run_lsof(const struct config * const, struct HXbtree *);
70 static void vol_to_dev(char *, size_t, const struct vol *);
71
72 #ifdef HAVE_STRUCT_LOOP_INFO64_LO_FILE_NAME
7473 static inline const char *loop_bk(const char *, struct loop_info64 *);
75 static int mkmountpoint(struct vol * const, const char * const);
76 static int pipewrite(int, const void *, size_t);
77 static void run_lsof(const struct config * const, struct fmt_ptrn *);
78 static void vol_to_dev(char *, size_t, const struct vol *);
79
74 #endif
8075 #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
8176 static int split_bsd_mount(char *, const char **, const char **, const char **);
8277 #endif
8378
8479 //-----------------------------------------------------------------------------
85 /* log_output
86 @fd: file descriptor to read from
87
88 Reads all data from @fd and logs it using w4rn(). @fd is uaually connected
89 to a pipe to a nother process's stdout or stderr.
90 */
80 /*
81 * log_output
82 * @fd: file descriptor to read from
83 *
84 * Reads all data from @fd and logs it using w4rn(). @fd is uaually connected
85 * to a pipe to another process's stdout or stderr.
86 */
9187 static void log_output(int fd) {
88 char buf[BUFSIZ + 1];
9289 FILE *fp;
93 char buf[BUFSIZ + 1];
90
9491 if ((fp = fdopen(fd, "r")) == NULL) {
95 w4rn(PMPREFIX "error opening file: %s\n", strerror(errno));
92 w4rn("error opening file: %s\n", strerror(errno));
9693 return;
9794 }
98 while(fgets(buf, sizeof(buf), fp) != NULL)
99 w4rn(PMPREFIX "%s", buf);
100 }
101
102
103 /* run_lsof
104 @config: current configuration
105 @vinfo:
106
107 Runs `lsof` on a directory/mountpoint and logs its output, for debugging
108 purposes.
109 */
95
96 setvbuf(fp, NULL, _IOLBF, 0);
97 while (fgets(buf, sizeof(buf), fp) != NULL)
98 w4rn("%s", buf);
99 return;
100 }
101
102 /*
103 * run_lsof
104 * @config: current configuration
105 * @vinfo:
106 *
107 * Runs `lsof` on a directory/mountpoint and logs its output, for debugging
108 * purposes.
109 */
110110 static void run_lsof(const struct config *const config,
111 struct fmt_ptrn *vinfo)
112 {
113 int i, _argc = 0, cstdout = -1, child_exit;
111 struct HXbtree *vinfo)
112 {
113 int _argc = 0, cstdout = -1, child_exit;
114114 const char *_argv[MAX_PAR + 1];
115115 GError *err = NULL;
116 unsigned int i;
116117 pid_t pid;
117 if(config->command[0][LSOF] == NULL)
118 l0g(PMPREFIX "lsof not defined in pam_mount.conf\n");
118
119 if (config->command[CMD_LSOF][0] == NULL)
120 l0g("lsof not defined in pam_mount.conf.xml\n");
119121 /* FIXME: NEW */
120 for(i = 0; config->command[i][LSOF] != NULL; i++)
121 add_to_argv(_argv, &_argc, config->command[i][LSOF], vinfo);
122 for (i = 0; config->command[CMD_LSOF][i] != NULL; ++i)
123 add_to_argv(_argv, &_argc, config->command[CMD_LSOF][i], vinfo);
122124 log_argv(_argv);
123125
124 if(!spawn_apS(NULL, _argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL,
125 &pid, NULL, &cstdout, NULL, &err)) {
126 l0g(PMPREFIX "%s\n", err->message);
126 if (!spawn_apS(NULL, _argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, NULL,
127 NULL, &pid, NULL, &cstdout, NULL, &err)) {
128 l0g("%s\n", err->message);
127129 g_error_free(err);
128130 return;
129131 }
130 w4rn(PMPREFIX "lsof output (should be empty)...\n");
132 w4rn("lsof output (should be empty)...\n");
131133 log_output(cstdout);
132 w4rn(PMPREFIX "waiting for lsof\n");
134 w4rn("waiting for lsof\n");
133135 if (waitpid(pid, &child_exit, 0) == -1)
134 l0g(PMPREFIX "error waiting for child: %s\n", strerror(errno));
135 spawn_restore_sigchld();
136 l0g("error waiting for child: %s\n", strerror(errno));
137 spawn_restore_sigchld();
136138 CLOSE(cstdout);
137 }
138
139
140 /* already_mounted
141 @config: current config
142 @vol: volume index into @config->volume[]
143 @mntpt: destination buffer for current mountpoint
144 @vinfo:
145
146 Checks if @config->volume[@vol] is already mounted, and if so, writes the
147 mountpoint into @mntpt (which must be at least of size %PATH_MAX+1) and
148 returns 1. If the volume is not mounted, returns zero and @mntpt is
149 cleared. Returns -1 on error.
150 */
139 return;
140 }
141
142
143 /* already_mounted
144 * @config: current config
145 * @vol: volume index into @config->volume[]
146 * @mntpt: destination buffer for current mountpoint
147 * @vinfo:
148 *
149 * Checks if @config->volume[@vol] is already mounted, and if so, writes the
150 * mountpoint into @mntpt (which must be at least of size %PATH_MAX+1) and
151 * returns 1. If the volume is not mounted, returns zero and @mntpt is
152 * cleared. Returns -1 on error.
153 */
151154 static int already_mounted(const struct config *const config,
152 const unsigned int vol, char *const mntpt, struct fmt_ptrn *vinfo)
155 const unsigned int vol, char *const mntpt, struct HXbtree *vinfo)
153156 #if defined(__linux__)
154157 {
155 char dev[PATH_MAX+1] = {}, real_mpt[PATH_MAX+1];
156 struct mntent *mtab_record;
157 int mounted = 0;
158 FILE *mtab;
159 struct vol *vpt;
160
161 assert(config_valid(config));
162 vpt = &config->volume[vol];
163 vol_to_dev(dev, sizeof(dev), vpt);
164
165 if((mtab = setmntent("/etc/mtab", "r")) == NULL) {
166 l0g(PMPREFIX "could not open /etc/mtab\n");
167 return -1;
168 }
169 if(realpath(vpt->mountpoint, real_mpt) == NULL) {
170 w4rn(PMPREFIX "can't get realpath of volume %s: %s\n",
171 vpt->mountpoint, strerror(errno));
172 strncpy(real_mpt, vpt->mountpoint, PATH_MAX);
173 real_mpt[PATH_MAX] = '\0';
174 } else {
175 real_mpt[PATH_MAX] = '\0';
176 l0g(PMPREFIX "realpath of volume \"%s\" is \"%s\"\n",
177 vpt->mountpoint, real_mpt);
178 }
179
180 *mntpt = '\0';
181 w4rn(PMPREFIX "checking to see if %s is already mounted at %s\n",
182 dev, vpt->mountpoint);
183
184 while((mtab_record = getmntent(mtab)) != NULL) {
185 const char *fsname = mtab_record->mnt_fsname;
186 const char *fstype = mtab_record->mnt_type;
187 const char *fspt = mtab_record->mnt_dir;
188 int (*xcmp)(const char *, const char *);
189 struct loop_info64 loopdev;
190 struct stat statbuf;
191
192 if(stat(fsname, &statbuf) == 0 && S_ISBLK(statbuf.st_mode) &&
193 major(statbuf.st_rdev) == LOOP_MAJOR)
194 /* If /etc/mtab is a link to /proc/mounts then the loop device
195 instead of the real device will be listed -- resolve it. */
196 fsname = loop_bk(fsname, &loopdev);
197
198 xcmp = (strcmp(fstype, "smbfs") == 0 || strcmp(fstype, "cifs") == 0 ||
199 strcmp(fstype, "ncpfs") == 0) ? strcasecmp : strcmp;
200
201 if(xcmp(fsname, dev) == 0 && (strcmp(fspt, vpt->mountpoint) == 0 ||
202 strcmp(fspt, real_mpt) == 0)) {
203 mounted = 1;
204 strncpy(mntpt, fspt, PATH_MAX);
205 mntpt[PATH_MAX] = '\0';
206 break;
207 }
208 }
209
210 endmntent(mtab);
211 return mounted;
158 char dev[PATH_MAX+1] = {}, real_mpt[PATH_MAX+1];
159 struct mntent *mtab_record;
160 int mounted = 0;
161 FILE *mtab;
162 struct vol *vpt;
163
164 assert(config_valid(config));
165 vpt = &config->volume[vol];
166 vol_to_dev(dev, sizeof(dev), vpt);
167
168 if ((mtab = setmntent("/etc/mtab", "r")) == NULL) {
169 l0g("could not open /etc/mtab\n");
170 return -1;
171 }
172 if (realpath(vpt->mountpoint, real_mpt) == NULL) {
173 w4rn("can't get realpath of volume %s: %s\n",
174 vpt->mountpoint, strerror(errno));
175 strncpy(real_mpt, vpt->mountpoint, sizeof_z(real_mpt));
176 real_mpt[sizeof_z(real_mpt)] = '\0';
177 } else {
178 real_mpt[sizeof_z(real_mpt)] = '\0';
179 l0g("realpath of volume \"%s\" is \"%s\"\n",
180 vpt->mountpoint, real_mpt);
181 }
182
183 *mntpt = '\0';
184 w4rn("checking to see if %s is already mounted at %s\n",
185 dev, vpt->mountpoint);
186
187 while ((mtab_record = getmntent(mtab)) != NULL) {
188 const char *fsname = mtab_record->mnt_fsname;
189 const char *fstype = mtab_record->mnt_type;
190 const char *fspt = mtab_record->mnt_dir;
191 int (*xcmp)(const char *, const char *);
192 struct loop_info64 loopdev;
193 struct stat statbuf;
194
195 #ifdef HAVE_STRUCT_LOOP_INFO64_LO_FILE_NAME
196 if (stat(fsname, &statbuf) == 0 && S_ISBLK(statbuf.st_mode) &&
197 major(statbuf.st_rdev) == LOOP_MAJOR)
198 /*
199 * If /etc/mtab is a link to /proc/mounts then the loop
200 * device instead of the real device will be listed --
201 * resolve it.
202 */
203 fsname = loop_bk(fsname, &loopdev);
204 #endif
205
206 xcmp = (strcmp(fstype, "smbfs") == 0 ||
207 strcmp(fstype, "cifs") == 0 ||
208 strcmp(fstype, "ncpfs") == 0) ? strcasecmp : strcmp;
209
210 if (xcmp(fsname, dev) == 0 &&
211 (strcmp(fspt, vpt->mountpoint) == 0 ||
212 strcmp(fspt, real_mpt) == 0)) {
213 mounted = 1;
214 strncpy(mntpt, fspt, PATH_MAX);
215 mntpt[PATH_MAX] = '\0';
216 break;
217 }
218 }
219
220 endmntent(mtab);
221 return mounted;
212222 }
213223 #elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
214224 {
215 char *_argv[MAX_PAR + 1], dev[PATH_MAX+1] = {}, mte[BUFSIZ + 1];
216 int i, _argc = 0, cstdout = -1, mounted = 0;
217 GError *err = NULL;
218 struct vol *vpt;
219 pid_t pid;
220 FILE *fp;
221
222 assert(config_valid(config));
223 vpt = &config->volume[vol];
224 vol_to_dev(dev, sizeof(dev), vpt);
225
226 // FIXME: I am not overly fond of using mount, but BSD has no /etc/mtab?
227 // "WONTFIX" I would say, eh?
228 if(config->command[0][MNTCHECK] == NULL) {
229 l0g(PMPREFIX "mntcheck not defined in pam_mount.conf\n");
230 return -1;
231 }
232
233 for(i = 0; config->command[i][MNTCHECK] != NULL; ++i)
234 add_to_argv(_argv, &_argc, config->command[i][MNTCHECK], vinfo);
235
236 log_argv(_argv);
237
238 // FIXME: replace by popen() if available on BSD
239 if(!spawn_apS(NULL, _argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL,
240 &pid, NULL, &cstdout, NULL, &err)) {
241 l0g(PMPREFIX "%s\n", err->message);
242 g_error_free(err);
243 return -1;
244 }
245
246 fp = fdopen(cstdout, "r");
247 while(fgets(mte, sizeof(mte), fp) != NULL) {
248 // FIXME: Test it.
249 int (*xcmp)(const char *, const char *);
250 const char *fsname, *fstype, *fspt;
251
252 w4rn(PMPREFIX "mounted filesystem: %s", mte); // @mte includes '\n'
253 if(!split_bsd_mount(mte, &fsname, &fspt, &fstype)) {
254 mounted = -1;
255 break;
256 }
257
258 // Use case-insensitive for SMB, etc.
259 // FIXME: Is it called "smbfs" under BSD too?
260 xcmp = (fstype != NULL &&
261 (strcmp(fstype, "smbfs") == 0 || strcmp(fstype, "cifs") == 0 ||
262 strcmp(fstype, "ncpfs") == 0)) ? strcasecmp : strcmp;
263
264 /* FIXME: Does BSD also turn "symlink mountpoints" into
265 "real mountpoints"? */
266 if(xcmp(fsname, dev) == 0 && strcmp(fspt, vpt->mountpoint) == 0) {
267 mounted = 1;
268 strncpy(mntpt, fspt, PATH_MAX);
269 mntpt[PATH_MAX] = '\0';
270 break;
271 }
272 }
273
274 fclose(fp); // automatically closes cstdout, too
275 if(waitpid(pid, NULL, 0) != 0)
276 l0g(PMPREFIX "error waiting for child: %s\n", strerror(errno));
277 spawn_restore_sigchld();
278 return mounted;
225 char *_argv[MAX_PAR + 1], dev[PATH_MAX+1] = {}, mte[BUFSIZ + 1];
226 int i, _argc = 0, cstdout = -1, mounted = 0;
227 GError *err = NULL;
228 struct vol *vpt;
229 pid_t pid;
230 FILE *fp;
231
232 assert(config_valid(config));
233 vpt = &config->volume[vol];
234 vol_to_dev(dev, sizeof(dev), vpt);
235
236 /*
237 * WONTFIX: I am not overly fond of using mount, but BSD has no
238 * /etc/mtab?
239 */
240 if (config->command[0][CMD_MNTCHECK] == NULL) {
241 l0g("mntcheck not defined in pam_mount.conf.xml\n");
242 return -1;
243 }
244
245 for (i = 0; config->command[i][CMD_MNTCHECK] != NULL; ++i)
246 add_to_argv(_argv, &_argc, config->command[i][CMD_MNTCHECK],
247 vinfo);
248 log_argv(_argv);
249
250 /* FIXME: replace by popen() if available on BSD */
251 if (!spawn_apS(NULL, _argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, NULL,
252 NULL, &pid, NULL, &cstdout, NULL, &err)) {
253 l0g("%s\n", err->message);
254 g_error_free(err);
255 return -1;
256 }
257
258 fp = fdopen(cstdout, "r");
259 while (fgets(mte, sizeof(mte), fp) != NULL) {
260 /* FIXME: Test it. */
261 int (*xcmp)(const char *, const char *);
262 const char *fsname, *fstype, *fspt;
263
264 w4rn("mounted filesystem: %s", mte); /* @mte includes '\n' */
265 if (!split_bsd_mount(mte, &fsname, &fspt, &fstype)) {
266 mounted = -1;
267 break;
268 }
269
270 /*
271 * Use case-insensitive for SMB, etc. FIXME: Is it called
272 * "smbfs" under BSD too?
273 */
274 xcmp = (fstype != NULL && (strcmp(fstype, "smbfs") == 0 ||
275 strcmp(fstype, "cifs") == 0 ||
276 strcmp(fstype, "ncpfs") == 0)) ? strcasecmp : strcmp;
277
278 /*
279 * FIXME: Does BSD also turn "symlink mountpoints" into "real
280 * mountpoints"?
281 */
282 if (xcmp(fsname, dev) == 0 &&
283 strcmp(fspt, vpt->mountpoint) == 0) {
284 mounted = 1;
285 strncpy(mntpt, fspt, PATH_MAX);
286 mntpt[PATH_MAX] = '\0';
287 break;
288 }
289 }
290
291 fclose(fp); /* automatically closes @cstdout */
292 if (waitpid(pid, NULL, 0) != 0)
293 l0g("error waiting for child: %s\n", strerror(errno));
294 spawn_restore_sigchld();
295 return mounted;
279296 }
280297 #else
281298 {
282 // FIXME
283 l0g(PMPREFIX "check for previous mount not implemented on arch.\n");
284 return -1;
299 l0g("check for previous mount not implemented on arch.\n");
300 return -1;
285301 }
286302 #endif
287303
288
289 /* vol_to_dev
290 @match:
291 @s:
292 @vol: volume to analyze
293
294 */
295 static void vol_to_dev(char *match, size_t s, const struct vol *vol) {
296 switch(vol->type) {
297 case SMBMOUNT:
298 case CIFSMOUNT:
299 snprintf(match, s, "//%s/%s", vol->server, vol->volume);
300 break;
301
302 case NCPMOUNT:
303 /* FIXME: volume sanity check in readconfig.c ensures
304 optlist_value() will not return NULL for user.
305 [JE] So what to fix? */
306 snprintf(match, s, "%s/%s", vol->server,
307 optlist_value(vol->options, "user"));
308 break;
309
310 case NFSMOUNT:
311 snprintf(match, s, "%s:%s", vol->server, vol->volume);
312 break;
313
314 case CRYPTMOUNT: {
315 /* FIXME: ugly hack to support umount.crypt script. I hope that
316 util-linux will have native dm_crypt support some day. */
317 char *wp = match + sizeof("/dev/mapper/")-1;
318 snprintf(match, s, "/dev/mapper/%s", vol->volume);
319 while((wp = strchr(wp, '/')) != NULL)
320 *wp = '_';
321 break;
322 }
323
324 default:
325 strncpy(match, vol->volume, s-1);
326 match[s-1] = '\0';
327 break;
328 }
329 return;
304 /*
305 * vol_to_dev
306 * @match:
307 * @s:
308 * @vol: volume to analyze
309 */
310 static void vol_to_dev(char *match, size_t s, const struct vol *vol)
311 {
312 switch (vol->type) {
313 case CMD_SMBMOUNT:
314 case CMD_CIFSMOUNT:
315 snprintf(match, s, "//%s/%s", vol->server, vol->volume);
316 break;
317
318 case CMD_NCPMOUNT:
319 snprintf(match, s, "%s/%s", vol->server,
320 optlist_value(vol->options, "user"));
321 break;
322
323 case CMD_NFSMOUNT:
324 snprintf(match, s, "%s:%s", vol->server, vol->volume);
325 break;
326
327 case CMD_CRYPTMOUNT: {
328 /*
329 * FIXME: ugly hack to support umount.crypt script. I hope that
330 * util-linux will have native dm_crypt support some day.
331 */
332 char *wp = match + sizeof_z("/dev/mapper/");
333 snprintf(match, s, "/dev/mapper/%s", vol->volume);
334 while ((wp = strchr(wp, '/')) != NULL)
335 *wp = '_';
336 break;
337 }
338
339 default:
340 strncpy(match, vol->volume, s-1);
341 match[s-1] = '\0';
342 break;
343 }
344 return;
330345 }
331346
332347 #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
333348 static int split_bsd_mount(char *wp, const char **fsname, const char **fspt,
334 const char **fstype)
335 {
336 /* mntcheck is currently defined as "/bin/mount" in pam_mount.conf so
337 a line is like "/dev/ad0s1 on / (ufs, local)". */
338
339 *fsname = wp;
340 if((wp = strchr(wp, ' ')) == NULL) return 0; // parse error
341
342 // wp now at " on ..."
343 *wp++ = '\0';
344 if((wp = strchr(wp, ' ')) == NULL) return 0;
345
346 // wp now at " fspt"
347 *fspt = ++wp;
348 if((wp = strchr(wp, ' ')) == NULL) return 0;
349
350 // wp now at " (fstype, local?, options)"
351 *wp++ = '\0';
352 *fstype = ++wp;
353 while(isalnum(*wp)) ++wp;
354 *wp = '\0';
355
356 return 1;
349 const char **fstype)
350 {
351 /*
352 * mntcheck is currently defined as "/bin/mount" in pam_mount.conf.xml
353 * so a line that we read is going to look like
354 * "/dev/ad0s1 on / (ufs, local)".
355 */
356
357 *fsname = wp;
358 if ((wp = strchr(wp, ' ')) == NULL) /* parse error */
359 return 0;
360
361 /* @wp now at " on ..." */
362 *wp++ = '\0';
363 if ((wp = strchr(wp, ' ')) == NULL)
364 return 0;
365
366 /* wp now at " fspt" */
367 *fspt = ++wp;
368 if ((wp = strchr(wp, ' ')) == NULL)
369 return 0;
370
371 /* wp now at " (fstype, local?, options)" */
372 *wp++ = '\0';
373 *fstype = ++wp;
374 while (isalnum(*wp))
375 ++wp;
376 *wp = '\0';
377
378 return 1;
357379 }
358380 #endif
359381
360 /* ============================ log_pm_input () ============================ */
361382 static void log_pm_input(const struct config *const config,
362 const unsigned int vol)
363 {
364 const struct vol *vpt = &config->volume[vol];
383 const unsigned int vol)
384 {
385 const struct vol *vpt = &config->volume[vol];
365386 char options[MAX_PAR + 1];
366387
367 w4rn(PMPREFIX "information for mount:\n");
368 w4rn(PMPREFIX "----------------------\n");
369 w4rn(PMPREFIX "%s\n",
370 vpt->globalconf ? "(defined by globalconf)"
371 : "(defined by luserconf)");
372 w4rn(PMPREFIX "user: %s\n", vpt->user);
373 w4rn(PMPREFIX "server: %s\n", vpt->server);
374 w4rn(PMPREFIX "volume: %s\n", vpt->volume);
375 w4rn(PMPREFIX "mountpoint: %s\n", vpt->mountpoint);
376 w4rn(PMPREFIX "options: %s\n", optlist_to_str(options, vpt->options));
377 w4rn(PMPREFIX "fs_key_cipher: %s\n", vpt->fs_key_cipher);
378 w4rn(PMPREFIX "fs_key_path: %s\n", vpt->fs_key_path);
379 w4rn(PMPREFIX "use_fstab: %d\n", vpt->use_fstab);
380 w4rn(PMPREFIX "----------------------\n");
381 return;
382 }
383
384 /* ============================ mkmountpoint () ============================ */
385 /* POST: the directory named d exists && volume->created_mntpt = TRUE
386 * FN VAL: if error 0 else 1, errors are logged
387 */
388 static int mkmountpoint(struct vol *const volume, const char *const d) {
389 int ret = 1;
388 w4rn("information for mount:\n");
389 w4rn("----------------------\n");
390 w4rn("(defined by %s)\n", vpt->globalconf ? "globalconf" : "luserconf");
391 w4rn("user: %s\n", vpt->user);
392 w4rn("server: %s\n", vpt->server);
393 w4rn("volume: %s\n", vpt->volume);
394 w4rn("mountpoint: %s\n", vpt->mountpoint);
395 w4rn("options: %s\n", optlist_to_str(options, vpt->options));
396 w4rn("fs_key_cipher: %s\n", vpt->fs_key_cipher);
397 w4rn("fs_key_path: %s\n", vpt->fs_key_path);
398 w4rn("use_fstab: %d\n", vpt->use_fstab);
399 w4rn("----------------------\n");
400 return;
401 }
402
403 /*
404 * mkmountpoint_real - create mountpoint directory
405 * @volume: volume description
406 * @d: directory
407 *
408 * If the directory @d does not exist, create it and all its parents if
409 * @volume->created_mntpt = true. On success, returns 1, otherwise 0.
410 */
411 static bool mkmountpoint_real(struct vol *const volume, const char *const d)
412 {
413 bool ret = true;
390414 struct passwd *passwd_ent;
391415 char dcopy[PATH_MAX + 1], *parent;
392416
393417 assert(vol_valid(volume));
394418 assert(d != NULL);
395419
396 w4rn(PMPREFIX "creating mount point %s\n", d);
397 strncpy(dcopy, d, sizeof(dcopy) - 1);
398 dcopy[PATH_MAX] = '\0';
420 w4rn("creating mount point %s\n", d);
421 strncpy(dcopy, d, sizeof_z(dcopy));
422 dcopy[sizeof_z(dcopy)] = '\0';
399423 parent = g_path_get_dirname(dcopy);
400 if(!exists(parent) && mkmountpoint(volume, parent) == 0) {
401 ret = 0;
402 goto _return;
403 }
404 if((passwd_ent = getpwnam(volume->user)) != NULL) {
405 if (mkdir(d, 0700) != 0) {
406 l0g(PMPREFIX "tried to create %s but failed\n",
407 d);
408 ret = 0;
409 goto _return;
410 }
411 if(chown(d, passwd_ent->pw_uid, passwd_ent->pw_gid) != 0) {
412 l0g(PMPREFIX "could not chown %s to %s\n",
413 d, volume->user);
414 ret = 0;
415 goto _return;
424 if (!exists(parent) && mkmountpoint(volume, parent) == 0) {
425 ret = false;
426 goto out;
427 }
428 if ((passwd_ent = getpwnam(volume->user)) != NULL) {
429 if (mkdir(d, 0700) < 0) {
430 l0g("tried to create %s but failed\n", d);
431 ret = false;
432 goto out;
433 }
434 if (chown(d, passwd_ent->pw_uid, passwd_ent->pw_gid) < 0) {
435 l0g("could not chown %s to %s\n", d, volume->user);
436 ret = false;
437 goto out;
416438 }
417439 } else {
418 l0g(PMPREFIX "could not determine uid from %s to make %s\n", volume->user, d);
419 ret = 0;
420 goto _return;
421 }
422 volume->created_mntpt = TRUE;
423 _return:
440 l0g("could not determine uid from %s to make %s\n", volume->user, d);
441 ret = false;
442 goto out;
443 }
444 volume->created_mntpt = true;
445 out:
424446 free(parent);
425447 return ret;
426448 }
427449
450 /*
451 * mkmountpoint - create mountpoint for volume
452 * @volume: volume structure
453 * @d: directory to create
454 *
455 * Switches to the volume user's identity and see if we can create the
456 * mountpoint. This is required for NFS mounts with root_squash enabled
457 * (assuming the mountpoint's parent is writable by the user, e.g. if it is
458 * inside the user's home directory).
459 *
460 * If that fails, do as usual (create as root, chown to user).
461 */
462 static bool mkmountpoint(struct vol *volume, const char *d)
463 {
464 struct passwd *pe;
465
466 if ((pe = getpwnam(volume->user)) == NULL) {
467 l0g("getpwuid: %s\n", strerror(errno));
468 return false;
469 }
470
471 if (seteuid(pe->pw_uid) == 0)
472 if (mkmountpoint_real(volume, d))
473 return true;
474
475 seteuid(0);
476 return mkmountpoint_real(volume, d);
477 }
478
479 /*
480 * do_unmount
481 * @config: current config
482 * @vol: volume index into @config->vol[]
483 * @vinfo:
484 * @password: always %NULL
485 *
486 * Returns zero on error, positive non-zero for success.
487 */
428488 int do_unmount(const struct config *config, const unsigned int vol,
429 struct fmt_ptrn *vinfo, const char *const password, const bool mkmntpoint)
430 {
431 /* PRE: config points to a valid struct config
432 * config->volume[vol] is a valid struct vol
433 * vinfo is a valid struct fmt_ptrn
434 * mkmntpoint is true if mount point should be rmdir'ed
435 * POST: volume is unmounted
436 * FN VAL: if error 0 else 1, errors are logged
437 */
489 struct HXbtree *vinfo, const char *const password)
490 {
438491 GError *err = NULL;
439 int i, child_exit, _argc = 0, ret = 1, cstderr = -1;
492 int child_exit, _argc = 0, ret = 1, cstderr = -1;
440493 pid_t pid = -1;
441494 const char *_argv[MAX_PAR + 1];
442 const struct vol *vpt;
443 int type;
495 const struct vol *vpt;
496 unsigned int i;
497 int type;
444498
445499 assert(config_valid(config));
446500 assert(vinfo != NULL);
447501 assert(password == NULL); /* password should point to NULL for unmounting */
448502
449 vpt = &config->volume[vol];
450
451 if(Debug)
503 vpt = &config->volume[vol];
504
505 if (Debug)
452506 /*
453507 * Often, a process still exists with ~ as its pwd after
454508 * logging out. Running lsof helps debug this.
455509 */
456510 run_lsof(config, vinfo);
457511
458 switch(vpt->type) {
459 case SMBMOUNT: type = SMBUMOUNT; break;
460 case NCPMOUNT: type = NCPUMOUNT; break;
461 case FUSEMOUNT: type = FUSEUMOUNT; break;
462 default: type = UMOUNT; break;
463 }
464
465 if(config->command[0][type] == NULL)
466 l0g(PMPREFIX "{smb,ncp}umount not defined in pam_count.conf\n");
467
468 for(i = 0; config->command[i][type] != NULL; ++i)
469 add_to_argv(_argv, &_argc, config->command[i][type], vinfo);
470
471 /* FIXME: ugly hack to support umount.crypt script. I hope that
472 * util-linux will have native dm_crypt support some day */
473 if(vpt->type == CRYPTMOUNT) {
512 switch (vpt->type) {
513 case CMD_SMBMOUNT:
514 type = CMD_SMBUMOUNT;
515 break;
516 case CMD_NCPMOUNT:
517 type = CMD_NCPUMOUNT;
518 break;
519 case CMD_FUSEMOUNT:
520 type = CMD_FUSEUMOUNT;
521 break;
522 case CMD_TRUECRYPTMOUNT:
523 type = CMD_TRUECRYPTUMOUNT;
524 break;
525 default:
526 type = CMD_UMOUNT;
527 break;
528 }
529
530 if (config->command[type][0] == NULL)
531 l0g("{smb,ncp}umount not defined in pam_count.conf.xml\n");
532
533 for (i = 0; config->command[type][i] != NULL; ++i)
534 add_to_argv(_argv, &_argc, config->command[type][i], vinfo);
535
536 /*
537 * FIXME: ugly hack to support umount.crypt script. I hope that
538 * util-linux will have native dm_crypt support some day.
539 */
540 if (vpt->type == CMD_CRYPTMOUNT) {
474541 _argc = 0;
475542 add_to_argv(_argv, &_argc, "/sbin/umount.crypt", vinfo);
476543 add_to_argv(_argv, &_argc, "%(MNTPT)", vinfo);
477544 }
478545 log_argv(_argv);
479 if(!spawn_apS(NULL, _argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, set_myuid,
480 NULL, &pid, NULL, NULL, &cstderr, &err)) {
481 l0g(PMPREFIX "%s\n", err->message);
546 if (!spawn_apS(NULL, _argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, set_myuid,
547 NULL, &pid, NULL, NULL, &cstderr, &err)) {
548 l0g("%s\n", err->message);
482549 g_error_free(err);
483550 ret = 0;
484 goto _return;
485 }
486 w4rn(PMPREFIX "umount errors (should be empty):\n");
551 goto out;
552 }
553 w4rn("umount errors (should be empty):\n");
487554 log_output(cstderr);
488555 CLOSE(cstderr);
489 w4rn(PMPREFIX "waiting for umount\n");
490 if (waitpid(pid, &child_exit, 0) == -1) {
491 l0g(PMPREFIX "error waiting for child: %s\n", strerror(errno));
556 w4rn("waiting for umount\n");
557 if (waitpid(pid, &child_exit, 0) < 0) {
558 l0g("error waiting for child: %s\n", strerror(errno));
492559 ret = 0;
493 goto _return;
560 goto out;
494561 } else {
495562 /* pass on through the result from the umount process */
496563 ret = !WEXITSTATUS(child_exit);
497564 }
498 _return:
499 spawn_restore_sigchld();
500 if(mkmntpoint != 0 && vpt->created_mntpt &&
501 rmdir(vpt->mountpoint) == -1) /* non-fatal */
502 w4rn(PMPREFIX "could not remove %s\n", vpt->mountpoint);
565 out:
566 spawn_restore_sigchld();
567 if (config->mkmntpoint && config->rmdir_mntpt && vpt->created_mntpt)
568 if (rmdir(vpt->mountpoint) < 0)
569 /* non-fatal, but warn */
570 w4rn("could not remove %s\n", vpt->mountpoint);
503571 return ret;
504572 }
505573
508576 * OUTPUT: number of bytes written or 0 on error
509577 * NOTE: SIGPIPE is ignored during this operation to avoid "broken pipe"
510578 */
511 static int pipewrite(int fd, const void *buf, size_t count) {
579 static int pipewrite(int fd, const void *buf, size_t count)
580 {
581 struct sigaction ignoresact = {.sa_handler = SIG_IGN}, oldsact;
512582 int fnval;
513 struct sigaction ignoresact = {.sa_handler = SIG_IGN}, oldsact;
514583
515584 assert(fd >= 0);
516585 assert(buf != NULL);
517586 assert(count >= 0);
518587
519588 /* avoid bomb on command exiting before data written */
520 sigemptyset(&ignoresact.sa_mask);
521 if(sigaction(SIGPIPE, &ignoresact, &oldsact) == -1) {
589 sigemptyset(&ignoresact.sa_mask);
590 if (sigaction(SIGPIPE, &ignoresact, &oldsact) < 0) {
522591 fnval = -1;
523 goto _return;
592 goto out;
524593 }
525594 fnval = write(fd, buf, count);
526595 /* restore old handler */
527 if(sigaction(SIGPIPE, &oldsact, NULL) == -1) {
596 if (sigaction(SIGPIPE, &oldsact, NULL) < 0) {
528597 fnval = -1;
529 goto _return;
530 }
531 _return:
598 goto out;
599 }
600 out:
532601 return fnval;
533602 }
534603
535604 static int do_losetup(const struct config *config, const unsigned int vol,
536 struct fmt_ptrn *vinfo, const unsigned char *password, size_t password_len)
605 struct HXbtree *vinfo, const unsigned char *password, size_t password_len)
537606 {
538607 /* PRE: config points to a valid struct config
539608 * config->volume[vol] is a valid struct vol
540 * vinfo is a valid struct fmt_ptrn
541609 * config->volume[vol].options is valid
542610 * POST: volume has associated with a loopback device
543611 * FN VAL: if error 0 else 1, errors are logged
544612 */
545613 pid_t pid;
546614 GError *err = NULL;
547 int i, ret = 1, child_exit, _argc = 0, cstdin = -1, cstderr = -1;
615 int ret = 1, child_exit, _argc = 0, cstdin = -1, cstderr = -1;
548616 const char *_argv[MAX_PAR + 1];
549 const char *cipher, *keybits;
550 const struct vol *vpt;
617 const char *cipher, *keybits;
618 const struct vol *vpt;
619 unsigned int i;
551620
552621 assert(config_valid(config));
553622 assert(vinfo != NULL);
555624 /* password_len is unsigned */
556625 assert(password_len <= MAX_PAR + EVP_MAX_BLOCK_LENGTH);
557626
558 vpt = &config->volume[vol];
559 cipher = optlist_value(vpt->options, "encryption");
560 keybits = optlist_value(vpt->options, "keybits");
561
562 if(config->command[0][LOSETUP] == NULL) {
563 l0g(PMPREFIX "losetup not defined in pam_mount.conf\n");
627 vpt = &config->volume[vol];
628 cipher = optlist_value(vpt->options, "encryption");
629 keybits = optlist_value(vpt->options, "keybits");
630
631 if (config->command[CMD_LOSETUP][0] == NULL) {
632 l0g("losetup not defined in pam_mount.conf.xml\n");
564633 return 0;
565634 }
566635 /* FIXME: support OpenBSD */
567636 /* FIXME: NEW */
568 if(cipher != NULL) {
569 fmt_ptrn_update_kv(vinfo, "CIPHER", cipher);
570 if(keybits != NULL)
571 fmt_ptrn_update_kv(vinfo, "KEYBITS", keybits);
572 }
573 for(i = 0; config->command[i][LOSETUP] != NULL; ++i)
574 add_to_argv(_argv, &_argc, config->command[i][LOSETUP], vinfo);
637 if (cipher != NULL) {
638 format_add(vinfo, "CIPHER", cipher);
639 if (keybits != NULL)
640 format_add(vinfo, "KEYBITS", keybits);
641 }
642 for (i = 0; config->command[CMD_LOSETUP][i] != NULL; ++i)
643 add_to_argv(_argv, &_argc,
644 config->command[CMD_LOSETUP][i], vinfo);
575645
576646 log_argv(_argv);
577 if(!spawn_apS(NULL, _argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, set_myuid,
578 NULL, &pid, &cstdin, NULL, &cstderr, &err)) {
579 l0g(PMPREFIX "%s\n", err->message);
647 if (!spawn_apS(NULL, _argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, set_myuid,
648 NULL, &pid, &cstdin, NULL, &cstderr, &err)) {
649 l0g("%s\n", err->message);
580650 g_error_free(err);
581 return 0;
582 }
583
584 // note to self: password is decrypted
585 if(pipewrite(cstdin, password, password_len) != password_len) {
586 l0g(PMPREFIX "error sending password to losetup\n");
587 ret = 0;
588 }
589 CLOSE(cstdin);
590 w4rn(PMPREFIX "losetup errors (should be empty):\n");
651 return 0;
652 }
653
654 /* note to self: password is decrypted */
655 if (pipewrite(cstdin, password, password_len) != password_len) {
656 l0g("error sending password to losetup\n");
657 ret = 0;
658 }
659 CLOSE(cstdin);
660 w4rn("losetup errors (should be empty):\n");
591661
592662 log_output(cstderr);
593663 CLOSE(cstderr);
594 w4rn(PMPREFIX "waiting for losetup\n");
595 if (waitpid(pid, &child_exit, 0) == -1) {
596 l0g(PMPREFIX "error waiting for child: %s\n", strerror(errno));
664 w4rn("waiting for losetup\n");
665 if (waitpid(pid, &child_exit, 0) < 0) {
666 l0g("error waiting for child: %s\n", strerror(errno));
597667 ret = 0;
598 } else if(ret > 0) {
668 } else if (ret > 0) {
599669 /* pass on through the result from the losetup process */
600670 ret = !WEXITSTATUS(child_exit);
601671 }
602 spawn_restore_sigchld();
672 spawn_restore_sigchld();
603673 return ret;
604674 }
605675
606 static int do_unlosetup(const struct config *config, struct fmt_ptrn *vinfo) {
676 static int do_unlosetup(const struct config *config, struct HXbtree *vinfo)
677 {
607678 /* PRE: config points to a valid struct config
608 * vinfo is a valid struct fmt_ptrn
609679 * POST: volume has associated with a loopback device
610680 * FN VAL: if error 0 else 1, errors are logged
611681 */
612682 pid_t pid;
613683 GError *err = NULL;
614684 const char *_argv[MAX_PAR + 1];
615 int i, child_exit, _argc = 0;
685 int child_exit, _argc = 0;
686 unsigned int i;
616687
617688 assert(config_valid(config));
618689 assert(vinfo != NULL);
619690
620 if(config->command[0][UNLOSETUP] == NULL) {
621 l0g(PMPREFIX "unlosetup not defined in pam_mount.conf\n");
691 if (config->command[CMD_UNLOSETUP][0] == NULL) {
692 l0g("unlosetup not defined in pam_mount.conf.xml\n");
622693 return 0;
623694 }
624695 /* FIXME: support OpenBSD */
625696 /* FIXME: NEW */
626 for(i = 0; config->command[i][UNLOSETUP] != NULL; i++)
697 for (i = 0; config->command[CMD_UNLOSETUP][i] != NULL; ++i)
627698 add_to_argv(_argv, &_argc,
628 config->command[i][UNLOSETUP], vinfo);
699 config->command[CMD_UNLOSETUP][i], vinfo);
629700 log_argv(_argv);
630 if(!spawn_apS(NULL, _argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL,
631 &pid, NULL, NULL, NULL, &err)) {
632 l0g(PMPREFIX "%s\n", err->message);
701 if (!spawn_apS(NULL, _argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, NULL,
702 NULL, &pid, NULL, NULL, NULL, &err)) {
703 l0g("%s\n", err->message);
633704 g_error_free(err);
634705 return 0;
635706 }
636 w4rn(PMPREFIX "waiting for losetup delete\n");
637 if(waitpid(pid, &child_exit, 0) != 0)
638 l0g(PMPREFIX "error waiting for child: %s\n", strerror(errno));
639 spawn_restore_sigchld();
707 w4rn("waiting for losetup delete\n");
708 if (waitpid(pid, &child_exit, 0) < 0)
709 l0g("error waiting for child: %s\n", strerror(errno));
710 spawn_restore_sigchld();
640711 /* pass on through the result */
641712 return !WEXITSTATUS(child_exit);
642713 }
643714
644715 static int check_filesystem(const struct config *config, const unsigned int vol,
645 struct fmt_ptrn *vinfo, const unsigned char *password, size_t password_len)
716 struct HXbtree *vinfo, const unsigned char *password, size_t password_len)
646717 {
647718 /* PRE: config points to a valid struct config
648719 * config->volume[vol] is a valid struct vol
649 * vinfo is a valid struct fmt_ptrn
650720 * POST: integrity of volume has been checked
651721 * FN VAL: if error 0 else 1, errors are logged
652722 */
653723 #if defined (__linux__)
654724 pid_t pid;
655725 GError *err = NULL;
656 int i, child_exit, _argc = 0, cstdout = -1, cstderr = -1;
726 int child_exit, _argc = 0, cstdout = -1, cstderr = -1;
657727 const char *_argv[MAX_PAR + 1];
658 char options[MAX_PAR + 1];
659 const char *fsck_target;
660 const struct vol *vpt;
728 char options[MAX_PAR + 1];
729 const char *fsck_target;
730 const struct vol *vpt;
731 unsigned int i;
661732
662733 assert(config_valid(config));
663734 assert(vinfo != NULL);
664735 assert(password != NULL);
665 assert(password_len >= 0
666 && password_len <= MAX_PAR + EVP_MAX_BLOCK_LENGTH);
667
668 vpt = &config->volume[vol];
669 fsck_target = vpt->volume;
670
671 if(config->command[0][FSCK] == NULL) {
672 l0g(PMPREFIX "fsck not defined in pam_mount.conf\n");
736 assert(password_len >= 0 &&
737 password_len <= MAX_PAR + EVP_MAX_BLOCK_LENGTH);
738
739 vpt = &config->volume[vol];
740 fsck_target = vpt->volume;
741
742 if (config->command[CMD_FSCK][0] == NULL) {
743 l0g("fsck not defined in pam_mount.conf.xml\n");
673744 return 0;
674745 }
675746
676 if(optlist_exists(vpt->options, "bind") ||
677 optlist_exists(vpt->options, "move") ||
678 fstype_nodev(vpt->fstype) != 0)
679 return 1;
747 if (optlist_exists(vpt->options, "bind") ||
748 optlist_exists(vpt->options, "move") ||
749 fstype_nodev(vpt->fstype) != 0)
750 return 1;
680751
681752 if (optlist_exists(vpt->options, "loop")) {
682 if(!do_losetup(config, vol, vinfo, password, password_len))
753 if (!do_losetup(config, vol, vinfo, password, password_len))
683754 return 0;
684755 fsck_target = config->fsckloop;
685 } else
686 w4rn(PMPREFIX "volume not a loopback (options: %s)\n",
756 } else {
757 w4rn("volume not a loopback (options: %s)\n",
687758 optlist_to_str(options, vpt->options));
759 }
688760 /* FIXME: NEW */
689761 /* FIXME: need to fsck /dev/mapper/whatever... */
690 fmt_ptrn_update_kv(vinfo, "FSCKTARGET", fsck_target);
691 for (i = 0; config->command[i][FSCK]; i++)
692 add_to_argv(_argv, &_argc, config->command[i][FSCK], vinfo);
762 format_add(vinfo, "FSCKTARGET", fsck_target);
763 for (i = 0; config->command[CMD_FSCK][i]; ++i)
764 add_to_argv(_argv, &_argc, config->command[CMD_FSCK][i], vinfo);
693765
694766 log_argv(_argv);
695 if(!spawn_apS(NULL, _argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL,
696 &pid, NULL, &cstdout, &cstderr, &err)) {
697 l0g(PMPREFIX "%s\n", err->message);
767 if (!spawn_apS(NULL, _argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, NULL,
768 NULL, &pid, NULL, &cstdout, &cstderr, &err)) {
769 l0g("%s\n", err->message);
698770 g_error_free(err);
699771 return 0;
700772 }
701 log_output(cstdout); /* stdout and stderr most be logged for fsck */
773 log_output(cstdout); /* stdout and stderr must be logged for fsck */
702774 log_output(cstderr);
703775 CLOSE(cstderr);
704 w4rn(PMPREFIX "waiting for filesystem check\n");
705 if(waitpid(pid, &child_exit, 0) != 0)
706 l0g(PMPREFIX "error waiting for child: %s\n", strerror(errno));
707 spawn_restore_sigchld();
708 if(optlist_exists(vpt->options, "loop"))
776 w4rn("waiting for filesystem check\n");
777 if (waitpid(pid, &child_exit, 0) < 0)
778 l0g("error waiting for child: %s\n", strerror(errno));
779 spawn_restore_sigchld();
780 if (optlist_exists(vpt->options, "loop"))
709781 if (!do_unlosetup(config, vinfo))
710782 return 0;
711 /* pass on through the result -- okay if 0 (no errors)
712 * or 1 (errors corrected) */
783 /*
784 * pass on through the result -- okay if 0 (no errors) or 1 (errors
785 * corrected)
786 */
713787 return WEXITSTATUS(child_exit) == 0 || WEXITSTATUS(child_exit) == 1;
714788 #else
715 l0g(PMPREFIX "checking filesystem not implemented on arch.\n");
789 l0g("checking filesystem not implemented on arch.\n");
716790 return 1;
717791 #endif
718792 }
719793
720
721 /* do_mount
722 @config: current config
723 @vol: volume index into @config->vol[]
724 @vinfo: valid struct fmt_ptrn
725 @password:
726 @mkmntpoint: whether to create mountpoint if it does not exist
727
728 Returns zero on error, positive non-zero for success.
729 */
794 /*
795 * do_mount -
796 * @config: current config
797 * @vol: volume index into @config->vol[]
798 * @vinfo:
799 * @password:
800 *
801 * Returns zero on error, positive non-zero for success.
802 */
730803 int do_mount(const struct config *config, const unsigned int vol,
731 struct fmt_ptrn *vinfo, const char *password, const bool mkmntpoint)
804 struct HXbtree *vinfo, const char *password)
732805 {
733806 const char *_argv[MAX_PAR + 1];
734807 char prev_mntpt[PATH_MAX + 1];
735808 size_t _password_len;
736 int i, mount_again = 0;
809 int mount_again = 0;
737810 unsigned char _password[MAX_PAR + EVP_MAX_BLOCK_LENGTH];
738811 int _argc = 0, child_exit = 0, cstdin = -1, cstderr = -1;
739812 pid_t pid = -1;
740 struct vol *vpt;
813 struct vol *vpt;
814 unsigned int i;
741815
742816 assert(config_valid(config));
743817 assert(vinfo != NULL);
744818 assert(password != NULL);
745819
746 vpt = &config->volume[vol];
820 vpt = &config->volume[vol];
747821
748822 /* FIXME: This is a little ugly, especially check for != LCLMOUNT */
749 if((mount_again = already_mounted(config, vol, prev_mntpt, vinfo)) != 0) {
823 mount_again = already_mounted(config, vol, prev_mntpt, vinfo);
824 if (mount_again != 0) {
750825 if (mount_again == -1) {
751 l0g(PMPREFIX "could not determine if %s is already mounted, failing\n", config->volume[vol].volume);
826 l0g("could not determine if %s is already mounted, "
827 "failing\n", config->volume[vol].volume);
752828 return 0;
753 } else if(strcmp(prev_mntpt, vpt->mountpoint) == 0) {
754 w4rn(PMPREFIX "%s already seems to be mounted at %s, skipping\n", config->volume[vol].volume, prev_mntpt);
829 } else if (strcmp(prev_mntpt, vpt->mountpoint) == 0) {
830 w4rn("%s already seems to be mounted at %s, "
831 "skipping\n", config->volume[vol].volume,
832 prev_mntpt);
755833 return 1;
756834 } else {
757 w4rn(PMPREFIX "%s already mounted elsewhere at %s\n", config->volume[vol].volume, prev_mntpt);
758 /* FIXME: ugly hack to support umount.crypt script. I hope that
759 * util-linux will have native dm_crypt support some day */
760 if(vpt->type != LCLMOUNT && vpt->type != CRYPTMOUNT)
835 w4rn("%s already mounted elsewhere at %s\n",
836 config->volume[vol].volume, prev_mntpt);
837 /*
838 * FIXME: ugly hack to support umount.crypt script. I
839 * hope that util-linux will have native dm_crypt
840 * support some day.
841 */
842 if (vpt->type != CMD_LCLMOUNT &&
843 vpt->type != CMD_CRYPTMOUNT)
761844 mount_again = 0;
762845 }
763846 }
764 if(!exists(vpt->mountpoint)) {
765 if (mkmntpoint) {
766 if(!mkmountpoint(vpt, vpt->mountpoint))
847 if (!exists(vpt->mountpoint)) {
848 if (config->mkmntpoint) {
849 if (!mkmountpoint(vpt, vpt->mountpoint))
767850 return 0;
768851 } else {
769 l0g(PMPREFIX "mount point %s does not exist (pam_mount not configured to make it)\n", config->volume[vol].mountpoint);
852 l0g("mount point %s does not exist (pam_mount not "
853 "configured to make it)\n",
854 config->volume[vol].mountpoint);
770855 return 0;
771856 }
772857 }
773858 if (mount_again) {
774859 GError *err = NULL;
775 if(config->command[0][MNTAGAIN] == NULL) {
776 l0g(PMPREFIX "mntagain not defined in pam_mount.conf\n");
860 if (config->command[CMD_MNTAGAIN][0] == NULL) {
861 l0g("mntagain not defined in pam_mount.conf.xml\n");
777862 return 0;
778863 }
779864 /* FIXME: NEW */
780 fmt_ptrn_update_kv(vinfo, "PREVMNTPT", prev_mntpt);
781 for(i = 0; config->command[i][MNTAGAIN] != NULL; i++)
865 format_add(vinfo, "PREVMNTPT", prev_mntpt);
866 for (i = 0; config->command[CMD_MNTAGAIN][i] != NULL; ++i)
782867 add_to_argv(_argv, &_argc,
783 config->command[i][MNTAGAIN], vinfo);
868 config->command[CMD_MNTAGAIN][i], vinfo);
784869 log_argv(_argv);
785 if(!spawn_apS(NULL, _argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD,
786 set_myuid, NULL, &pid, NULL, NULL, &cstderr, &err)) {
787 l0g(PMPREFIX "%s\n", err->message);
870 if (!spawn_apS(NULL, _argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD,
871 set_myuid, NULL, &pid, NULL, NULL, &cstderr, &err)) {
872 l0g("%s\n", err->message);
788873 g_error_free(err);
789874 return 0;
790875 }
791876 } else {
792877 GError *err = NULL;
793 char *mount_user;
794 if(config->command[0][vpt->type] == NULL) {
795 l0g(PMPREFIX "proper mount command not defined in pam_mount.conf\n");
878 char *mount_user;
879 if (config->command[vpt->type][0] == NULL) {
880 l0g("proper mount command not defined in "
881 "pam_mount.conf.xml\n");
796882 return 0;
797883 }
798 w4rn(PMPREFIX "checking for encrypted filesystem key configuration\n");
799 password = (password != NULL) ? password : ""; /* FIXME: better done elsewhere? */
800 if(strlen(vpt->fs_key_cipher) > 0) {
801 /* _password is binary data -- no strlen, strcpy, etc! */
802 w4rn(PMPREFIX "decrypting FS key using system auth. token and %s\n", config->volume[vol].fs_key_cipher);
884 w4rn("checking for encrypted filesystem key configuration\n");
885 /* FIXME: better done elsewhere? */
886 password = (password != NULL) ? password : "";
887 if (strlen(vpt->fs_key_cipher) > 0) {
803888 /*
804 * config->volume[vol].fs_key_path contains real filesystem
805 * key.
889 * _password is binary data -- no strlen(), strcpy(),
890 * etc.!
806891 */
807 if(!decrypted_key(_password, &_password_len,
808 vpt->fs_key_path, vpt->fs_key_cipher, password))
892 w4rn("decrypting FS key using system auth. token and "
893 "%s\n", config->volume[vol].fs_key_cipher);
894 /*
895 * config->volume[vol].fs_key_path contains real
896 * filesystem key.
897 */
898 if (!decrypted_key(_password, &_password_len,
899 vpt->fs_key_path, vpt->fs_key_cipher, password))
809900 return 0;
810901 } else {
811 /* _password is an ASCII string in this case -- we'll treat its
812 * MAX_PAR + EVP_MAX_BLOCK_LENGTH size as the standard string
813 * MAX_PAR + 1 in this case */
902 /*
903 * _password is an ASCII string in this case -- we'll
904 * treat its MAX_PAR + EVP_MAX_BLOCK_LENGTH size as the
905 * standard string MAX_PAR + 1 in this case
906 */
814907 strncpy(signed_cast(char *, _password), password, MAX_PAR);
815908 _password[MAX_PAR] = '\0';
816909 _password_len = strlen(password);
817910 }
818 w4rn(PMPREFIX "about to start building mount command\n");
911 w4rn("about to start building mount command\n");
819912 /* FIXME: NEW */
820913 /* FIXME:
821 l0g(PMPREFIX "volume type (%d) is unknown\n", vpt->type);
914 l0g("volume type (%d) is unknown\n", vpt->type);
822915 return 0;
823916 */
824 for(i = 0; config->command[i][vpt->type] != NULL; ++i)
825 add_to_argv(_argv, &_argc, config->command[i][vpt->type], vinfo);
826
827 if(vpt->type == LCLMOUNT &&
828 !check_filesystem(config, vol, vinfo, _password, _password_len))
829 l0g(PMPREFIX "error checking filesystem but will continue\n");
917 for (i = 0; config->command[vpt->type][i] != NULL; ++i)
918 add_to_argv(_argv, &_argc,
919 config->command[vpt->type][i], vinfo);
920
921 if (vpt->type == CMD_LCLMOUNT &&
922 !check_filesystem(config, vol, vinfo, _password, _password_len))
923 l0g("error checking filesystem but will continue\n");
830924 /* send password down pipe to mount process */
831 if(vpt->type == SMBMOUNT || vpt->type == CIFSMOUNT)
925 if (vpt->type == CMD_SMBMOUNT || vpt->type == CMD_CIFSMOUNT)
832926 setenv("PASSWD_FD", "0", 1);
833927 log_argv(_argv);
834 mount_user = strcmp(vpt->fstype, "fuse") == 0 ? vpt->user : NULL;
835 if(!spawn_apS(NULL, _argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD,
836 set_myuid, mount_user, &pid, &cstdin, NULL, &cstderr, &err)) {
837 l0g(PMPREFIX "%s\n", err->message);
928 mount_user = strcmp(vpt->fstype, "fuse") == 0 ?
929 vpt->user : NULL;
930 if (!spawn_apS(NULL, _argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD,
931 set_myuid, mount_user, &pid, &cstdin, NULL,
932 &cstderr, &err)) {
933 l0g("%s\n", err->message);
838934 g_error_free(err);
839935 return 0;
840936 }
841 if(vpt->type != NFSMOUNT) {
842 if(pipewrite(cstdin, _password, _password_len) != _password_len)
937 if (vpt->type != CMD_NFSMOUNT)
938 if (pipewrite(cstdin, _password, _password_len) !=
939 _password_len)
843940 /* FIXME: clean: returns value of exit below */
844 l0g(PMPREFIX "error sending password to mount\n");
845 }
846 close(cstdin);
941 l0g("error sending password to mount\n");
942 close(cstdin);
847943 }
848944 /* Paranoia? */
849945 memset(_password, 0, sizeof(_password));
850 w4rn(PMPREFIX "mount errors (should be empty):\n");
946 w4rn("mount errors (should be empty):\n");
851947 log_output(cstderr);
852948 CLOSE(cstderr);
853 w4rn(PMPREFIX "waiting for mount\n");
854 if (waitpid(pid, &child_exit, 0) == -1) {
855 spawn_restore_sigchld();
856 l0g(PMPREFIX "error waiting for child: %s\n", strerror(errno));
949 w4rn("waiting for mount\n");
950 if (waitpid(pid, &child_exit, 0) < 0) {
951 spawn_restore_sigchld();
952 l0g("error waiting for child: %s\n", strerror(errno));
857953 return 0;
858954 }
859955
860 spawn_restore_sigchld();
861 if(Debug)
862 system("df");
863
864 /* pass on through the result from the umount process */
865 return !WEXITSTATUS(child_exit);
866 }
867
868
869 /* mount_op
870 @mnt: function to execute mount operations (do_mount or do_unmount)
871 @config:
872 @vol: volume index into @config->volume[]
873 @password: password string (may be %NULL on unmount)
874 @mkmntpoint: whether to create mountpoint if it does not exist
875
876 Returns zero on error, positive non-zero for success.
877 Note: Checked by volume_record_sane() and read_volume()
878 */
956 spawn_restore_sigchld();
957 if (Debug)
958 system("df -Ta");
959
960 /* pass on through the result from the umount process */
961 return !WEXITSTATUS(child_exit);
962 }
963
964 /*
965 * mount_op -
966 * @mnt: function to execute mount operations (do_mount or do_unmount)
967 * @config:
968 * @vol: volume index into @config->volume[]
969 * @password: password string (may be %NULL on unmount)
970 *
971 * Returns zero on error, positive non-zero for success.
972 * Note: Checked by volume_record_sane() and read_volume()
973 */
879974 int mount_op(mount_op_fn_t *mnt, const struct config *config,
880 const unsigned int vol, const char *password, const int mkmntpoint)
975 const unsigned int vol, const char *password)
881976 {
882977 int fnval;
883 struct fmt_ptrn vinfo;
884 char options[MAX_PAR + 1], uuid[16], ugid[16];
885 const struct vol *vpt;
886 struct passwd *pe;
978 struct HXbtree *vinfo;
979 char options[MAX_PAR + 1];
980 const struct vol *vpt;
981 struct passwd *pe;
887982
888983 assert(config_valid(config));
889984
890 vpt = &config->volume[vol];
891
892 fmt_ptrn_init(&vinfo);
893 fmt_ptrn_update_kv(&vinfo, "MNTPT", vpt->mountpoint);
894 fmt_ptrn_update_kv(&vinfo, "FSCKLOOP", config->fsckloop);
895 fmt_ptrn_update_kv(&vinfo, "FSTYPE", vpt->fstype);
896 fmt_ptrn_update_kv(&vinfo, "VOLUME", vpt->volume);
897 fmt_ptrn_update_kv(&vinfo, "SERVER", vpt->server);
898 fmt_ptrn_update_kv(&vinfo, "USER", vpt->user);
899 if((pe = getpwnam(vpt->user)) == NULL) {
900 w4rn(PMPREFIX "getpwnam(\"%s\") failed: %s\n",
901 Config.user, strerror(errno));
902 } else {
903 snprintf(uuid, sizeof(uuid), "%ld", static_cast(long, pe->pw_uid));
904 snprintf(ugid, sizeof(ugid), "%ld", static_cast(long, pe->pw_gid));
905 fmt_ptrn_update_kv(&vinfo, "USERUID", uuid);
906 fmt_ptrn_update_kv(&vinfo, "USERGID", ugid);
907 }
985 vpt = &config->volume[vol];
986
987 vinfo = HXformat_init();
988 format_add(vinfo, "MNTPT", vpt->mountpoint);
989 format_add(vinfo, "FSCKLOOP", config->fsckloop);
990 format_add(vinfo, "FSTYPE", vpt->fstype);
991 format_add(vinfo, "VOLUME", vpt->volume);
992 format_add(vinfo, "SERVER", vpt->server);
993 format_add(vinfo, "USER", vpt->user);
994 misc_add_ntdom(vinfo, vpt->user);
995
996 if ((pe = getpwnam(vpt->user)) == NULL) {
997 w4rn("getpwnam(\"%s\") failed: %s\n",
998 Config.user, strerror(errno));
999 } else {
1000 HXformat_add(vinfo, "USERUID", &pe->pw_uid, HXTYPE_LONG);
1001 HXformat_add(vinfo, "USERGID", &pe->pw_gid, HXTYPE_LONG);
1002 }
9081003
9091004 /* FIXME: should others remain undefined if == ""? */
9101005 optlist_to_str(options, vpt->options);
911 fmt_ptrn_update_kv(&vinfo, "OPTIONS", options);
912
913 if(Debug)
1006 format_add(vinfo, "OPTIONS", options);
1007
1008 if (Debug)
9141009 log_pm_input(config, vol);
9151010
916 fnval = mnt(config, vol, &vinfo, password, mkmntpoint);
917 fmt_ptrn_close(&vinfo);
1011 fnval = (*mnt)(config, vol, vinfo, password);
1012 HXformat_free(vinfo);
9181013 return fnval;
9191014 }
9201015
921
922 /* copied from libHX */
923 /* noproto */ static
924 char *HX_chomp(char *s) {
925 size_t len = strlen(s);
926 char *p = s + len - 1;
927 while(p >= s) {
928 if(*p != '\n' && *p != '\r')
929 break;
930 *p-- = '\0';
931 }
932 return s;
933 }
934
935
936 /* fstype_nodev
937 @name: fstype to check
938
939 Returns 1 if the filesystem does not require a block device, 0 if it does
940 require a block device, -1 if we could not find out.
941 */
1016 /*
1017 * fstype_nodev -
1018 * @name: fstype to check
1019 *
1020 * Returns 1 if the filesystem does not require a block device, 0 if it does
1021 * require a block device, -1 if we could not find out.
1022 */
9421023 static int fstype_nodev(const char *name) {
943 char buf[MAX_PAR];
944 FILE *fp;
945
946 if((fp = fopen("/proc/filesystems", "r")) == NULL)
947 return -1;
948
949 while(fgets(buf, sizeof(buf), fp) != NULL) {
950 char *bp = buf;
951 HX_chomp(buf);
952 while(isalpha(*bp)) ++bp;
953 while(isspace(*bp)) ++bp;
954 if(strcasecmp(bp, name) == 0) {
955 fclose(fp);
956 return strncasecmp(buf, "nodev", 5) == 0;
957 }
958 }
959
960 fclose(fp);
961 return -1;
962 }
963
964
965 /* loop_bk
966 @filename: block device to query
967 @i: pointer to result storage
968
969 Run the LOOP_GET_STATUS64 ioctl on @filename and store the result in @i.
970 Returns the underlying file of the loop device, or @filename if @filename
971 does not seem to be a loop device at all.
972 */
973 static inline const char *loop_bk(const char *filename,
974 struct loop_info64 *i)
975 {
976 int fd;
977 if((fd = open(filename, O_RDONLY)) < 0)
978 return filename;
979
980 #ifndef LOOP_GET_STATUS64
981 # error -------------------------------------------------------------------
982 # error Your userspace kernel headers (/usr/include/linux/) are out of date
983 # error This is NOT a pam-mount bug, but one of your distribution.
984 # error See www.sourceforge.net/mailarchive/message.php?msg_id=13974728
985 # error for details.
986 # error -------------------------------------------------------------------
1024 char buf[MAX_PAR];
1025 FILE *fp;
1026
1027 if ((fp = fopen("/proc/filesystems", "r")) == NULL)
1028 return -1;
1029
1030 while (fgets(buf, sizeof(buf), fp) != NULL) {
1031 char *bp = buf;
1032 HX_chomp(buf);
1033 while (isalpha(*bp)) ++bp;
1034 while (isspace(*bp)) ++bp;
1035 if (strcasecmp(bp, name) == 0) {
1036 fclose(fp);
1037 return strncasecmp(buf, "nodev", 5) == 0;
1038 }
1039 }
1040
1041 fclose(fp);
1042 return -1;
1043 }
1044
1045 #ifdef HAVE_STRUCT_LOOP_INFO64_LO_FILE_NAME
1046 /*
1047 * loop_bk -
1048 * @filename: block device to query
1049 * @i: pointer to result storage
1050 *
1051 * Run the LOOP_GET_STATUS64 ioctl on @filename and store the result in @i.
1052 * Returns the underlying file of the loop device, or @filename if @filename
1053 * does not seem to be a loop device at all.
1054 */
1055 static inline const char *loop_bk(const char *filename, struct loop_info64 *i)
1056 {
1057 int fd;
1058 if ((fd = open(filename, O_RDONLY)) < 0)
1059 return filename;
1060
1061 if (ioctl(fd, LOOP_GET_STATUS64, i) != 0) {
1062 close(fd);
1063 return filename;
1064 }
1065 close(fd);
1066 return signed_cast(char *, i->lo_file_name);
1067 }
9871068 #endif
988 if(ioctl(fd, LOOP_GET_STATUS64, i) != 0) {
989 close(fd);
990 return filename;
991 }
992 close(fd);
993 return signed_cast(char *, i->lo_file_name);
994 }
9951069
9961070 //=============================================================================
0 /*=============================================================================
1 mount.h
2 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of
7 the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to:
16 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 Boston, MA 02110-1301 USA
18
19 -- For details, see the file named "LICENSE.LGPL2"
20 =============================================================================*/
210 #ifndef PMT_MOUNT_H
221 #define PMT_MONUT_H 1
232
24 #include "fmt_ptrn.h"
25 #include "private.h"
26 #include "xstdlib.h"
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
3 #include <stdbool.h>
314
325 struct config;
33 struct fmt_ptrn;
6 struct HXbtree;
347
358 typedef int (mount_op_fn_t)(const struct config *, const unsigned int,
36 struct fmt_ptrn *, const char *, const bool);
9 struct HXbtree *, const char *);
3710
3811 /*
39 * MOUNT.C
12 * MOUNT.C
4013 */
4114 extern mount_op_fn_t do_mount, do_unmount;
4215 extern int mount_op(mount_op_fn_t *, const struct config *, const unsigned int,
43 const char *, const int);
16 const char *);
4417
45 #ifdef __cplusplus
46 } // extern "C"
47 #endif
48
49 #endif // PMT_MOUNT_H
50
51 //=============================================================================
18 #endif /* PMT_MOUNT_H */
00 /*=============================================================================
1 optlist.c
1 pam_mount - optlist.c
22 Copyright (C) W. Michael Putello <mike@flyn.org>, 2003
3 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
3 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2007
44
55 This program is free software; you can redistribute it and/or modify
66 it under the terms of the GNU Lesser General Public License as
2222 #include <sys/types.h>
2323 #include <assert.h>
2424 #include <glib.h>
25 #include <stdbool.h>
2526 #include <stdlib.h>
2627 #include <string.h>
2728 #include "compiler.h"
3031 #include "private.h"
3132 #include "xstdlib.h"
3233
33 // Functions
34 /* Functions */
3435 static int _compare(gconstpointer, gconstpointer);
3536 static int _parse_opt(const char *, size_t, optlist_t **);
3637 static int _parse_string_opt(const char *str, size_t, optlist_t **);
3738
38 /* ============================ _parse_string_opt () ======================= */
39 /* INPUT: str, string to parse
40 * len, should be length up to first ',' or terminating '\0'
41 * SIDE EFFECTS: str[0 - len] has been parsed and placed in optlist
42 * OUTPUT: if error 0 else 1
43 */
44 static int _parse_string_opt(const char *str, size_t len,
45 optlist_t ** optlist)
39 /*
40 * _parse_string_opt -
41 * @str: string to pase
42 * @len: the length up to first ',' or terminating '\0'
43 * @optlist:
44 *
45 * Parses @str[0-len] and placed in optlist. Returns 1 on success, otherwise 0.
46 */
47 static int _parse_string_opt(const char *str, size_t len, optlist_t **optlist)
4648 {
4749 int ret = 1;
4850 struct pair *pair;
5254 /* a user could config "loop,,,foo=bar==..." */
5355 if (len <= 0 || len > MAX_PAR) {
5456 ret = 0;
55 goto _return;
57 goto out;
5658 }
5759 assert(len > 0 && len <= strlen(str) && len <= MAX_PAR);
5860 assert(optlist != NULL);
5961
6062 delim = strchr(str, '=');
61 if(delim == NULL || delim - str >= len) {
62 ret = 0;
63 goto _return;
63 if (delim == NULL || delim - str >= len) {
64 ret = 0;
65 goto out;
6466 }
6567 pair = xmalloc(sizeof(struct pair));
66 key = xmalloc(delim - str + 1); // +1 for '='
67 val = xmalloc(len - (delim - str));
68 key = xmalloc(delim - str + 1); /* +1 for '=' */
69 val = xmalloc(len - (delim - str));
6870 strncpy(key, str, delim - str);
6971 key[delim - str] = '\0';
7072 strncpy(val, delim + 1, len - (delim - str) - 1);
7173 val[len - (delim - str) - 1] = '\0';
7274 pair_init(pair, key, val, free, free);
7375 *optlist = g_list_append(*optlist, pair);
74 _return:
75
76 assert(!ret || (optlist_exists(*optlist, key)
77 && strcmp(optlist_value(*optlist, key), val) == 0));
78
76
77 out:
78 assert(!ret || (optlist_exists(*optlist, key) &&
79 strcmp(optlist_value(*optlist, key), val) == 0));
7980 return ret;
8081 }
8182
82 /* ============================ _parse_opt () ============================== */
83 /* INPUT: str, string to parse
84 * len, should be length up to first ',' or terminating '\0'
85 * SIDE EFFECTS: str[0 - len] has been parsed and placed in optlist
86 * OUTPUT: if error 0 else 1
87 */
88 static int _parse_opt(const char *str, size_t len, optlist_t ** optlist)
83 /*
84 * _parse_opt -
85 * @str: str, string to parse
86 * @len: the length up to first ',' or terminating '\0'
87 *
88 * Parses @str[0-len] and places it in optlist.
89 * Returns 1 on success, otherwise 0.
90 */
91 static int _parse_opt(const char *str, size_t len, optlist_t **optlist)
8992 {
9093 int ret = 1;
9194 struct pair *pair;
9598 /* a user could config "loop,,,foo=bar==..." */
9699 if (len <= 0 || len > MAX_PAR) {
97100 ret = 0;
98 goto _return;
101 goto out;
99102 }
100103 assert(len > 0 && len <= strlen(str) && len <= MAX_PAR);
101104 assert(optlist != NULL);
102105
103106 pair = xmalloc(sizeof(struct pair));
104 key = xmalloc(len + 1);
105 val = xmalloc(1); // o_O waste
107 key = xmalloc(len + 1);
108 val = xmalloc(1); /* wasteful */
106109 strncpy(key, str, len);
107110 key[len] = '\0';
108111 *val = '\0';
109112 pair_init(pair, key, val, free, free);
110113 *optlist = g_list_append(*optlist, pair);
111 _return:
112
113 assert(!ret || (optlist_exists(*optlist, key)
114 && !strcmp(optlist_value(*optlist, key), val)));
115
114
115 out:
116 assert(!ret || (optlist_exists(*optlist, key) &&
117 strcmp(optlist_value(*optlist, key), val) == 0));
116118 return ret;
117119 }
118120
119 /* ============================ str_to_optlist () ========================== */
120 /* INPUT: str, string to parse
121 * SIDE EFFECTS: str has been parsed and placed in optlist
122 * OUTPUT: if error 0 else 1
123 */
124 bool str_to_optlist(optlist_t **optlist, const char *str) {
121 /*
122 * str_to_oplist -
123 * @optlist:
124 * @str: string to parse
125 */
126 bool str_to_optlist(optlist_t **optlist, const char *str)
127 {
125128 int ret = 1;
126129 char *ptr;
127130
129132 assert(str != NULL);
130133
131134 *optlist = NULL;
132 if(strlen(str) == 0) {
133 ret = 0;
134 goto _return;
135 if (strlen(str) == 0) {
136 ret = 0;
137 goto out;
135138 }
136139 while ((ptr = strchr(str, ',')) != NULL) {
137 if(!_parse_string_opt(str, ptr - str, optlist) &&
138 !_parse_opt(str, ptr - str, optlist)) {
139 ret = 0;
140 goto _return;
141 }
142 str = ptr + 1;
143 }
144 if(!_parse_string_opt(str, strlen(str), optlist) &&
145 !_parse_opt(str, strlen(str), optlist)) {
146 ret = 0;
147 goto _return;
148 }
149 _return:
150
151 assert(!ret || ((strlen(str) == 0 && *optlist == '\0') || *optlist != '\0'));
152
140 if (!_parse_string_opt(str, ptr - str, optlist) &&
141 !_parse_opt(str, ptr - str, optlist)) {
142 ret = 0;
143 goto out;
144 }
145 str = ptr + 1;
146 }
147 if (!_parse_string_opt(str, strlen(str), optlist) &&
148 !_parse_opt(str, strlen(str), optlist)) {
149 ret = 0;
150 goto out;
151 }
152
153 out:
154 assert(!ret || ((strlen(str) == 0 && *optlist == '\0') ||
155 *optlist != '\0'));
153156 return ret;
154157 }
155158
156 /* ============================ _compare () ================================ */
157 /* INPUT: x and y
158 * OUTPUT: if x->key is the same string as y then 0, else non-0
159 */
160159 static int _compare(gconstpointer x, gconstpointer y)
161160 {
162 const struct pair *px = x;
161 const struct pair *px = x;
163162 assert(x != NULL);
164163 assert(px->key != NULL);
165164 assert(y != NULL);
166
167165 return strcmp(px->key, y);
168166 }
169167
170 /* ============================ optlist_exists () ========================== */
171 /* INPUT: optlist and str
172 * OUTPUT: if optlist[str] exists 1 else 0
173 */
174 bool optlist_exists(optlist_t *optlist, const char *str) {
175 assert(str != NULL);
176
177 if(optlist == NULL)
168 bool optlist_exists(optlist_t *optlist, const char *str)
169 {
170 assert(str != NULL);
171 if (optlist == NULL)
178172 return 0;
179173 return g_list_find_custom(optlist, str, _compare) ? 1 : 0;
180174 }
181175
182 /* ============================ optlist_value () =========================== */
183 /* INPUT: optlist and str
176 /*
177 * optlist_value -
184178 * OUTPUT: optlist[str] ("" if no value) else NULL
185179 */
186180 const char *optlist_value(optlist_t * optlist, const char *str)
189183
190184 assert(str != NULL);
191185
192 if(optlist == NULL)
186 if (optlist == NULL)
193187 return NULL;
194188 ptr = g_list_find_custom(optlist, str, _compare);
195189
210204 assert(str != NULL);
211205
212206 *str = '\0';
213 if(optlist != NULL)
207 if (optlist != NULL)
214208 do {
215 struct pair *pair = ptr->data;
209 struct pair *pair = ptr->data;
216210 strncat(str, pair->key, MAX_PAR - strlen(str));
217 if(strlen(pair->val) > 0) {
211 if (strlen(pair->val) > 0) {
218212 strncat(str, "=", MAX_PAR - strlen(str));
219 strncat(str, pair->
220 val, MAX_PAR - strlen(str));
213 strncat(str, pair->val, MAX_PAR - strlen(str));
221214 }
222215 if ((ptr = g_list_next(ptr)) != NULL)
223216 strncat(str, ",", MAX_PAR - strlen(str));
224 } while (ptr);
217 } while (ptr != NULL);
225218 str[MAX_PAR] = '\0';
226219
227220 assert((optlist == NULL && strlen(str) == 0) || strlen(str) > 0);
228
229221 return str;
230222 }
0 /*=============================================================================
1 optlist.h
2 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of
7 the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to:
16 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 Boston, MA 02110-1301 USA
18
19 -- For details, see the file named "LICENSE.LGPL2"
20 =============================================================================*/
210 #ifndef PMT_OPTLIST_H
221 #define PMT_OPTLIST_H 1
232
243 #include <glib.h>
4 #include <stdbool.h>
255 #include "compiler.h"
266 #include "pair.h"
27 #include "xstdlib.h"
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
327
338 #define optlist_next(element) g_list_next(element)
349 #define optlist_key(element) \
35 static_cast(const struct pair *, (element)->data)->key
10 static_cast(const struct pair *, (element)->data)->key
3611 #define optlist_val(element) \
37 static_cast(const struct pair *, (element)->data)->val
12 static_cast(const struct pair *, (element)->data)->val
3813 #define optlist_len(list) g_list_length(list)
3914
4015 typedef GList optlist_t;
4116
4217 /*
43 * OPTLIST.C
18 * OPTLIST.C
4419 */
4520 extern bool optlist_exists(optlist_t *, const char *);
4621 extern char *optlist_to_str(char *, const optlist_t *);
4722 extern const char *optlist_value(optlist_t *, const char *);
4823 extern bool str_to_optlist(optlist_t **, const char *);
4924
50 #ifdef __cplusplus
51 } // extern "C"
52 #endif
53
54 #endif // PMT_OPTLIST_H
55
56 //=============================================================================
25 #endif /* PMT_OPTLIST_H */
00 /*=============================================================================
1 pair.c
1 pam_mount - pair.c
22 Copyright (C) W. Michael Putello <mike@flyn.org>, 1999 - 2000
3 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
3 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2007
44
55 This program is free software; you can redistribute it and/or modify
66 it under the terms of the GNU Lesser General Public License as
2424 #include <glib.h>
2525 #include "pair.h"
2626
27 //-----------------------------------------------------------------------------
28 /* pair_valid
29 @p: pair to analyze
30
31 Verifies that thep air structure is consistent.
32 */
33 int pair_valid(const struct pair *p) {
34 return p != NULL && p->key != NULL && p->val != NULL;
27 /*
28 * pair_valid -
29 * @p: pair to analyze
30 *
31 * Verifies that thep air structure is consistent.
32 */
33 int pair_valid(const struct pair *p)
34 {
35 return p != NULL && p->key != NULL && p->val != NULL;
3536 }
3637
37
38 /* pair_init
39 @p: pair structure to initialize
40
41 Fills @p with with @key, @val and the @destroy_k and @destroy_v functions.
42 */
38 /*
39 * pair_init -
40 * @p: pair structure to initialize
41 *
42 * Fills @p with with @key, @val and the @destroy_k and @destroy_v functions.
43 */
4344 void pair_init(struct pair *pair, void *key, void *val,
44 void (*destroy_k)(void *), void (*destroy_v)(void *))
45 void (*destroy_k)(void *), void (*destroy_v)(void *))
4546 {
46 pair->key = key;
47 pair->val = val;
48 pair->destroy_k = destroy_k;
49 pair->destroy_v = destroy_v;
50 return;
47 pair->key = key;
48 pair->val = val;
49 pair->destroy_k = destroy_k;
50 pair->destroy_v = destroy_v;
51 return;
5152 }
5253
53 /* pair_destroy
54 @pair: pair to destroy
55
56 Destroy the pair pointed to by @pair.
57 Note: This function is currently not called from anywhere.
58 */
59 void pair_destroy(struct pair *pair) {
60 if(pair->destroy_k != NULL)
61 pair->destroy_k(pair->key);
62 if(pair->destroy_v != NULL)
63 pair->destroy_v(pair->val);
64 free(pair);
65 return;
54 /*
55 * pair_destroy
56 * @pair: pair to destroy
57 *
58 * Destroy the pair pointed to by @pair.
59 * Note: This function is currently not called from anywhere.
60 */
61 void pair_destroy(struct pair *pair)
62 {
63 if (pair->destroy_k != NULL)
64 pair->destroy_k(pair->key);
65 if (pair->destroy_v != NULL)
66 pair->destroy_v(pair->val);
67 free(pair);
68 return;
6669 }
67
68 //=============================================================================
0 /*=============================================================================
1 pair.h
2 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of
7 the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to:
16 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 Boston, MA 02110-1301 USA
18
19 -- For details, see the file named "LICENSE.LGPL2"
20 =============================================================================*/
210 #ifndef PMT_PAIR_H
221 #define PMT_PAIR_H 1
232
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
283 struct pair {
29 void *key;
30 void *val;
31 void (*destroy_k)(void *);
32 void (*destroy_v)(void *);
4 void *key;
5 void *val;
6 void (*destroy_k)(void *);
7 void (*destroy_v)(void *);
338 };
349
3510 /*
36 * PAIR.C
11 * PAIR.C
3712 */
3813 extern void pair_destroy(struct pair *);
3914 extern void pair_init(struct pair *, void *, void *,
40 void (*)(void *), void (*)(void *));
15 void (*)(void *), void (*)(void *));
4116 extern int pair_valid(const struct pair *);
4217
43 #ifdef __cplusplus
44 } // extern "C"
45 #endif
46
47 #endif // PMT_PAIR_H
48
49 //=============================================================================
18 #endif /* PMT_PAIR_H */
00 /*=============================================================================
1 pam_mount.c
1 pam_mount - pam_mount.c
22 Copyright (C) Elvis Pfützenreuter <epx@conectiva.com>, 2000
3 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
3 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2007
44 Copyright © Bastian Kleineidam <calvin [at] debian org>, 2005
55
66 This program is free software; you can redistribute it and/or modify
2323 #define PAM_SM_SESSION
2424 #define PAM_SM_PASSWORD
2525
26 #include <security/pam_appl.h>
2627 #include <security/pam_modules.h>
2728 #include <sys/types.h>
2829 #include <sys/wait.h>
3435 #include <stdlib.h>
3536 #include <string.h>
3637 #include <unistd.h>
38 #include <libHX.h>
3739 #include "compiler.h"
38 #include "fmt_ptrn.h"
3940 #include "misc.h"
4041 #include "mount.h"
4142 #include "pam_mount.h"
4445 #include "spawn.h"
4546 #include "xstdlib.h"
4647
47 #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
48 # define CONFIGFILE "/etc/pam_mount.conf"
48 #if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__)
49 # define CONFIGFILE "/etc/pam_mount.conf.xml"
4950 #else
50 # define CONFIGFILE "/etc/security/pam_mount.conf"
51 # define CONFIGFILE "/etc/security/pam_mount.conf.xml"
5152 #endif
5253
53 // Functions
54 /* Functions */
5455 static void clean_config(pam_handle_t *, void *, int);
5556 static void clean_system_authtok(pam_handle_t *, void *, int);
5657 static int converse(pam_handle_t *, int, const struct pam_message **,
57 struct pam_response **);
58 struct pam_response **);
5859 static int modify_pm_count(struct config *, char *, char *);
5960 static void parse_pam_args(int, const char **);
6061 static int read_password(pam_handle_t *, const char *, char **);
6162
62 // Variables
63 /* Variables */
6364 int Debug = 0;
6465 struct config Config = {};
6566 struct pam_args Args = {};
6667
6768 //-----------------------------------------------------------------------------
68 /* parse_pam_args
69 @argv: NULL-terminated argument vector
70 @argc: number of elements in @argc
71
72 Global @Args is initialized, based on @argv.
73 */
74 static void parse_pam_args(int argc, const char **argv) {
69 /*
70 * parse_pam_args -
71 * @argv: NULL-terminated argument vector
72 * @argc: number of elements in @argc
73 *
74 * Global @Args is initialized, based on @argv.
75 */
76 static void parse_pam_args(int argc, const char **argv)
77 {
7578 int i;
7679
7780 assert(argc >= 0);
7982 assert(argv[i] != NULL);
8083
8184 /* first, set default values */
82 Args.auth_type = GET_PASS;
83 for (i = 0; i < argc; i++) {
84 w4rn(PMPREFIX "pam_sm_open_session args: %s\n", argv[i]);
85 if(strcmp("use_first_pass", argv[i]) == 0)
85 Args.auth_type = GET_PASS;
86
87 for (i = 0; i < argc; ++i) {
88 w4rn("pam_sm_open_session args: %s\n", argv[i]);
89 if (strcmp("use_first_pass", argv[i]) == 0)
8690 Args.auth_type = USE_FIRST_PASS;
87 else if(strcmp("try_first_pass", argv[i]) == 0)
91 else if (strcmp("try_first_pass", argv[i]) == 0)
8892 Args.auth_type = TRY_FIRST_PASS;
93 else if (strcmp("soft_try_pass", argv[i]) == 0)
94 Args.auth_type = SOFT_TRY_PASS;
8995 else
90 w4rn(PMPREFIX "bad pam_mount option\n");
91 }
92 return;
93 }
94
95
96 /* clean_config
97 @pamh: PAM handle
98 @data: custom data pointer
99 @err:
100
101 Free data from a struct config variable.
102 Note: This is registered as a PAM callback function and is called directly.
103 */
104 static void clean_config(pam_handle_t *pamh, void *data, int err) {
105 w4rn(PMPREFIX "Clean global config (%d)\n", err);
106 freeconfig(data);
107 return;
108 }
109
110
111 /* clean_system_authtok
112 @pamh: PAM handle
113 @data: custom data pointer
114 @err:
115
116 Zero and free @data if it is not %NULL.
117 Note: This is registered as a PAM callback function and is called directly.
118
119 FIXME: Not binary-password safe.
120 */
121 static void clean_system_authtok(pam_handle_t *pamh, void *data, int errcode) {
122 w4rn(PMPREFIX "clean system authtok (%d)\n", errcode);
123 /*
124 if (data) {
96 w4rn("bad pam_mount option\n");
97 }
98 return;
99 }
100
101 /*
102 * clean_config -
103 * @pamh: PAM handle
104 * @data: custom data pointer
105 * @err:
106 *
107 * Free data from a struct config variable.
108 * Note: This is registered as a PAM callback function and is called directly.
109 */
110 static void clean_config(pam_handle_t *pamh, void *data, int err)
111 {
112 w4rn("Clean global config (%d)\n", err);
113 freeconfig(data);
114 return;
115 }
116
117 /*
118 * clean_system_authtok -
119 * @pamh: PAM handle
120 * @data: custom data pointer
121 * @err:
122 *
123 * Zero and free @data if it is not %NULL.
124 * Note: This is registered as a PAM callback function and is called directly.
125 *
126 * FIXME: Not binary-password safe.
127 */
128 static void clean_system_authtok(pam_handle_t *pamh, void *data, int errcode)
129 {
130 w4rn("clean system authtok (%d)\n", errcode);
131 /*
132 if (data != NULL) {
125133 memset(data, 0, strlen(data));
126134 free(data);
127135 }
128136 */
129 return;
130 }
131
132
133 /* converse
134 @pamh: PAM handle
135 @nargs: number of messages
136 @message: PAM message array
137 @resp: user response array
138
139 Note: Adapted from pam_unix/support.c.
140 */
137 return;
138 }
139
140 /*
141 * converse -
142 * @pamh: PAM handle
143 * @nargs: number of messages
144 * @message: PAM message array
145 * @resp: user response array
146 *
147 * Note: Adapted from pam_unix/support.c.
148 */
141149 static int converse(pam_handle_t *pamh, int nargs,
142 const struct pam_message **message, struct pam_response **resp)
150 const struct pam_message **message, struct pam_response **resp)
143151 {
144152 int retval;
145153 struct pam_conv *conv;
150158
151159 *resp = NULL;
152160 retval = pam_get_item(pamh, PAM_CONV, static_cast(const void **,
153 static_cast(void *, &conv)));
154
155 if(retval == PAM_SUCCESS) {
156 retval = conv->conv(nargs, message, resp, conv->appdata_ptr);
157 if(retval != PAM_SUCCESS)
158 l0g(PMPREFIX "conv->conv(...): %s\n", pam_strerror(pamh, retval));
159 } else {
160 l0g(PMPREFIX "pam_get_item: %s\n", pam_strerror(pamh, retval));
161 }
162
163 if(resp == NULL || *resp == NULL || (*resp)->resp == NULL)
161 static_cast(void *, &conv)));
162
163 if (retval == PAM_SUCCESS) {
164 retval = conv->conv(nargs, message, resp, conv->appdata_ptr);
165 if (retval != PAM_SUCCESS)
166 l0g("conv->conv(...): %s\n", pam_strerror(pamh, retval));
167 } else {
168 l0g("pam_get_item: %s\n", pam_strerror(pamh, retval));
169 }
170
171 if (resp == NULL || *resp == NULL || (*resp)->resp == NULL)
164172 retval = PAM_AUTH_ERR;
165173
166 assert(retval != PAM_SUCCESS
167 || (resp != NULL && *resp != NULL
168 && (*resp)->resp != NULL));
169
170 return retval; /* propagate error status */
171 }
172
173
174 /* read_password
175 @pamh: PAM handle
176 @prompt: a prompt message
177 @pass: space for entered password
178
179 Returns PAM error code or %PAM_SUCCESS.
180 Note: Adapted from pam_unix/support.c:_unix_read_password().
181 */
182 static int read_password(pam_handle_t *pamh, const char *prompt, char **pass) {
174 assert(retval != PAM_SUCCESS || (resp != NULL && *resp != NULL &&
175 (*resp)->resp != NULL));
176 return retval; /* propagate error status */
177 }
178
179 /*
180 * read_password -
181 * @pamh: PAM handle
182 * @prompt: a prompt message
183 * @pass: space for entered password
184 *
185 * Returns PAM error code or %PAM_SUCCESS.
186 * Note: Adapted from pam_unix/support.c:_unix_read_password().
187 */
188 static int read_password(pam_handle_t *pamh, const char *prompt, char **pass)
189 {
183190 int retval;
184191 struct pam_message msg;
185192 const struct pam_message *pmsg = &msg;
186193 struct pam_response *resp = NULL;
187194
188195 assert(pamh != NULL);
189 assert(prompt != NULL);
190196 assert(pass != NULL);
191197
192 w4rn(PMPREFIX "enter read_password\n");
198 w4rn("enter read_password\n");
193199 *pass = NULL;
194200 msg.msg_style = PAM_PROMPT_ECHO_OFF;
195 msg.msg = prompt;
196 retval = converse(pamh, 1, &pmsg, &resp);
201 msg.msg = (prompt == NULL) ? "Password: " : prompt;
202 retval = converse(pamh, 1, &pmsg, &resp);
197203 if (retval == PAM_SUCCESS)
198204 *pass = xstrdup(resp->resp);
199205
200206 assert(retval != PAM_SUCCESS || (pass != NULL && *pass != NULL));
201
202207 return retval;
203208 }
204209
205
206 /* pam_sm_authenticat
207 @pamh: PAM handle
208 @flags: PAM flags
209 @argc: number of elements in @argv
210 @argv: NULL-terminated argument vector
211
212 Called by the PAM layer. The user's system password is added to PAM's
213 global module data. This is because pam_sm_open_session() does not allow
214 access to the user's password. Returns the PAM error code or %PAM_SUCCESS.
215 */
210 /*
211 * pam_sm_authenticate -
212 * @pamh: PAM handle
213 * @flags: PAM flags
214 * @argc: number of elements in @argv
215 * @argv: NULL-terminated argument vector
216 *
217 * Called by the PAM layer. The user's system password is added to PAM's
218 * global module data. This is because pam_sm_open_session() does not allow
219 * access to the user's password. Returns the PAM error code or %PAM_SUCCESS.
220 */
216221 PAM_EXTERN EXPORT_SYMBOL int pam_sm_authenticate(pam_handle_t *pamh, int flags,
217 int argc, const char **argv)
222 int argc, const char **argv)
218223 {
219224 int ret = PAM_SUCCESS;
220225 char *authtok = NULL;
223228
224229 assert(pamh != NULL);
225230
226 /* FIXME: this is called again in pam_sm_open_session. this is because
227 * pam_sm_authenticate is never called when root su's to another user.
231 /*
232 * FIXME: this is called again in pam_sm_open_session. This is because
233 * pam_sm_authenticate() is never called when root su's to another
234 * user.
228235 */
229236 initconfig(&Config);
230237 parse_pam_args(argc, argv);
231238 /* needed because gdm does not prompt for username as login does: */
232239 if ((ret = pam_get_user(pamh, &pam_user, NULL)) != PAM_SUCCESS) {
233 l0g(PMPREFIX "could not get user\n");
234 /* do NOT return PAM_SERVICE_ERR or root will not be able
235 * to su to other users */
236 goto _return;
237 }
238 /* FIXME: free me! the dup is required because result of pam_get_user
239 disappears (valgrind) */
240 l0g("could not get user\n");
241 /*
242 * do NOT return %PAM_SERVICE_ERR or root will not be able to
243 * su to other users
244 */
245 goto out;
246 }
247 /*
248 * FIXME: free me! the dup is required because result of pam_get_user
249 * disappears (valgrind)
250 */
240251 Config.user = relookup_user(pam_user);
241 if(Args.auth_type != GET_PASS) { /* get password from PAM system */
252 if (Args.auth_type != GET_PASS) { /* get password from PAM system */
242253 char *ptr = NULL;
243 ret = pam_get_item(pamh, PAM_AUTHTOK, static_cast(const void **,
244 static_cast(void *, &ptr)));
245 if(ret != PAM_SUCCESS || ptr == NULL) {
246 if (ret == PAM_SUCCESS && ptr == NULL)
247 ret = PAM_AUTHINFO_UNAVAIL;
248 l0g(PMPREFIX "could not get password from PAM system\n");
249 if(Args.auth_type == USE_FIRST_PASS)
250 goto _return;
251 } else
254 ret = pam_get_item(pamh, PAM_AUTHTOK, static_cast(const void **,
255 static_cast(void *, &ptr)));
256 if (ret != PAM_SUCCESS || ptr == NULL) {
257 if (ret == PAM_SUCCESS && ptr == NULL)
258 ret = PAM_AUTHINFO_UNAVAIL;
259 l0g("could not get password from PAM system\n");
260 if (Args.auth_type == USE_FIRST_PASS)
261 goto out;
262 } else {
252263 authtok = xstrdup(ptr);
253 }
254 if (!authtok) { /* get password directly */
255 if((ret = read_password(pamh, "password:", &authtok)) != PAM_SUCCESS) {
256 l0g(PMPREFIX "error trying to read password\n");
257 goto _return;
258 }
259 /* p_s_i copies to PAM-internal memory */
260 if((ret = pam_set_item(pamh, PAM_AUTHTOK, authtok)) != PAM_SUCCESS) {
261 l0g(PMPREFIX "error trying to export password\n");
262 goto _return;
264 }
265 }
266 if (!readconfig(CONFIGFILE, 1, &Config)) {
267 ret = PAM_SERVICE_ERR;
268 goto out;
269 }
270 if (authtok == NULL) {
271 if (Args.auth_type == SOFT_TRY_PASS) {
272 ret = PAM_AUTHINFO_UNAVAIL;
273 goto out;
274 }
275 /* get password directly */
276 ret = read_password(pamh, Config.msg_authpw, &authtok);
277 if (ret != PAM_SUCCESS) {
278 l0g("error trying to read password\n");
279 goto out;
280 }
281 /* pam_set_item() copies to PAM-internal memory */
282 ret = pam_set_item(pamh, PAM_AUTHTOK, authtok);
283 if (ret != PAM_SUCCESS) {
284 l0g("error trying to export password\n");
285 goto out;
263286 }
264287 }
265288 if (strlen(authtok) > MAX_PAR) {
266 l0g(PMPREFIX "password too long\n");
289 l0g("password too long\n");
267290 ret = PAM_AUTH_ERR;
268 goto _return;
269 }
270 w4rn(PMPREFIX "saving authtok for session code\n");
271 ret = pam_set_data(pamh, "pam_mount_system_authtok", authtok,
272 clean_system_authtok);
273 if(ret != PAM_SUCCESS) {
274 l0g(PMPREFIX "error trying to save authtok for session code\n");
275 goto _return;
276 }
277 _return:
278 assert(ret != PAM_SUCCESS
279 || pam_get_data(pamh, "pam_mount_system_authtok",
280 &tmp) == PAM_SUCCESS);
291 goto out;
292 }
293 w4rn("saving authtok for session code\n");
294 ret = pam_set_data(pamh, "pam_mount_system_authtok", authtok,
295 clean_system_authtok);
296 if (ret != PAM_SUCCESS) {
297 l0g("error trying to save authtok for session code\n");
298 goto out;
299 }
300 out:
301 assert(ret != PAM_SUCCESS ||
302 pam_get_data(pamh, "pam_mount_system_authtok", &tmp) ==
303 PAM_SUCCESS);
281304 assert(ret != PAM_SUCCESS || tmp != NULL);
282
283305 return ret;
284306 }
285307
286
287 /* modify_pm_count
288 @config:
289 @user:
290 @operation: string specifying numerical increment
291
292 Calls out to the `pmvarrun` helper utility to adjust the mount reference
293 count in /var/run/pam_mount/@user for the specified user.
294 Returns the new reference count value on success, or -1 on error.
295
296 Note: Modified version of pam_console.c:use_count()
297 */
308 /*
309 * modify_pm_count -
310 * @config:
311 * @user:
312 * @operation: string specifying numerical increment
313 *
314 * Calls out to the `pmvarrun` helper utility to adjust the mount reference
315 * count in /var/run/pam_mount/@user for the specified user.
316 * Returns the new reference count value on success, or -1 on error.
317 *
318 * Note: Modified version of pam_console.c:use_count()
319 */
298320 static int modify_pm_count(struct config *config, char *user,
299 char *operation)
321 char *operation)
300322 {
301323 FILE *fp;
302 GError *err;
303 struct fmt_ptrn vinfo;
304 int _argc = 0, child_exit, cstdout = -1, fnval = -1, i;
324 GError *err = NULL;
325 struct HXbtree *vinfo;
326 int _argc = 0, child_exit, cstdout = -1, fnval = -1;
305327 const char *_argv[MAX_PAR + 1];
306328 pid_t pid;
307329 struct sigaction sact, oldsact;
308
309 assert(config_valid(config));
310 assert(user != NULL);
311 assert(operation != NULL);
330 unsigned int i;
331
332 assert(config_valid(config));
333 assert(user != NULL);
334 assert(operation != NULL);
312335
313336 /* avoid bomb on command exiting before count read */
314337 sact.sa_handler = SIG_DFL;
315338 sact.sa_flags = 0;
316 sigemptyset(&sact.sa_mask);
317 if (sigaction(SIGPIPE, &sact, &oldsact) == -1) {
339 sigemptyset(&sact.sa_mask);
340 if (sigaction(SIGPIPE, &sact, &oldsact) < 0) {
318341 fnval = -1;
319 goto _nosigact_return;
320 }
321 fmt_ptrn_init(&vinfo);
322 fmt_ptrn_update_kv(&vinfo, "USER", user);
323 fmt_ptrn_update_kv(&vinfo, "OPERATION", operation);
324 for(i = 0; config->command[i][PMVARRUN] != NULL; i++)
325 add_to_argv(_argv, &_argc, config->command[i][PMVARRUN], &vinfo);
326 fmt_ptrn_close(&vinfo);
342 goto nosigactout;
343 }
344 vinfo = HXformat_init();
345 format_add(vinfo, "USER", user);
346 format_add(vinfo, "OPERATION", operation);
347 misc_add_ntdom(vinfo, user);
348
349 for (i = 0; config->command[CMD_PMVARRUN][i] != NULL; ++i)
350 add_to_argv(_argv, &_argc,
351 config->command[CMD_PMVARRUN][i], vinfo);
352 HXformat_free(vinfo);
327353 log_argv(_argv);
328354
329 if(!spawn_apS(NULL, _argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, set_myuid,
330 NULL, &pid, NULL, &cstdout, NULL, &err)) {
331 l0g(PMPREFIX "error executing /usr/sbin/pmvarrun\n");
355 if (!spawn_apS(NULL, _argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, set_myuid,
356 NULL, &pid, NULL, &cstdout, NULL, &err)) {
357 l0g("error executing pmvarrun\n");
332358 fnval = -1;
333 goto _return;
359 goto out;
334360 }
335361 if ((fp = fdopen(cstdout, "r")) == NULL) {
336 spawn_restore_sigchld();
337 w4rn(PMPREFIX "error opening file: %s\n", strerror(errno));
362 spawn_restore_sigchld();
363 w4rn("error opening file: %s\n", strerror(errno));
338364 fnval = -1;
339 goto _return;
340 }
341 if (fscanf(fp, "%d", &fnval) == 0) {
342 spawn_restore_sigchld();
343 w4rn(PMPREFIX "error reading login count from pmvarrun\n");
365 goto out;
366 }
367 if (fscanf(fp, "%d", &fnval) != 1) {
368 spawn_restore_sigchld();
369 w4rn("error reading login count from pmvarrun\n");
344370 fnval = -1;
345 goto _return;
346 }
347 if (waitpid(pid, &child_exit, 0) == -1) {
348 spawn_restore_sigchld();
349 l0g(PMPREFIX "error waiting for child: %s\n", strerror(errno));
371 goto out;
372 }
373 if (waitpid(pid, &child_exit, 0) < 0) {
374 spawn_restore_sigchld();
375 l0g("error waiting for child: %s\n", strerror(errno));
350376 fnval = -1;
351 goto _return;
352 }
353 spawn_restore_sigchld();
377 goto out;
378 }
379 spawn_restore_sigchld();
354380 if (WEXITSTATUS(child_exit)) {
355 l0g(PMPREFIX "pmvarrun failed\n");
381 l0g("pmvarrun failed\n");
356382 fnval = -1;
357 goto _return;
358 }
359 w4rn(PMPREFIX "pmvarrun says login count is %d\n", fnval);
360 _return:
383 goto out;
384 }
385 w4rn("pmvarrun says login count is %d\n", fnval);
386 out:
361387 sigaction(SIGPIPE, &oldsact, NULL);
362 _nosigact_return:
363
364 assert(config_valid(config));
388 nosigactout:
389
390 assert(config_valid(config));
365391 return fnval;
366392 }
367393
368
369 /* pam_sm_open_session
370 @pamh: PAM handle
371 @flags: PAM flags
372 @argc: number of elements in @argv
373 @argv: NULL-terminated argument vector
374
375 Entrypoint from the PAM layer. Starts the wheels and eventually mounts the
376 user's directories according to pam_mount.conf. Returns the PAM error code
377 or %PAM_SUCCESS.
378 */
394 /*
395 * pam_sm_open_session -
396 * @pamh: PAM handle
397 * @flags: PAM flags
398 * @argc: number of elements in @argv
399 * @argv: NULL-terminated argument vector
400 *
401 * Entrypoint from the PAM layer. Starts the wheels and eventually mounts the
402 * user's directories according to pam_mount.conf.xml. Returns the PAM error
403 * code or %PAM_SUCCESS.
404 */
379405 PAM_EXTERN EXPORT_SYMBOL int pam_sm_open_session(pam_handle_t *pamh, int flags,
380 int argc, const char **argv)
406 int argc, const char **argv)
381407 {
382408 int vol;
383409 int ret = PAM_SUCCESS;
410 unsigned int krb5_set;
384411 char *system_authtok;
385412 const char *pam_user = NULL;
386 const void *tmp;
387 int getval;
413 const void *tmp;
414 int getval;
388415
389416 assert(pamh != NULL);
390417
391418 initconfig(&Config);
392 /* call pam_get_user again because ssh calls PAM fns from seperate
419 parse_pam_args(argc, argv);
420 /*
421 * call pam_get_user again because ssh calls PAM fns from seperate
393422 * processes.
394423 */
395 if ((ret = pam_get_user(pamh, &pam_user, NULL)) != PAM_SUCCESS) {
396 l0g(PMPREFIX "could not get user");
397 /* do NOT return PAM_SERVICE_ERR or root will not be able
398 * to su to other users */
399 goto _return;
400 }
401 /* FIXME: free me! the dup is requried because result of pam_get_user disappears (valgrind) */
424 ret = pam_get_user(pamh, &pam_user, NULL);
425 if (ret != PAM_SUCCESS) {
426 l0g("could not get user");
427 /*
428 * do NOT return %PAM_SERVICE_ERR or root will not be able to
429 * su to other users.
430 */
431 goto out;
432 }
433 /*
434 * FIXME: free me! the dup is requried because result of pam_get_user()
435 * disappears (valgrind)
436 */
402437 Config.user = relookup_user(pam_user);
403 if(strlen(Config.user) > MAX_PAR) {
404 l0g(PMPREFIX "username %s is too long\n", Config.user);
438 if (strlen(Config.user) > MAX_PAR) {
439 l0g("username %s is too long\n", Config.user);
405440 ret = PAM_SERVICE_ERR;
406 goto _return;
407 }
408
409 ret = pam_get_data(pamh, "pam_mount_system_authtok",
410 static_cast(const void **, static_cast(void *, &system_authtok)));
411 if(ret != PAM_SUCCESS) {
412 l0g(PMPREFIX "error trying to retrieve authtok from auth code\n");
413 ret = read_password(pamh, "reenter password:", &system_authtok);
414 if(ret != PAM_SUCCESS) {
415 l0g(PMPREFIX "error trying to read password\n");
416 goto _return;
417 }
418
419 }
420 if(!readconfig(Config.user, CONFIGFILE, 1, &Config)) {
441 goto out;
442 }
443
444 if (!readconfig(CONFIGFILE, 1, &Config)) {
421445 ret = PAM_SERVICE_ERR;
422 goto _return;
423 }
424
425 /* Get the Kerberos CCNAME so we can make it available to the
426 mount command later on. */
427 if(setenv("KRB5CCNAME", pam_getenv(pamh, "KRB5CCNAME"), 1) < 0)
428 l0g(PMPREFIX "KRB5CCNAME setenv failed\n");
429
430 // Store initialized config as PAM data
431 if((getval = pam_get_data(pamh, "pam_mount_config",
432 &tmp)) == PAM_NO_MODULE_DATA && (ret = pam_set_data(pamh,
433 "pam_mount_config", &Config, clean_config)) != PAM_SUCCESS) {
434 l0g(PMPREFIX "error trying to save config structure\n");
435 goto _return;
436 }
437
438 w4rn(PMPREFIX "back from global readconfig\n");
439 if(strlen(Config.luserconf) == 0)
440 w4rn(PMPREFIX "per-user configurations not allowed by pam_mount.conf\n");
441 else if(exists(Config.luserconf) && owns(Config.user, Config.luserconf)) {
442 w4rn(PMPREFIX "going to readconfig user\n");
443 if(!readconfig(Config.user, Config.luserconf, 0, &Config)) {
446 goto out;
447 }
448
449 ret = pam_get_data(pamh, "pam_mount_system_authtok",
450 static_cast(const void **, static_cast(void *, &system_authtok)));
451 if (ret != PAM_SUCCESS) {
452 if (Args.auth_type == SOFT_TRY_PASS) {
453 ret = PAM_AUTHINFO_UNAVAIL;
454 goto out;
455 }
456 l0g("error trying to retrieve authtok from auth code\n");
457 ret = read_password(pamh, Config.msg_sessionpw, &system_authtok);
458 if (ret != PAM_SUCCESS) {
459 l0g("error trying to read password\n");
460 goto out;
461 }
462
463 }
464
465 /*
466 * Get the Kerberos CCNAME so we can make it available to the
467 * mount command later on.
468 */
469 krb5_set = getenv("KRB5CCNAME") != NULL;
470 if (setenv("KRB5CCNAME", pam_getenv(pamh, "KRB5CCNAME"), 1) < 0)
471 l0g("KRB5CCNAME setenv failed\n");
472
473 /* Store initialized config as PAM data */
474 getval = pam_get_data(pamh, "pam_mount_config", &tmp);
475 if (getval == PAM_NO_MODULE_DATA) {
476 ret = pam_set_data(pamh, "pam_mount_config",
477 &Config, clean_config);
478 if (ret != PAM_SUCCESS) {
479 l0g("error trying to save config structure\n");
480 goto out;
481 }
482 }
483
484 w4rn("back from global readconfig\n");
485 if (strlen(Config.luserconf) == 0)
486 w4rn("per-user configurations not allowed by pam_mount.conf.xml\n");
487 else if (exists(Config.luserconf) && owns(Config.user, Config.luserconf)) {
488 w4rn("going to readconfig user\n");
489 if (!readconfig(Config.luserconf, 0, &Config)) {
444490 ret = PAM_SERVICE_ERR;
445 goto _return;
446 }
447 w4rn(PMPREFIX "back from user readconfig\n");
491 goto out;
492 }
493 w4rn("back from user readconfig\n");
448494 } else
449 w4rn(PMPREFIX "%s does not exist or is not owned by user\n",
450 Config.luserconf);
451 if(Config.volcount <= 0)
452 w4rn(PMPREFIX "no volumes to mount\n");
453 if(!expandconfig(&Config)) {
454 l0g(PMPREFIX "error expanding configuration\n");
495 w4rn("%s does not exist or is not owned by user\n",
496 Config.luserconf);
497 if (Config.volcount <= 0) {
498 w4rn("no volumes to mount\n");
499 goto out;
500 }
501 if (!expandconfig(&Config)) {
502 l0g("error expanding configuration\n");
455503 ret = PAM_SERVICE_ERR;
456 goto _return;
457 }
458 w4rn(PMPREFIX "%s: real uid/gid=%ld:%ld, effective uid/gid=%ld:%ld\n",
459 __FUNCTION__, static_cast(long, getuid()),
460 static_cast(long, getgid()), static_cast(long, geteuid()),
461 static_cast(long, getegid()));
462 /* This code needs root priv. */
463 for(vol = 0; vol < Config.volcount; vol++) {
464 /* luserconf_volume_record_sane() is called here so that
465 * a user can nest loopback images. otherwise ownership
466 * tests will fail if parent loopback image not yet
467 * mounted. volume_record_sane() is here to be consistent */
468 if(!volume_record_sane(&Config, vol))
504 goto out;
505 }
506 w4rn("%s(pre): (uid=%ld, euid=%ld, gid=%ld, egid=%ld)\n", __func__,
507 static_cast(long, getuid()), static_cast(long, geteuid()),
508 static_cast(long, getgid()), static_cast(long, getegid()));
509
510 /* This code needs root priv. */
511 for (vol = 0; vol < Config.volcount; ++vol) {
512 /*
513 * luserconf_volume_record_sane() is called here so that a user
514 * can nest loopback images. otherwise ownership tests will
515 * fail if parent loopback image not yet mounted.
516 * volume_record_sane() is here to be consistent.
517 */
518 if (!volume_record_sane(&Config, vol))
469519 continue;
470 if(!Config.volume[vol].globalconf &&
471 !luserconf_volume_record_sane(&Config, vol))
520 if (!Config.volume[vol].globalconf &&
521 !luserconf_volume_record_sane(&Config, vol))
472522 continue;
473 w4rn(PMPREFIX "about to perform mount operations\n");
474
475 if(!mount_op(do_mount, &Config, vol, system_authtok,
476 Config.mkmntpoint)) {
477 l0g(PMPREFIX "mount of %s failed\n",
478 Config.volume[vol].volume);
479 ret = PAM_SERVICE_ERR;
480 }
481 }
482 /* end root priv. */
523 w4rn("about to perform mount operations\n");
524
525 if (!mount_op(do_mount, &Config, vol, system_authtok)) {
526 l0g("mount of %s failed\n", Config.volume[vol].volume);
527 ret = PAM_SERVICE_ERR;
528 }
529 }
530 /* end root priv. */
483531 /* Paranoia? */
484532 clean_system_authtok(pamh, system_authtok, 0);
485 /* This code needs root priv. */
533 if (krb5_set)
534 unsetenv("KRB5CCNAME");
535 /* This code needs root priv. */
486536 modify_pm_count(&Config, Config.user, "1");
487 /* end root priv. */
488
489 _return:
490 w4rn(PMPREFIX "done opening session\n");
537 /* end root priv. */
538 out:
539 w4rn("done opening session (ret=%d)\n", ret);
491540 return ret;
492541 }
493542
494
495 /* pam_sm_chauthtok
496 @pamh: PAM handle
497 @flags: PAM flags
498 @argc: number of elements in @argv
499 @argv: NULL-terminated argument vector
500
501 This is a placeholder function so PAM does not get mad.
502 */
543 /*
544 * pam_sm_chauthtok -
545 * @pamh: PAM handle
546 * @flags: PAM flags
547 * @argc: number of elements in @argv
548 * @argv: NULL-terminated argument vector
549 *
550 * This is a placeholder function so PAM does not get mad.
551 */
503552 PAM_EXTERN EXPORT_SYMBOL int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
504 int argc, const char **argv)
553 int argc, const char **argv)
505554 {
506555 return pam_sm_authenticate(pamh, flags, argc, argv);
507556 }
508557
509
510 /* pam_sm_close_session
511 @pamh: PAM handle
512 @flags: PAM flags
513 @argc: number of elements in @argv
514 @argv: NULL-terminated argument vector
515
516 Entrypoint from the PAM layer. Stops all wheels and eventually unmounts the
517 user's directories. Returns the PAM error code or %PAM_SUCCESS.
518
519 FIXME: This function currently always returns %PAM_SUCCESS. Should it
520 return soemthing else when errors occur and all unmounts have been
521 attempted?
522 */
558 /*
559 * pam_sm_close_session -
560 * @pamh: PAM handle
561 * @flags: PAM flags
562 * @argc: number of elements in @argv
563 * @argv: NULL-terminated argument vector
564 *
565 * Entrypoint from the PAM layer. Stops all wheels and eventually unmounts the
566 * user's directories. Returns the PAM error code or %PAM_SUCCESS.
567 *
568 * FIXME: This function currently always returns %PAM_SUCCESS. Should it
569 * return soemthing else when errors occur and all unmounts have been
570 * attempted?
571 */
523572 PAM_EXTERN EXPORT_SYMBOL int pam_sm_close_session(pam_handle_t *pamh,
524 int flags, int argc, const char **argv)
573 int flags, int argc, const char **argv)
525574 {
526575 int vol;
527576 int ret = PAM_SUCCESS;
529578
530579 assert(pamh != NULL);
531580
532 w4rn(PMPREFIX "received order to close things\n");
533 w4rn(PMPREFIX "real and effective user ID are %d and %d.\n",
534 getuid(), geteuid());
535 /* call pam_get_user again because ssh calls PAM fns from seperate
581 w4rn("received order to close things\n");
582 w4rn("%s(pre): (uid=%ld, euid=%ld, gid=%ld, egid=%ld)\n", __func__,
583 static_cast(long, getuid()), static_cast(long, geteuid()),
584 static_cast(long, getgid()), static_cast(long, getegid()));
585 /*
586 * call pam_get_user() again because ssh calls PAM fns from seperate
536587 * processes.
537588 */
538 if ((ret = pam_get_user(pamh, &pam_user, NULL)) != PAM_SUCCESS) {
539 l0g(PMPREFIX "could not get user\n");
540 /* do NOT return PAM_SERVICE_ERR or root will not be able
541 * to su to other users */
542 goto _return;
543 }
544 /* FIXME: free me! the dup is requried because result of pam_get_user disappears (valgrind) */
589 ret = pam_get_user(pamh, &pam_user, NULL);
590 if (ret != PAM_SUCCESS) {
591 l0g("could not get user\n");
592 /*
593 * do NOT return %PAM_SERVICE_ERR or root will not be able to
594 * su to other users.
595 */
596 goto out;
597 }
598 /*
599 * FIXME: free me! the dup is requried because result of pam_get_user
600 * disappears (valgrind)
601 */
545602 Config.user = relookup_user(pam_user);
546603 /* if our CWD is in the home directory, it might not get umounted */
547 if(chdir("/") != 0)
548 l0g(PMPREFIX "could not chdir\n");
549 if(Config.volcount <= 0)
550 w4rn(PMPREFIX "volcount is zero\n");
551 /* This code needs root priv. */
552 if(modify_pm_count(&Config, Config.user, "-1") <= 0) {
604 if (chdir("/") != 0)
605 l0g("could not chdir\n");
606 if (Config.volcount <= 0)
607 w4rn("volcount is zero\n");
608 /* This code needs root priv. */
609 if (modify_pm_count(&Config, Config.user, "-1") <= 0) {
553610 /* Unmount in reverse order to facilitate nested mounting. */
554 for(vol = Config.volcount - 1; vol >= 0; vol--) {
555 w4rn(PMPREFIX "going to unmount\n");
556 if(!mount_op(do_unmount, &Config, vol, NULL, Config.mkmntpoint))
557 l0g(PMPREFIX "unmount of %s failed\n", Config.volume[vol].volume);
558 }
559 /* end root priv. */
611 for (vol = Config.volcount - 1; vol >= 0; --vol) {
612 w4rn("going to unmount\n");
613 if (!mount_op(do_unmount, &Config, vol, NULL))
614 l0g("unmount of %s failed\n",
615 Config.volume[vol].volume);
616 }
617 /* end root priv. */
560618 } else {
561 w4rn(PMPREFIX "%s seems to have other remaining open sessions\n",
562 Config.user);
563 }
564 _return:
565 // Note that PMConfig is automatically freed later in clean_config().
566 w4rn(PMPREFIX "pam_mount execution complete\n");
619 w4rn("%s seems to have other remaining open sessions\n",
620 Config.user);
621 }
622 out:
623 /*
624 * Note that PMConfig is automatically freed later in clean_config()
625 */
626 w4rn("pam_mount execution complete\n");
567627 return ret;
568628 }
569629
570
571 /* pam_sm_setcred
572 @pamh: PAM handle
573 @flags: PAM flags
574 @argc: number of elements in @argv
575 @argv: NULL-terminated argument vector
576
577 This is a placeholder function so PAM does not get mad.
578 */
630 /*
631 * pam_sm_setcred -
632 * @pamh: PAM handle
633 * @flags: PAM flags
634 * @argc: number of elements in @argv
635 * @argv: NULL-terminated argument vector
636 *
637 * This is a placeholder function so PAM does not get mad.
638 */
579639 PAM_EXTERN EXPORT_SYMBOL int pam_sm_setcred(pam_handle_t *pamh, int flags,
580 int argc, const char **argv)
640 int argc, const char **argv)
581641 {
582642 return PAM_SUCCESS;
583643 }
584644
585
586 /* pam_sm_acct_mgmt
587 @pamh: PAM handle
588 @flags: PAM flags
589 @argc: number of elements in @argv
590 @argv: NULL-terminated argument vector
591
592 This is a placeholder function so PAM does not get mad.
593 */
645 /*
646 * pam_sm_acct_mgmt -
647 * @pamh: PAM handle
648 * @flags: PAM flags
649 * @argc: number of elements in @argv
650 * @argv: NULL-terminated argument vector
651 *
652 * This is a placeholder function so PAM does not get mad.
653 */
594654 PAM_EXTERN EXPORT_SYMBOL int pam_sm_acct_mgmt(pam_handle_t *pamh, int flags,
595 int argc, const char **argv)
596 {
597 return PAM_IGNORE;
655 int argc, const char **argv)
656 {
657 return PAM_IGNORE;
598658 }
599659
600660 #ifdef PAM_STATIC
601661 /* static module data */
602662
603663 EXPORT_SYMBOL struct pam_module _pam_mount_modstruct = {
604 .name = "pam_mount",
605 .pam_sm_authenticate = pam_sm_authenticate,
606 .pam_sm_setcred = pam_sm_setcred,
607 .pam_sm_acct_mgmt = pam_sm_acct_mgmt,
608 .pam_sm_open_sesion = pam_sm_open_session,
609 .pam_sm_close_session = pam_sm_close_session,
610 .pam_sm_chauthtok = pam_sm_chauthtok,
664 .name = "pam_mount",
665 .pam_sm_authenticate = pam_sm_authenticate,
666 .pam_sm_setcred = pam_sm_setcred,
667 .pam_sm_acct_mgmt = pam_sm_acct_mgmt,
668 .pam_sm_open_sesion = pam_sm_open_session,
669 .pam_sm_close_session = pam_sm_close_session,
670 .pam_sm_chauthtok = pam_sm_chauthtok,
611671 };
612672
613673 #endif
0 /*=============================================================================
1 pam_mount.h
2 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of
7 the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to:
16 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 Boston, MA 02110-1301 USA
18
19 -- For details, see the file named "LICENSE.LGPL2"
20 =============================================================================*/
210 #ifndef PMT_PAM_MOUNT_H
221 #define PMT_PAM_MOUNT_H 1
232
243 #include <glib.h>
254
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
305 struct config;
31 struct pam_args;
326
337 enum auth_type {
34 GET_PASS,
35 USE_FIRST_PASS,
36 TRY_FIRST_PASS
8 GET_PASS,
9 USE_FIRST_PASS,
10 TRY_FIRST_PASS,
11 SOFT_TRY_PASS,
3712 };
3813
3914 struct pam_args {
40 enum auth_type auth_type;
15 enum auth_type auth_type;
4116 };
4217
4318 /*
44 * PAM_MOUNT.C
19 * PAM_MOUNT.C
4520 */
46 #if defined(__GNUC__) && __GNUC__ < 4
47 # define Debug pmt_debug
21 #ifndef HAVE_VISIBILITY_HIDDEN
22 /* Workaround Xserver issue */
23 # define Debug pmt_debug
4824 #endif
4925 extern int Debug;
5026 extern struct config Config;
5127 extern struct pam_args Args;
5228
53 #ifdef __cplusplus
54 } // extern "C"
55 #endif
56
57 #endif // PMT_PAM_MOUNT_H
58
59 //=============================================================================
29 #endif /* PMT_PAM_MOUNT_H */
00 /*=============================================================================
1 pmvarrun.c
1 pam_mount - pmvarrun.c
22 Copyright (C) W. Michael Putello <mike@flyn.org>, 2004
3 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
3 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2007
44 Copyright © Bastian Kleineidam <calvin [at] debian org>, 2005
55
66 This program is free software; you can redistribute it and/or modify
4141 #include <pwd.h>
4242 #include "compiler.h"
4343 #include "misc.h"
44 #include "pam_mount.h" // Debug workaround
44 #include "pam_mount.h" /* @Debug workaround */
4545 #include "private.h"
4646
47 // Definitions
47 /* Definitions */
48 #undef PMPREFIX
49 #define PMPREFIX "pmvarrun: "
4850 #define ASCIIZ_LLX sizeof("0xFFFFFFFF""FFFFFFFF")
49 #define PREFIX "pmvarrun: "
5051 #define VAR_RUN "/var/run"
5152 #define VAR_RUN_PMT VAR_RUN "/pam_mount"
5253
5556 long operation;
5657 };
5758
58 // Functions
59 /* Functions */
5960 static int create_var_run(void);
6061 static int modify_pm_count(const char *, long);
6162 static int open_and_lock(const char *, long);
6566 static void usage(int, const char *);
6667 static int write_count(int, long, const char *);
6768
68 // Variables
69 /* Variables */
6970 int Debug = 0;
7071
7172 //-----------------------------------------------------------------------------
72 /* usage
73 @exitcode: numeric value we will be exiting with
74 @error: descriptive error string
75
76 Displays the help string and an optional extra error message.
77 */
78 static void usage(const int exitcode, const char *error) {
79 fprintf(stderr, "Usage: pmvarrun -u USER [-o NUMBER] [-d]\n");
80 if(error != NULL)
81 fprintf(stderr, PREFIX ": %s\n\n", error);
82 exit(exitcode);
83 }
84
85
86 /* set_defaults
87 @settings: pointer to settings structure
88
89 Uh, sets some defaults.
90 */
91 static void set_defaults(struct settings *settings) {
92 *settings->user = '\0';
93 settings->operation = 1;
94 return;
95 }
96
97
98 /* parse_args
99 @argc: number of elements in @argv
100 @argv: NULL-terminated argument vector
101 @settings: pointer to settings structure
102
103 Parse options from @argv and put it into @settings.
104 */
105 static void parse_args(int argc, const char **argv,
106 struct settings *settings)
73 /*
74 * usage - display help
75 * @exitcode: numeric value we will be exiting with
76 * @error: descriptive error string
77 *
78 * Displays the help string and an optional extra error message.
79 */
80 static void usage(const int exitcode, const char *error)
81 {
82 fprintf(stderr, "Usage: pmvarrun -u USER [-o NUMBER] [-d]\n");
83 if (error != NULL)
84 fprintf(stderr, PMPREFIX ": %s\n\n", error);
85 exit(exitcode);
86 }
87
88 /*
89 * set_defaults -
90 * @settings: pointer to settings structure
91 */
92 static void set_defaults(struct settings *settings)
93 {
94 *settings->user = '\0';
95 settings->operation = 1;
96 return;
97 }
98
99 /*
100 * from https://vitalnix.svn.sourceforge.net/svnroot/vitalnix/
101 * /trunk/src/libvxutil/util.c
102 */
103 static int valid_username(const char *n)
104 {
105 if (*n == '\0')
106 return 0;
107 if (!((*n >= 'A' && *n <= 'Z') || (*n >= 'a' && *n <= 'z') ||
108 *n == '_'))
109 return 0;
110
111 while (*n != '\0') {
112 int valid;
113
114 if (*n == '$' && *(n+1) == '\0') /* Samba accounts */
115 return 1;
116
117 valid = (*n >= 'A' && *n <= 'Z') || (*n >= 'a' && *n <= 'z') ||
118 (*n >= '0' && *n <= '9') || *n == '_' || *n == '.' ||
119 *n == '-';
120 if (!valid)
121 return 0;
122 ++n;
123 }
124
125 return 1;
126 }
127
128 /*
129 * parse_args
130 * @argc: number of elements in @argv
131 * @argv: NULL-terminated argument vector
132 * @settings: pointer to settings structure
133 *
134 * Parse options from @argv and put it into @settings.
135 */
136 static void parse_args(int argc, const char **argv, struct settings *settings)
107137 {
108138 int c;
109 int opt_index = 0;
110 struct option opts[] = {
111 {"help", 0, 0, 'h'},
112 {"user", 1, 0, 'u'},
113 {"operation", 1, 0, 'o'},
114 {0, 0, 0, 0}
115 };
116 while((c = getopt_long(argc, reinterpret_cast(char * const *, argv),
117 "hdo:u:", opts, &opt_index)) >= 0) {
118 switch (c) {
139
140 while ((c = getopt(argc, reinterpret_cast(char * const *, argv),
141 "hdo:u:")) >= 0) {
142 switch (c) {
119143 case 'h':
120144 usage(EXIT_SUCCESS, NULL);
121 break;
145 break;
122146 case 'd':
123147 Debug = 1;
124148 break;
125149 case 'o':
126 if((settings->operation = str_to_long(optarg)) == LONG_MAX
127 || settings->operation == LONG_MIN)
128 usage(EXIT_FAILURE, "count string is not valid");
150 settings->operation = str_to_long(optarg);
151 if (settings->operation == LONG_MAX ||
152 settings->operation == LONG_MIN)
153 usage(EXIT_FAILURE, "count string is not valid");
129154 break;
130155 case 'u':
156 if (!valid_username(optarg)) {
157 fprintf(stderr, "Invalid user name\n");
158 exit(EXIT_FAILURE);
159 }
131160 g_strlcpy(settings->user, optarg,
132 sizeof(settings->user));
161 sizeof(settings->user));
133162 break;
134163 default:
135164 usage(EXIT_FAILURE, NULL);
136 break;
165 break;
137166 }
138167 }
139 return;
140 }
141
142
143 /* modify_pm_count
144 @user: user to poke on
145 @amount: increment (usually -1, 0 or +1)
146
147 Adjusts /var/run/pam_mount/@user by @amount, or deletes the file if the
148 resulting value (current + @amount) is <= 0. Returns >= 0 on success to
149 indicate the new login count, or negative to indicate errno. -ESTALE and
150 -EOVERFLOW are passed up from subfunctions and must be handled in the
151 caller.
152 */
153 static int modify_pm_count(const char *user, long amount) {
154 char filename[PATH_MAX + 1];
155 struct passwd *pent;
156 struct stat sb;
157 int fd, ret;
158 long val;
159
160 assert(user != NULL);
161
162 if((pent = getpwnam(user)) == NULL) {
163 ret = -errno;
164 l0g(PREFIX "could not resolve user %s\n", user);
165 return ret;
166 }
167
168 if(stat(VAR_RUN_PMT, &sb) != 0) {
169 if(errno != ENOENT) {
170 ret = -errno;
171 l0g(PREFIX "unable to stat " VAR_RUN_PMT ": %s\n", strerror(errno));
172 return ret;
173 }
174 if((ret = create_var_run()) < 0)
175 return ret;
176 }
177
178 snprintf(filename, sizeof(filename), VAR_RUN_PMT "/%s", user);
179 while((ret = fd = open_and_lock(filename, pent->pw_uid)) == -EAGAIN)
180 /* noop */;
181 if(ret < 0)
182 return ret;
183
184 if((val = read_current_count(fd, filename)) < 0) {
185 close(fd);
186 return val;
187 }
188
189 w4rn(PREFIX "parsed count value %ld\n", val);
190 /* amount == 0 implies query */
191 ret = 1;
192 if(amount != 0)
193 ret = write_count(fd, val + amount, filename);
194
195 close(fd);
196 return (ret < 0) ? ret : val + amount;
197 }
198
199 int main(int argc, const char **argv) {
200 struct settings settings;
201 int ret;
202
203 set_defaults(&settings);
204 parse_args(argc, argv, &settings);
205
206 if(strlen(settings.user) == 0)
207 usage(EXIT_FAILURE, NULL);
208
209 ret = modify_pm_count(settings.user, settings.operation);
210 if(ret == -ESTALE) {
211 printf("0\n");
212 return EXIT_SUCCESS;
213 } else if(ret < 0) {
214 return EXIT_FAILURE;
215 }
216
217 // print current count so pam_mount module may read it
218 printf("%d\n", ret);
219 return EXIT_SUCCESS;
168 return;
169 }
170
171 /*
172 * modify_pm_count -
173 * @user: user to poke on
174 * @amount: increment (usually -1, 0 or +1)
175 *
176 * Adjusts /var/run/pam_mount/@user by @amount, or deletes the file if the
177 * resulting value (current + @amount) is <= 0. Returns >= 0 on success to
178 * indicate the new login count, or negative to indicate errno. -ESTALE and
179 * -EOVERFLOW are passed up from subfunctions and must be handled in the
180 * caller.
181 */
182 static int modify_pm_count(const char *user, long amount)
183 {
184 char filename[PATH_MAX + 1];
185 struct passwd *pent;
186 struct stat sb;
187 int fd, ret;
188 long val;
189
190 assert(user != NULL);
191
192 if ((pent = getpwnam(user)) == NULL) {
193 ret = -errno;
194 l0g("could not resolve user %s\n", user);
195 return ret;
196 }
197
198 if (stat(VAR_RUN_PMT, &sb) < 0) {
199 if (errno != ENOENT) {
200 ret = -errno;
201 l0g("unable to stat " VAR_RUN_PMT ": %s\n",
202 strerror(errno));
203 return ret;
204 }
205 if ((ret = create_var_run()) < 0)
206 return ret;
207 }
208
209 snprintf(filename, sizeof(filename), VAR_RUN_PMT "/%s", user);
210 while ((ret = fd = open_and_lock(filename, pent->pw_uid)) == -EAGAIN)
211 /* noop */;
212 if (ret < 0)
213 return ret;
214
215 if ((val = read_current_count(fd, filename)) < 0) {
216 close(fd);
217 return val;
218 }
219
220 w4rn("parsed count value %ld\n", val);
221 /* amount == 0 implies query */
222 ret = 1;
223 if (amount != 0)
224 ret = write_count(fd, val + amount, filename);
225
226 close(fd);
227 return (ret < 0) ? ret : val + amount;
228 }
229
230 int main(int argc, const char **argv)
231 {
232 struct settings settings;
233 int ret;
234
235 set_defaults(&settings);
236 parse_args(argc, argv, &settings);
237
238 if (strlen(settings.user) == 0)
239 usage(EXIT_FAILURE, NULL);
240
241 ret = modify_pm_count(settings.user, settings.operation);
242 if (ret == -ESTALE) {
243 printf("0\n");
244 return EXIT_SUCCESS;
245 } else if (ret < 0) {
246 return EXIT_FAILURE;
247 }
248
249 /* print current count so pam_mount module may read it */
250 printf("%d\n", ret);
251 return EXIT_SUCCESS;
220252 }
221253
222254 //-----------------------------------------------------------------------------
223 /* create_var_run
224
225 Creates the /var/run/pam_mount directory required by pmvarrun and sets
226 proper permissions on it.
227
228 Returns >0 for success or <=0 to indicate errno.
229 */
230 static int create_var_run(void) {
231 int ret;
232
233 w4rn(PREFIX "creating " VAR_RUN_PMT);
234 if(mkdir(VAR_RUN_PMT, 0000) != 0) {
235 ret = -errno;
236 l0g(PREFIX "unable to create " VAR_RUN_PMT ": %s\n", strerror(errno));
237 return ret;
238 }
239
240 if(chown(VAR_RUN_PMT, 0, 0) != 0) {
241 ret = -errno;
242 l0g(PREFIX "unable to chown " VAR_RUN_PMT ": %s\n", strerror(errno));
243 return ret;
244 }
245
246 /* 0755: `su` creates file group owned by user and the releases root
247 permissions. User needs to be able to access file on logout. */
248
249 if(chmod(VAR_RUN_PMT, S_IRWXU | S_IRXG | S_IRXO) != 0) {
250 ret = -errno;
251 l0g(PREFIX "unable to chmod " VAR_RUN_PMT ": %s\n", strerror(errno));
252 return ret;
253 }
254
255 return 1;
256 }
257
258
259 /* open_and_lock
260 @filename: file to open
261
262 Creates if necessary, opens and chown()s @filename, and locks it.
263 Returns the fd if all of that succeeded, -EAGAIN if the file was unlinked
264 during operation (see below), -ESTALE if the lock could not be obtained,
265 and <0 otherwise to indicate errno.
266 */
255 /*
256 * create_var_run
257 *
258 * Creates the /var/run/pam_mount directory required by pmvarrun and sets
259 * proper permissions on it.
260 *
261 * Returns >0 for success or <=0 to indicate errno.
262 */
263 static int create_var_run(void)
264 {
265 int ret;
266
267 w4rn("creating " VAR_RUN_PMT);
268 if (mkdir(VAR_RUN_PMT, 0000) < 0) {
269 ret = -errno;
270 l0g("unable to create " VAR_RUN_PMT ": %s\n", strerror(errno));
271 return ret;
272 }
273 if (chown(VAR_RUN_PMT, 0, 0) < 0) {
274 ret = -errno;
275 l0g("unable to chown " VAR_RUN_PMT ": %s\n", strerror(errno));
276 return ret;
277 }
278
279 /*
280 * 0755: `su` creates file group owned by user and then releases root
281 * permissions. User needs to be able to access file on logout.
282 */
283 if (chmod(VAR_RUN_PMT, S_IRWXU | S_IRXG | S_IRXO) < 0) {
284 ret = -errno;
285 l0g("unable to chmod " VAR_RUN_PMT ": %s\n", strerror(errno));
286 return ret;
287 }
288
289 return 1;
290 }
291
292 /*
293 * open_and_lock -
294 * @filename: file to open
295 *
296 * Creates if necessary, opens and chown()s @filename, and locks it.
297 * Returns the fd if all of that succeeded, -EAGAIN if the file was unlinked
298 * during operation (see below), -ESTALE if the lock could not be obtained,
299 * and <0 otherwise to indicate errno.
300 */
267301 static int open_and_lock(const char *filename, long uid) {
268 struct flock lockinfo = {
269 .l_type = F_WRLCK,
270 .l_whence = SEEK_SET,
271 .l_start = 0,
272 .l_len = 0,
273 };
274 struct stat sb;
275 int fd, ret;
276
277 if((fd = open(filename, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR)) < 0) {
278 ret = -errno;
279 l0g(PREFIX "unable to open %s: %s\n", filename, strerror(errno));
280 return ret;
281 }
282 if((fchown(fd, uid, 0)) != 0) {
283 ret = -errno;
284 l0g(PREFIX "unable to chown %s: %s\n", filename, strerror(errno));
285 return ret;
286 }
287
288 /* Note: Waiting too long might interfere with LOGIN_TIMEOUT from
289 /etc/login.defs, and /bin/login itself may prematurely kill the session. */
290 alarm(20);
291 ret = fcntl(fd, F_SETLKW, &lockinfo);
292 alarm(0);
293 if(ret == EAGAIN) {
294 /* [Flyn] If someone has locked the file and not written to it in at
295 least 20 seconds, we assume they either forgot to unlock it or are
296 catatonic -- chances are slim that they are in the middle of a
297 read-write cycle and I do not want to make us lock users out. Perhaps
298 I should just return PAM_SUCCESS instead and log the event? Kill the
299 process holding the lock? Options abound... For now, we ignore it. */
300
301 /* [Jen] pmvarrun is the only one ever writing to that file, and we
302 keep the lock as short as possible. So if there is no response within
303 the time limit, something is fouled up (e.g. NFS server not
304 responding - though /var/run should at best not be on an NFS mount).
305 Continue, let user log in, do not change anything. */
306
307 w4rn(PREFIX "stale lock on file %s - continuing without increasing"
308 "pam_mount reference count\n", filename);
309 close(fd);
310 return -ESTALE;
311 }
312
313 /* It is possible at this point that the file has been removed by a
314 previous login; if this happens, we need to start over. */
315 if(stat(filename, &sb) != 0) {
316 ret = -errno;
317 close(fd);
318 if(ret == -ENOENT)
319 return -EAGAIN;
320 return ret;
321 }
322
323 return fd;
324 }
325
326
327 /* read_current_count
328 @fd: file descriptor to read from
329
330 Reads the current user's reference count from @fd and returns the value
331 on success. Otherwise, returns -EOVERFLOW in case we suspect a problem or
332 <0 to indicate errno.
333 */
302 struct flock lockinfo = {
303 .l_type = F_WRLCK,
304 .l_whence = SEEK_SET,
305 .l_start = 0,
306 .l_len = 0,
307 };
308 struct stat sb;
309 int fd, ret;
310
311 if ((fd = open(filename, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR)) < 0) {
312 ret = -errno;
313 l0g("unable to open %s: %s\n", filename, strerror(errno));
314 return ret;
315 }
316 if (fchown(fd, uid, 0) < 0) {
317 ret = -errno;
318 l0g("unable to chown %s: %s\n", filename, strerror(errno));
319 return ret;
320 }
321
322 /*
323 * Note: Waiting too long might interfere with LOGIN_TIMEOUT from
324 * /etc/login.defs, and /bin/login itself may prematurely kill the
325 * /session.
326 */
327 alarm(20);
328 ret = fcntl(fd, F_SETLKW, &lockinfo);
329 alarm(0);
330 if (ret == EAGAIN) {
331 /*
332 * [Flyn] If someone has locked the file and not written to it
333 * in at least 20 seconds, we assume they either forgot to
334 * unlock it or are catatonic -- chances are slim that they are
335 * in the middle of a read-write cycle and I do not want to
336 * make us lock users out. Perhaps I should just return
337 * %PAM_SUCCESS instead and log the event? Kill the process
338 * holding the lock? Options abound... For now, we ignore it.
339 *
340 * [CCJ] pmvarrun is the only one ever writing to that file,
341 * and we keep the lock as short as possible. So if there is no
342 * response within the time limit, something is fouled up (e.g.
343 * NFS server not responding -- though /var/run should at best
344 * not be on an NFS mount). Continue, let user log in, do not
345 * change anything.
346 */
347 w4rn("stale lock on file %s - continuing without increasing"
348 "pam_mount reference count\n", filename);
349 close(fd);
350 return -ESTALE;
351 }
352
353 /*
354 * It is possible at this point that the file has been removed by a
355 * previous login; if this happens, we need to start over.
356 */
357 if (stat(filename, &sb) < 0) {
358 ret = -errno;
359 close(fd);
360 if (ret == -ENOENT)
361 return -EAGAIN;
362 return ret;
363 }
364
365 return fd;
366 }
367
368 /*
369 * read_current_count -
370 * @fd: file descriptor to read from
371 *
372 * Reads the current user's reference count from @fd and returns the value
373 * on success. Otherwise, returns -EOVERFLOW in case we suspect a problem or
374 * <0 to indicate errno.
375 */
334376 static long read_current_count(int fd, const char *filename) {
335 char buf[ASCIIZ_LLX] = {};
336 long ret;
337
338 if((ret = read(fd, buf, sizeof(buf))) < 0) {
339 ret = -errno;
340 l0g(PREFIX "read error on %s: %s\n", filename, strerror(errno));
341 close(fd);
342 return ret;
343 } else if(ret == 0) {
344 /* File is empty, ret is already 0 -- we are set. */
345 } else if(ret < sizeof(buf)) {
346 char *p;
347 if((ret = strtol(buf, &p, 0)) >= LONG_MAX || p == buf) {
348 l0g(PREFIX "parse problem / session count corrupt (overflow), "
349 "check your refcount file\n");
350 return -EOVERFLOW;
351 }
352 } else if(ret >= sizeof(buf)) {
353 l0g(PREFIX "session count corrupt (overflow)\n");
354 return -EOVERFLOW;
355 }
356
357 return ret;
358 }
359
360
361 /* write_count
362 @fd: file descriptor to write to
363 @nv: new value to write
364 @filename: filename, only used for l0g()
365
366 Writes @nv as a number in hexadecimal to the start of the file @fd and
367 truncates the file to the written length.
368 */
377 char buf[ASCIIZ_LLX] = {};
378 long ret;
379
380 if ((ret = read(fd, buf, sizeof(buf))) < 0) {
381 ret = -errno;
382 l0g("read error on %s: %s\n", filename, strerror(errno));
383 close(fd);
384 return ret;
385 } else if (ret == 0) {
386 /* File is empty, ret is already 0 -- we are set. */
387 } else if (ret < sizeof(buf)) {
388 char *p;
389 if ((ret = strtol(buf, &p, 0)) >= LONG_MAX || p == buf) {
390 l0g("parse problem / session count corrupt "
391 "(overflow), check your refcount file\n");
392 return -EOVERFLOW;
393 }
394 } else if (ret >= sizeof(buf)) {
395 l0g("session count corrupt (overflow)\n");
396 return -EOVERFLOW;
397 }
398
399 return ret;
400 }
401
402 /*
403 * write_count -
404 * @fd: file descriptor to write to
405 * @nv: new value to write
406 * @filename: filename, only used for l0g()
407 *
408 * Writes @nv as a number in hexadecimal to the start of the file @fd and
409 * truncates the file to the written length.
410 */
369411 static int write_count(int fd, long nv, const char *filename) {
370 char buf[ASCIIZ_LLX];
371 int wrt, len, ret;
372
373 if(nv <= 0 && unlink(filename) != 0) {
374 l0g(PREFIX "could not unlink %s: %s\n", filename, strerror(errno));
375 return 1; // let user log in
376 }
377
378 if((ret = lseek(fd, 0, SEEK_SET)) != 0) {
379 ret = -errno;
380 l0g(PREFIX, "failed to seek in %s: %s\n", filename, strerror(errno));
381 return ret;
382 }
383
384 len = snprintf(buf, sizeof(buf), "0x%lX", nv);
385 if((wrt = write(fd, buf, len)) != len) {
386 ret = -errno;
387 l0g(PREFIX "wrote %d of %d bytes; write error on %s: %s\n",
388 (wrt < 0) ? 0 : wrt, len, filename, strerror(errno));
389 close(fd);
390 return ret;
391 }
392
393 ftruncate(fd, len);
394 return 1;
412 char buf[ASCIIZ_LLX];
413 int wrt, len, ret;
414
415 if (nv <= 0 && unlink(filename) < 0) {
416 l0g("could not unlink %s: %s\n", filename, strerror(errno));
417 return 1; /* let user log in */
418 }
419
420 if ((ret = lseek(fd, 0, SEEK_SET)) != 0) {
421 ret = -errno;
422 l0g("failed to seek in %s: %s\n", filename, strerror(errno));
423 return ret;
424 }
425
426 len = snprintf(buf, sizeof(buf), "0x%lX", nv);
427 if ((wrt = write(fd, buf, len)) != len) {
428 ret = -errno;
429 l0g("wrote %d of %d bytes; write error on %s: %s\n",
430 (wrt < 0) ? 0 : wrt, len, filename, strerror(errno));
431 close(fd);
432 return ret;
433 }
434
435 ftruncate(fd, len);
436 return 1;
395437 }
396438
397439 //=============================================================================
0 /*=============================================================================
1 private.h
2 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of
7 the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to:
16 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 Boston, MA 02110-1301 USA
18
19 -- For details, see the file named "LICENSE.LGPL2"
20 =============================================================================*/
210 #ifndef PMT_PRIVATE_H
221 #define PMT_PRIVATE_H 1
232
3 #include <stdbool.h>
244 #include "optlist.h"
25 #include "xstdlib.h"
265
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 #define __STRINGIFY_EXPAND(s) #s
32 #define __STRINGIFY(s) __STRINGIFY_EXPAND(s)
33 #define CLOSE(a) do { if(close(a) == -1) { \
34 l0g("pam_mount: could not close fd: %s\n", strerror(errno)); \
35 l0g("pam_mount: %s\n", "I don't like failed system calls -- I quit"); \
36 exit(EXIT_FAILURE); \
37 } } while(0)
6 #define CLOSE(a) do { \
7 if(close(a) == -1) { \
8 l0g("pam_mount: could not close fd: %s\n", strerror(errno)); \
9 l0g("pam_mount: %s\n", "I don't like failed system calls -- I quit"); \
10 exit(EXIT_FAILURE); \
11 } \
12 } while(0)
3813 #define MAX_PAR 127
39 #define PMPREFIX "pam_mount(" __FILE__ ":" __STRINGIFY(__LINE__) ") "
4014 #ifndef S_IRUGO
41 # define S_IRUGO (S_IRUSR | S_IRGRP | S_IROTH)
15 # define S_IRUGO (S_IRUSR | S_IRGRP | S_IROTH)
4216 #endif
4317 #ifndef S_IRWXU
44 # define S_IRWXU (S_IRUSR | S_IWUSR | S_IWOTH)
18 # define S_IRWXU (S_IRUSR | S_IWUSR | S_IWOTH)
4519 #endif
4620 #ifndef S_IRXG
47 # define S_IRXG (S_IRGRP | S_IXGRP)
21 # define S_IRXG (S_IRGRP | S_IXGRP)
4822 #endif
4923 #ifndef S_IRXO
50 # define S_IRXO (S_IROTH | S_IXOTH)
24 # define S_IRXO (S_IROTH | S_IXOTH)
5125 #endif
26 #define sizeof_z(x) (sizeof(x) - 1)
5227
5328 enum command_type {
54 SMBMOUNT,
55 SMBUMOUNT,
56 CIFSMOUNT,
57 NCPMOUNT,
58 NCPUMOUNT,
59 FUSEMOUNT,
60 FUSEUMOUNT,
61 LCLMOUNT,
62 CRYPTMOUNT, // FIXME: hope to have this in util-linux (LCLMOUNT) some day
63 NFSMOUNT,
64 UMOUNT,
65 PMHELPER,
66 LSOF,
67 MNTAGAIN,
68 MNTCHECK,
69 FSCK,
70 LOSETUP,
71 UNLOSETUP,
72 PMVARRUN,
73 COMMAND_MAX,
29 CMD_SMBMOUNT,
30 CMD_SMBUMOUNT,
31 CMD_CIFSMOUNT,
32 CMD_DAVMOUNT,
33 CMD_NCPMOUNT,
34 CMD_NCPUMOUNT,
35 CMD_FUSEMOUNT,
36 CMD_FUSEUMOUNT,
37 CMD_LCLMOUNT,
38 CMD_CRYPTMOUNT,
39 CMD_NFSMOUNT,
40 CMD_UMOUNT,
41 CMD_PMHELPER,
42 CMD_LSOF,
43 CMD_MNTAGAIN,
44 CMD_MNTCHECK,
45 CMD_FSCK,
46 CMD_LOSETUP,
47 CMD_UNLOSETUP,
48 CMD_PMVARRUN,
49 CMD_TRUECRYPTMOUNT,
50 CMD_TRUECRYPTUMOUNT,
51 _CMD_MAX,
52 CMD_NONE,
7453 };
7554
7655 struct vol {
77 enum command_type type;
78 bool globalconf; // TRUE if config. from global config, FALSE if luserconf
79 bool created_mntpt; // set so umount knows to rm it
80 char fs_key_cipher[MAX_PAR + 1];
81 char fs_key_path[PATH_MAX + 1];
82 char server[MAX_PAR + 1];
83 char user[MAX_PAR + 1]; // user field in a single volume config record; can be "*"
84 char fstype[MAX_PAR + 1];
85 char volume[MAX_PAR + 1]; // FIXME: PATH_MAX
86 optlist_t *options; // may be NULL if no options
87 char mountpoint[PATH_MAX + 1];
88 bool use_fstab;
89 bool used_wildcard;
56 enum command_type type;
57 /* true if configuration from global config, false if luserconf */
58 bool globalconf;
59 /* set, so that umount can rmdir it */
60 bool created_mntpt;
61 char fs_key_cipher[MAX_PAR + 1];
62 char fs_key_path[PATH_MAX + 1];
63 char server[MAX_PAR + 1];
64 /* user field in a single volume record; can be "*" */
65 char user[MAX_PAR + 1];
66 char fstype[MAX_PAR + 1];
67 /* FIXME: PATH_MAX */
68 char volume[MAX_PAR + 1];
69 /* May be NULL if no options */
70 optlist_t *options;
71 char mountpoint[PATH_MAX + 1];
72 bool use_fstab;
73 bool used_wildcard;
9074 };
9175
9276 struct config {
93 char *user; /* user logging in */
94 bool debug;
95 bool mkmntpoint;
96 unsigned int volcount;
97 char luserconf[PATH_MAX + 1];
98 char fsckloop[PATH_MAX + 1];
99 char *command[MAX_PAR + 1][COMMAND_MAX];
100 optlist_t *options_require;
101 optlist_t *options_allow;
102 optlist_t *options_deny;
103 struct vol *volume;
77 /* user logging in */
78 char *user;
79 bool debug;
80 bool mkmntpoint, rmdir_mntpt;
81 unsigned int volcount;
82 char luserconf[PATH_MAX + 1];
83 char fsckloop[PATH_MAX + 1];
84 char *command[_CMD_MAX][MAX_PAR+1];
85 optlist_t *options_require;
86 optlist_t *options_allow;
87 optlist_t *options_deny;
88 struct vol *volume;
89 int level;
90 char *msg_authpw, *msg_sessionpw;
10491 };
10592
106 #ifdef __cplusplus
107 } // extern "C"
108 #endif
109
110 #endif // PMT_PRIVATE_H
111
112 //=============================================================================
93 #endif /* PMT_PRIVATE_H */
0 /*=============================================================================
1 pam_mount - rdconf1.c
2 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2006 - 2007
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of
7 the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to:
16 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 Boston, MA 02110-1301 USA
18
19 -- For details, see the file named "LICENSE.LGPL2"
20 =============================================================================*/
21 #include <ctype.h>
22 #include <errno.h>
23 #include <grp.h>
24 #include <pwd.h>
25 #include <stdio.h>
26 #include <stdlib.h>
27 #include <string.h>
28 #include <libxml/parser.h>
29 #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
30 # include <fstab.h>
31 #elif defined(__linux__)
32 # include <mntent.h>
33 #endif
34 #include <libHX.h>
35 #include "compiler.h"
36 #include "misc.h"
37 #include "pam_mount.h"
38 #include "private.h"
39 #include "readconfig.h"
40 #include "xstdlib.h"
41
42 /* Definitions */
43 enum {
44 CONTEXT_GLOBAL = 0,
45 CONTEXT_LUSER,
46 };
47
48 enum fstab_field {
49 FSTAB_VOLUME,
50 FSTAB_MNTPT,
51 FSTAB_FSTYPE,
52 FSTAB_OPTS,
53 };
54
55 enum wildcard_type {
56 WC_NONE,
57 WC_ANYUSER,
58 WC_PGRP, /* as primary group */
59 WC_SGRP, /* in secondary group */
60 };
61
62 enum {
63 CMDA_AUTHPW,
64 CMDA_SESSIONPW,
65 };
66
67 struct callbackmap {
68 const char *name;
69 const char *(*func)(xmlNode *, struct config *, int);
70 int cmd;
71 };
72
73 struct pmt_command {
74 enum command_type type;
75 const char *fs, *command_name, *def[MAX_PAR + 1];
76 };
77
78 struct volume_attrs {
79 char *user, *pgrp, *sgrp, *fstype, *server, *path, *mntpt,
80 *options, *fskeycipher, *fskeypath;
81 unsigned int invert;
82 };
83
84 /* Functions */
85 static char *expand_home(const char *, char *, size_t);
86 static char *expand_user(const char *, char *, size_t);
87 static inline int strcmp_1u(const xmlChar *, const char *);
88
89 /* Variables */
90 static const struct callbackmap cf_tags[];
91 static const struct pmt_command default_command[];
92
93 //-----------------------------------------------------------------------------
94 /*
95 * expandconfig -
96 * @config: configuration structure
97 *
98 * Expands all wildcards in the structure.
99 */
100 int expandconfig(const struct config *config)
101 {
102 const char *u = config->user;
103 struct vol *vpt;
104 int i;
105
106 for (i = 0; i < config->volcount; ++i) {
107 vpt = &config->volume[i];
108
109 if (expand_home(u, vpt->mountpoint, sizeof(vpt->mountpoint)) == NULL ||
110 expand_user(u, vpt->mountpoint, sizeof(vpt->mountpoint)) == NULL ||
111 expand_home(u, vpt->volume, sizeof(vpt->volume)) == NULL ||
112 expand_user(u, vpt->volume, sizeof(vpt->volume)) == NULL ||
113 expand_home(u, vpt->fs_key_path, sizeof(vpt->fs_key_path)) == NULL ||
114 expand_user(u, vpt->fs_key_path, sizeof(vpt->fs_key_path)) == NULL)
115 return 0;
116
117 if (strcmp(vpt->user, "*") == 0 || *vpt->user == '@')
118 vpt->used_wildcard = 1;
119
120 strcpy(vpt->user, config->user);
121 }
122 return 1;
123 }
124
125 /*
126 * freeconfig -
127 * @config: config struct
128 *
129 * All dynamically allocated memory in the structure is freed.
130 */
131 void freeconfig(struct config *config)
132 {
133 unsigned int i, j;
134
135 for (i = 0; i < _CMD_MAX; ++i) {
136 free(config->command[i][0]);
137 for (j = 0; config->command[i][j] != NULL; ++j)
138 config->command[i][j] = NULL;
139 }
140
141 free(config->user);
142 free(config->msg_authpw);
143 free(config->msg_sessionpw);
144 return;
145 }
146
147 void initconfig(struct config *config)
148 {
149 unsigned int i, j;
150
151 memset(config, 0, sizeof(*config));
152 config->debug = 1;
153 config->mkmntpoint = 1;
154 strcpy(config->fsckloop, "/dev/loop7");
155
156 for (i = 0; default_command[i].type != -1; ++i)
157 for (j = 0; default_command[i].def[j] != NULL; ++j)
158 config->command[default_command[i].type][j] =
159 xstrdup(default_command[i].def[j]);
160
161 return;
162 }
163
164 int readconfig(const char *file, int global_conf, struct config *config)
165 {
166 const struct callbackmap *cmp;
167 const char *err;
168 xmlDoc *doc;
169 xmlNode *ptr;
170
171 if ((doc = xmlParseFile(file)) == NULL)
172 return 0;
173 ptr = xmlDocGetRootElement(doc);
174 if (ptr == NULL || strcmp_1u(ptr->name, "pam_mount") != 0) {
175 xmlFreeDoc(doc);
176 return 0;
177 }
178
179 for (ptr = ptr->children; ptr != NULL; ptr = ptr->next) {
180 if (ptr->type != XML_ELEMENT_NODE)
181 continue;
182 for (cmp = cf_tags; cmp->name != NULL; ++cmp)
183 if (strcmp_1u(ptr->name, cmp->name) == 0) {
184 err = (*cmp->func)(ptr, config, cmp->cmd);
185 if (err != NULL)
186 l0g("%s\n", err);
187 break;
188 }
189 }
190
191 xmlFreeDoc(doc);
192 return 1;
193 }
194
195 //-----------------------------------------------------------------------------
196 /*
197 * expand_home -
198 * @user: username to use for home directory lookup
199 * @path: pathname to expand
200 * @size: size of @path
201 *
202 * Expands tildes in @path to the user home directory and updates @path.
203 * Returns @dest.
204 */
205 static char *expand_home(const char *user, char *path, size_t size)
206 {
207 struct passwd *pe;
208 char *buf;
209
210 if (*path != '~')
211 return path;
212
213 if ((pe = getpwnam(user)) == NULL) {
214 l0g("Could not lookup account information for %s\n", user);
215 return NULL;
216 }
217
218 if ((buf = xmalloc(size)) == NULL) {
219 l0g("%s\n", strerror(errno));
220 return NULL;
221 }
222 if (snprintf(buf, size, "%s%s", pe->pw_dir, path + 1) >= size)
223 l0g("Warning: Not enough buffer space in expand_home()\n");
224
225 strncpy(path, buf, size);
226 free(buf);
227 return path;
228 }
229
230 /*
231 * expand_user -
232 * @user: username to substitue for placeholder
233 * @dest: buffer to operate on
234 * @size: size of @dest
235 *
236 * Substitutes all occurrences of %(USER) by the username. Returns NULL on
237 * failure, otherwise @dest.
238 *
239 * (This should probably be done by the fmt_ptrn stuff, but is not at the
240 * moment due to to-XML transition period.)
241 */
242 static char *expand_user(const char *user, char *dest, size_t size)
243 {
244 struct HXbtree *vinfo;
245
246 if (dest == NULL)
247 l0g("expand_user_wildcard(dest=NULL), please fix\n");
248
249 vinfo = HXformat_init();
250 HXformat_add(vinfo, "USER", user, HXTYPE_STRING);
251 misc_add_ntdom(vinfo, user);
252 HXformat_sprintf(vinfo, dest, size, dest);
253 HXformat_free(vinfo);
254 return dest;
255 }
256
257 /*
258 * fstab_value -
259 * @volume: path to volume
260 * @field: -
261 * @dest: destination buffer
262 * @size: size of @dest
263 *
264 * Search for @volume in /etc/fstab and if it is found, copy the @field'th
265 * field to @dest which is of size @size. Returns 0 on error, 1 on success.
266 */
267 static int fstab_value(const char *volume, const enum fstab_field field,
268 char *dest, int size)
269 {
270 const char *val;
271 #if defined(__linux__)
272 struct mntent *fstab_record;
273 FILE *fstab;
274
275 if ((fstab = setmntent("/etc/fstab", "r")) == NULL) {
276 l0g("could not open fstab\n");
277 return 0;
278 }
279
280 for (fstab_record = getmntent(fstab);
281 fstab_record != NULL &&
282 strcmp(fstab_record->mnt_fsname, volume) != 0;
283 fstab_record = getmntent(fstab))
284 /* skip fstab entries until a match is found */;
285
286 if (fstab_record == NULL) {
287 l0g("could not get %dth fstab field for %s\n", field, volume);
288 return 0;
289 }
290
291 switch (field) {
292 case FSTAB_VOLUME:
293 val = fstab_record->mnt_fsname;
294 break;
295 case FSTAB_MNTPT:
296 val = fstab_record->mnt_dir;
297 break;
298 case FSTAB_FSTYPE:
299 val = fstab_record->mnt_type;
300 break;
301 case FSTAB_OPTS:
302 val = fstab_record->mnt_opts;
303 break;
304 default:
305 l0g("field of %d invalid\n", field);
306 return 0;
307 }
308 #elif defined (__FreeBSD__) || defined (__OpenBSD__) || defined(__APPLE__)
309 struct fstab *fstab_record;
310
311 if (!setfsent()) {
312 l0g("could not open fstab\n");
313 return 0;
314 }
315 if ((fstab_record = getfsspec(volume)) == NULL) {
316 l0g("could not get %dth fstab field for %s\n", field, volume);
317 return 0;
318 }
319
320 switch (field) {
321 case FSTAB_VOLUME:
322 val = fstab_record->fs_spec;
323 break;
324 case FSTAB_MNTPT:
325 val = fstab_record->fs_file;
326 break;
327 case FSTAB_FSTYPE:
328 val = fstab_record->fs_vfstype;
329 break;
330 case FSTAB_OPTS:
331 val = fstab_record->fs_mntops;
332 break;
333 default:
334 l0g("field of %d invalid\n", field);
335 return 0;
336 }
337 #else
338 l0g("reading fstab not implemented on arch.\n");
339 return 0;
340 #endif
341
342 strncpy(dest, val, size);
343 dest[size-1] = '\0';
344 #if defined(__linux__)
345 endmntent(fstab);
346 #elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
347 endfsent();
348 #endif
349 return 1;
350 }
351
352 /*
353 * get_next_argument -
354 * @sptr: pointer to pointer to writable string
355 *
356 * Unescapes the next argument from @*sptr and writes it into @*sptr,
357 * which is returned. (In-place unescape)
358 */
359 static inline char *get_next_argument(char **sptr)
360 {
361 char *i = *sptr, *o = i, *ret = i;
362 char quot = '\0';
363
364 if (*i == '\0')
365 return NULL;
366 while (isspace(*i))
367 ++i;
368
369 while (*i != '\0') {
370 if (quot == '\0') {
371 if (isspace(*i)) {
372 ++i;
373 break;
374 }
375 switch (*i) {
376 case '"':
377 case '\'':
378 quot = *i++;
379 continue;
380 case '\\':
381 if (*++i != '\0')
382 *o++ = *i;
383 continue;
384 default:
385 *o++ = *i++;
386 continue;
387 }
388 break;
389 }
390 if (*i == quot) {
391 quot = 0;
392 ++i;
393 continue;
394 } else if (*i == '\\') {
395 *o++ = *++i;
396 ++i;
397 continue;
398 }
399 *o++ = *i++;
400 }
401 *o++ = '\0';
402 *sptr = i;
403 return ret;
404 }
405
406 static inline bool parse_bool(const char *s)
407 {
408 return strcasecmp(s, "yes") == 0 || strcasecmp(s, "on") == 0||
409 strcasecmp(s, "true") == 0 || strcmp(s, "1") == 0;
410 }
411
412 static inline int strcmp_1u(const xmlChar *a, const char *b)
413 {
414 return strcmp(reinterpret_cast(const char *, a), b);
415 }
416
417 /*
418 * user_in_sgrp -
419 * @user: user to check
420 * @grp: group name
421 *
422 * Checks whether @user has @grp as one its _secondary_ groups. Returns 0 if
423 * no match was found, positive non-zero on success or negative non-zero on
424 * failure.
425 */
426 static int user_in_sgrp(const char *user, const char *grp)
427 {
428 struct group *gent;
429 const char **wp;
430
431 if ((gent = getgrnam(grp)) == NULL) {
432 w4rn("getgrnam(\"%s\") failed: %s\n", grp, strerror(errno));
433 return -1;
434 }
435
436 wp = const_cast(const char **, gent->gr_mem);
437 while (wp != NULL && *wp != NULL) {
438 if (strcmp(*wp, user) == 0)
439 return 1;
440 ++wp;
441 }
442
443 return 0;
444 }
445
446 static inline char *xmlGetProp_2s(xmlNode *node, const char *attr)
447 {
448 return reinterpret_cast(char *, xmlGetProp(node,
449 reinterpret_cast(const xmlChar *, attr)));
450 }
451
452 //-----------------------------------------------------------------------------
453 static const char *rc_command(xmlNode *node, struct config *config, int cmd)
454 {
455 unsigned int n = 0;
456 char *arg, *wp;
457
458 if (config->level != CONTEXT_GLOBAL)
459 return "Tried to set command from user config\n";
460 if ((node = node->children) == NULL)
461 return NULL;
462 for (; node != NULL; node = node->next) {
463 if (node->type != XML_TEXT_NODE)
464 continue;
465
466 wp = xstrdup(signed_cast(const char *, node->content));
467 while ((arg = get_next_argument(&wp)) != NULL)
468 /*
469 * The copy taken with strdup() is not freed in this
470 * function, because it is used soon.
471 * @config->command[0][cmd] will be the pointer to the
472 * block to free later.
473 */
474 config->command[cmd][n++] = arg;
475
476 /* No hassle to support comment-split tags. */
477 break;
478 }
479 return NULL;
480 }
481
482 static const char *rc_debug(xmlNode *node, struct config *config, int cmd)
483 {
484 char *s;
485 if ((s = xmlGetProp_2s(node, "enable")) != NULL)
486 Debug = config->debug = strtol(s, NULL, 0);
487 free(s);
488 return NULL;
489 }
490
491 static const char *rc_fsckloop(xmlNode *node, struct config *config, int cmd)
492 {
493 char *dev;
494
495 if (config->level != CONTEXT_GLOBAL)
496 return "Tried to set <fsckloop> from user config";
497 if ((dev = xmlGetProp_2s(node, "device")) != NULL) {
498 if (strlen(dev) > PATH_MAX) {
499 free(dev);
500 return "fsckloop device path too long";
501 }
502 strncpy(config->fsckloop, dev, PATH_MAX);
503 free(dev);
504 }
505
506 return NULL;
507 }
508
509 static const char *rc_luserconf(xmlNode *node, struct config *config, int cmd)
510 {
511 struct passwd *pent;
512 char *s;
513
514 if (config->level != CONTEXT_GLOBAL)
515 return "Tried to set <luserconf> from user config";
516 if ((pent = getpwnam(config->user)) == NULL)
517 return "Could not get password entry";
518 if ((s = xmlGetProp_2s(node, "name")) == NULL)
519 return "<luserconf> is missing name= attribute";
520 if (strlen(pent->pw_dir) + 1 + strlen(s) > sizeof_z(config->luserconf)) {
521 free(s);
522 return "expanded luserconf path too long";
523 }
524 HX_strlcpy(config->luserconf, pent->pw_dir, sizeof(config->luserconf));
525 HX_strlcat(config->luserconf, "/", sizeof(config->luserconf));
526 HX_strlcat(config->luserconf, s, sizeof(config->luserconf));
527 w4rn("path to luserconf set to %s\n", config->luserconf),
528 free(s);
529 return NULL;
530 }
531
532 static const char *rc_mkmountpoint(xmlNode *node, struct config *config, int c)
533 {
534 char *s;
535 if ((s = xmlGetProp_2s(node, "enable")) != NULL)
536 config->mkmntpoint = strtol(s, NULL, 0);
537 free(s);
538 if ((s = xmlGetProp_2s(node, "remove")) != NULL)
539 config->rmdir_mntpt = parse_bool(s);
540 free(s);
541 return NULL;
542 }
543
544 static const char *rc_mntoptions(xmlNode *node, struct config *config, int cmd)
545 {
546 char *options;
547 int ret;
548
549 if (config->level != CONTEXT_GLOBAL)
550 return "Tried to set <mntoptions allow=...> from user config";
551
552 if ((options = xmlGetProp_2s(node, "allow")) != NULL) {
553 ret = str_to_optlist(&config->options_allow, options);
554 free(options);
555 if (!ret)
556 return "Error parsing allowed options";
557 }
558
559 if ((options = xmlGetProp_2s(node, "deny")) != NULL) {
560 ret = str_to_optlist(&config->options_deny, options);
561 free(options);
562 if (!ret)
563 return "Error parsing denied options";
564 }
565
566 if ((options = xmlGetProp_2s(node, "require")) != NULL) {
567 ret = str_to_optlist(&config->options_require, options);
568 free(options);
569 if (!ret)
570 return "Error parsing required options";
571 }
572
573 return NULL;
574 }
575
576 static const char *rc_string(xmlNode *node, struct config *config, int cmd)
577 {
578 for (node = node->children; node != NULL; node = node->next) {
579 if (node->type != XML_TEXT_NODE)
580 continue;
581 switch (cmd) {
582 case CMDA_AUTHPW:
583 config->msg_authpw = xstrdup(signed_cast(const char *, node->content));
584 break;
585 case CMDA_SESSIONPW:
586 config->msg_sessionpw = xstrdup(signed_cast(const char *, node->content));
587 break;
588 }
589 break;
590 }
591 return NULL;
592 }
593
594 static const char *rc_volume_inter(struct config *config,
595 const struct volume_attrs *attr)
596 {
597 enum wildcard_type wildcard = WC_NONE;
598 struct passwd *pent;
599 struct vol *vpt;
600 int i;
601
602 if (strlen(attr->user) > sizeof_z(vpt->user) ||
603 strlen(attr->fstype) > sizeof_z(vpt->fstype) ||
604 strlen(attr->server) > sizeof_z(vpt->server) ||
605 strlen(attr->path) > sizeof_z(vpt->volume) ||
606 strlen(attr->mntpt) > sizeof_z(vpt->mountpoint) ||
607 strlen(attr->fskeycipher) > sizeof_z(vpt->fs_key_cipher) ||
608 strlen(attr->fskeypath) > sizeof_z(vpt->fs_key_path))
609 return "command too long";
610
611 if ((pent = getpwnam(config->user)) == NULL) {
612 w4rn("getpwnam(\"%s\") failed: %s\n",
613 Config.user, strerror(errno));
614 return NULL;
615 }
616
617 if (strcmp(attr->user, "*") == 0)
618 wildcard = WC_ANYUSER;
619 else if (*attr->pgrp != '\0')
620 wildcard = WC_PGRP;
621 else if (*attr->sgrp != '\0')
622 wildcard = WC_SGRP;
623 else if (*attr->user == '\0')
624 wildcard = WC_ANYUSER;
625
626 if (wildcard != WC_NONE && (strcmp(config->user, "root") == 0 ||
627 pent->pw_uid == 0)) {
628 /* One day, when SELinux becomes a daily thing, remove this. */
629 w4rn("volume wildcards ignored for \"root\" and uid0\n");
630 return NULL;
631 }
632
633 if (wildcard == WC_NONE && (strcmp(config->user, attr->user) != 0) ^
634 attr->invert)
635 goto notforme;
636
637 if (wildcard == WC_PGRP) {
638 const char *grp_name = attr->pgrp;
639 struct group *gent;
640
641 if ((gent = getgrgid(pent->pw_gid)) == NULL) {
642 w4rn("getgrgid(%ld) failed: %s\n",
643 static_cast(long, pent->pw_gid), strerror(errno));
644 return NULL;
645 }
646 if ((strcmp(grp_name, gent->gr_name) != 0) ^ attr->invert)
647 goto notforme;
648 } else if (wildcard == WC_SGRP) {
649 const char *grp_name = attr->sgrp;
650 struct group *gent;
651
652 if ((gent = getgrgid(pent->pw_gid)) == NULL) {
653 w4rn("getgrgid(%ld) failed: %s\n",
654 static_cast(long, pent->pw_gid), strerror(errno));
655 return NULL;
656 }
657 if (!user_in_sgrp(config->user, grp_name) ^ attr->invert)
658 goto notforme;
659 }
660
661 /* realloc */
662 config->volume = xrealloc(config->volume,
663 sizeof(struct vol) * (config->volcount + 1));
664 vpt = &config->volume[config->volcount++];
665 memset(vpt, 0, sizeof(*vpt));
666
667 vpt->globalconf = config->level == CONTEXT_GLOBAL;
668 strncpy(vpt->user, config->user, sizeof(vpt->user));
669 vpt->type = CMD_LCLMOUNT;
670
671 /* [1] */
672 strncpy(vpt->fstype, attr->fstype, sizeof(vpt->fstype));
673
674 for (i = 0; default_command[i].type != -1; ++i) {
675 const struct pmt_command *c = &default_command[i];
676 if (c->fs != NULL && strcasecmp(attr->fstype, c->fs) == 0) {
677 vpt->type = c->type;
678 break;
679 }
680 }
681
682 /* [2] */
683 if (*attr->server != '\0')
684 strncpy(vpt->server, attr->server, sizeof(vpt->server));
685
686 /* [3] */
687 strncpy(vpt->volume, attr->path, sizeof(vpt->volume));
688
689 /* [4] */
690 if (*attr->mntpt == '\0') {
691 if (!fstab_value(vpt->volume, FSTAB_MNTPT, vpt->mountpoint,
692 sizeof(vpt->mountpoint)))
693 return "could not determine mountpoint";
694 vpt->use_fstab = 1;
695 } else {
696 strncpy(vpt->mountpoint, attr->mntpt, sizeof(vpt->mountpoint));
697 }
698
699 if (*attr->options == '\0') {
700 /*
701 * Three options: field defined, field is '-' and fstab should
702 * be used (when no mount point was provided either) or field
703 * is '-' and this means no options.
704 */
705 if (vpt->use_fstab) {
706 char options[MAX_PAR + 1];
707 if (!fstab_value(vpt->volume, FSTAB_OPTS, options,
708 sizeof(options)))
709 return "could not determine options";
710 if (!str_to_optlist(&vpt->options, options))
711 return "error parsing mount options";
712 } else {
713 vpt->options = NULL;
714 }
715 } else if (!str_to_optlist(&vpt->options, attr->options)) {
716 return "error parsing mount options";
717 }
718
719 if (*attr->fskeycipher != '\0')
720 strncpy(vpt->fs_key_cipher, attr->fskeycipher,
721 sizeof(vpt->fs_key_cipher));
722 if (*attr->fskeypath != '\0')
723 strncpy(vpt->fs_key_path, attr->fskeypath,
724 sizeof(vpt->fs_key_path));
725
726 /* expandconfig() will set this later */
727 vpt->used_wildcard = 0;
728 return NULL;
729
730 notforme:
731 w4rn("ignoring volume record... (not for me)\n");
732 return NULL;
733 }
734
735 static const char *rc_volume(xmlNode *node, struct config *config, int cmd)
736 {
737 struct volume_attrs norm, orig = {
738 .user = xmlGetProp_2s(node, "user"),
739 .pgrp = xmlGetProp_2s(node, "pgrp"),
740 .sgrp = xmlGetProp_2s(node, "sgrp"),
741 .fstype = xmlGetProp_2s(node, "fstype"),
742 .server = xmlGetProp_2s(node, "server"),
743 .path = xmlGetProp_2s(node, "path"),
744 .mntpt = xmlGetProp_2s(node, "mountpoint"),
745 .options = xmlGetProp_2s(node, "options"),
746 .fskeycipher = xmlGetProp_2s(node, "fskeycipher"),
747 .fskeypath = xmlGetProp_2s(node, "fskeypath"),
748 };
749 const char *ret;
750 char *invert;
751 if ((invert = xmlGetProp_2s(node, "invert")) != NULL) {
752 orig.invert = strtoul(invert, NULL, 0);
753 free(invert);
754 }
755 memcpy(&norm, &orig, sizeof(norm));
756 if (norm.user == NULL) norm.user = "";
757 if (norm.pgrp == NULL) norm.pgrp = "";
758 if (norm.sgrp == NULL) norm.sgrp = "";
759 if (norm.fstype == NULL) norm.fstype = "auto";
760 if (norm.server == NULL) norm.server = "";
761 if (norm.path == NULL) norm.path = "";
762 if (norm.mntpt == NULL) norm.mntpt = "";
763 if (norm.options == NULL) norm.options = "";
764 if (norm.fskeycipher == NULL) norm.fskeycipher = "";
765 if (norm.fskeypath == NULL) norm.fskeypath = "";
766 ret = rc_volume_inter(config, &norm);
767 free(orig.user);
768 free(orig.fstype);
769 free(orig.server);
770 free(orig.path);
771 free(orig.mntpt);
772 free(orig.options);
773 free(orig.fskeycipher);
774 free(orig.fskeypath);
775 return ret;
776 }
777
778 //-----------------------------------------------------------------------------
779 static const struct pmt_command default_command[] = {
780 {CMD_SMBMOUNT, "smbfs", "smbmount", {"smbmount", "//%(SERVER)/%(VOLUME)", "%(MNTPT)", "-o", "username=%(USER),uid=%(USERUID),gid=%(USERGID)%(before=\",\" OPTIONS)", NULL}},
781 {CMD_SMBUMOUNT, "smbfs", "smbumount", {"smbumount", "%(MNTPT)", NULL}},
782 {CMD_CIFSMOUNT, "cifs", "cifsmount", {"mount", "-t", "cifs", "//%(SERVER)/%(VOLUME)", "%(MNTPT)", "-o", "username=%(USER),uid=%(USERUID),gid=%(USERGID)%(before=\",\" OPTIONS)", NULL}},
783 {CMD_DAVMOUNT, "davfs", "davmount", {"mount", "-t", "davfs", "%(SERVER)/%(VOLUME)", "%(MNTPT)", "-o", "username=%(USER),uid=%(USERUID),gid=%(USERGID)%(before=\",\" OPTIONS)", NULL}},
784 {CMD_NCPMOUNT, "ncpfs", "ncpmount", {"ncpmount", "%(SERVER)/%(USER)", "%(MNTPT)", "-o", "pass-fd=0,volume=%(VOLUME)%(before=\",\" OPTIONS)", NULL}},
785 {CMD_NCPUMOUNT, "ncpfs", "ncpumount", {"ncpumount", "%(MNTPT)", NULL}},
786 {CMD_FUSEMOUNT, "fuse", "fusemount", {"mount.fuse", "%(VOLUME)", "%(MNTPT)", "%(before=\"-o\" OPTIONS)", NULL}},
787 {CMD_FUSEUMOUNT, "fuse", "fuseumount", {"fusermount", "-u", "%(MNTPT)", NULL}},
788 /* Do not use LCLMOUNT to avoid calling fsck */
789 {CMD_NFSMOUNT, "nfs", "nfsmount", {"mount", "%(SERVER):%(VOLUME)", "%(MNTPT)%(before=\"-o\" OPTIONS)", NULL}},
790 {CMD_LCLMOUNT, NULL, "lclmount", {"mount", "-p0", "-t", "%(FSTYPE)", "%(VOLUME)", "%(MNTPT)", "%(before=\"-o\" OPTIONS)", NULL}},
791 /* Hope to have this in util-linux (LCLMOUNT) some day: */
792 {CMD_CRYPTMOUNT, "crypt", "cryptmount", {"mount", "-t", "crypt", "%(before=\"-o\" OPTIONS)", "%(VOLUME)", "%(MNTPT)", NULL}},
793 {CMD_UMOUNT, NULL, "umount", {"umount", "%(MNTPT)", NULL}},
794 {CMD_LSOF, NULL, "lsof", {"lsof", "%(MNTPT)", NULL}},
795 {CMD_MNTAGAIN, NULL, "mntagain", {"mount", "--bind", "%(PREVMNTPT)", "%(MNTPT)", NULL}},
796 /*
797 * Leave mntcheck available on GNU/Linux so I can ship one
798 * config file example
799 */
800 {CMD_MNTCHECK, NULL, "mntcheck", {"mount", NULL}},
801 {CMD_FSCK, NULL, "fsck", {"fsck", "-p", "%(FSCKTARGET)", NULL}},
802 {CMD_LOSETUP, NULL, "losetup", {"losetup", "-p0", "%(before=\"-e\" CIPHER)", "%(before=\"-k\" KEYBITS)", "%(FSCKLOOP)", "%(VOLUME)", NULL}},
803 {CMD_UNLOSETUP, NULL, "unlosetup", {"losetup", "-d", "%(FSCKLOOP)", NULL}},
804 {CMD_PMVARRUN, NULL, "pmvarrun", {"pmvarrun", "-u", "%(USER)", "-o", "%(OPERATION)", NULL}},
805
806 {CMD_TRUECRYPTMOUNT, "truecrypt", "truecrypt", {"truecryptmount", "%(VOLUME)", "%(MNTPT)", NULL}},
807 {CMD_TRUECRYPTUMOUNT, "truecrypt", "truecrypt", {"truecryptumount", "-d", "%(MNTPT)", NULL}},
808
809 {-1},
810 };
811
812 static const struct callbackmap cf_tags[] = {
813 {"cifsmount", rc_command, CMD_CIFSMOUNT},
814 {"cryptmount", rc_command, CMD_CRYPTMOUNT},
815 {"davmount", rc_command, CMD_DAVMOUNT},
816 {"debug", rc_debug, CMD_NONE},
817 {"fsckloop", rc_fsckloop, CMD_NONE},
818 {"fsck", rc_command, CMD_FSCK},
819 {"fusemount", rc_command, CMD_FUSEMOUNT},
820 {"fuseumount", rc_command, CMD_FUSEUMOUNT},
821 {"lclmount", rc_command, CMD_LCLMOUNT},
822 {"losetup", rc_command, CMD_LOSETUP},
823 {"lsof", rc_command, CMD_LSOF},
824 {"luserconf", rc_luserconf, CMD_NONE},
825 {"mkmountpoint", rc_mkmountpoint, CMD_NONE},
826 {"mntagain", rc_command, CMD_MNTAGAIN},
827 {"mntcheck", rc_command, CMD_MNTCHECK},
828 {"mntoptions", rc_mntoptions, CMD_NONE},
829 {"msg-authpw", rc_string, CMDA_AUTHPW},
830 {"msg-sessionpw", rc_string, CMDA_SESSIONPW},
831 {"nfsmount", rc_command, CMD_NFSMOUNT},
832 {"ncpmount", rc_command, CMD_NCPMOUNT},
833 {"ncpumount", rc_command, CMD_NCPUMOUNT},
834 {"pmvarrun", rc_command, CMD_PMVARRUN},
835 {"smbmount", rc_command, CMD_SMBMOUNT},
836 {"smbumount", rc_command, CMD_SMBUMOUNT},
837 {"truecryptmount", rc_command, CMD_TRUECRYPTMOUNT},
838 {"truecryptumount", rc_command, CMD_TRUECRYPTUMOUNT},
839 {"umount", rc_command, CMD_UMOUNT},
840 {"unlosetup", rc_command, CMD_UNLOSETUP},
841 {"volume", rc_volume, CMD_NONE},
842 {NULL},
843 };
844
845 //=============================================================================
0 /*=============================================================================
1 pam_mount - rdconf2.c
2 Copyright (C) Elvis Pfützenreuter <epx@conectiva.com>, 2000
3 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2007
4 Copyright © Bastian Kleineidam <calvin [at] debian org>, 2005
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as
8 published by the Free Software Foundation; either version 2.1 of
9 the License, or (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with this program; if not, write to:
18 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 Boston, MA 02110-1301 USA
20
21 -- For details, see the file named "LICENSE.LGPL2"
22 =============================================================================*/
23 #include <sys/types.h>
24 #include <assert.h>
25 #include <stdbool.h>
26 #include <stdio.h>
27 #include <stdlib.h>
28 #include <string.h>
29 #include <pwd.h>
30 #include "compiler.h"
31 #include "misc.h"
32 #include "optlist.h"
33 #include "pam_mount.h"
34 #include "private.h"
35 #include "readconfig.h"
36
37 /* Functions */
38 static int _options_ok(const struct config *, const struct vol *);
39 static int options_allow_ok(optlist_t *, optlist_t *);
40 static int options_deny_ok(optlist_t *, optlist_t *);
41 static int options_required_ok(optlist_t *, optlist_t *);
42
43 /* ============================ options_allow_ok () ======================== */
44 /* INPUT: allowed, an optlist of allowed options
45 * options, a list of options
46 * OUTPUT: if options acceptable 1 else 0
47 * SIDE EFFECTS: error logged
48 */
49 static int options_allow_ok(optlist_t * allowed, optlist_t * options)
50 {
51 optlist_t *e;
52
53 if (optlist_exists(allowed, "*") || !optlist_len(options))
54 return 1;
55 for (e = options; e != NULL; e = optlist_next(e))
56 if (!optlist_exists(allowed, optlist_key(e))) {
57 l0g("option %s not allowed\n", optlist_key(e));
58 return 0;
59 }
60 return 1;
61 }
62
63 /* ============================ options_required_ok () ===================== */
64 /* INPUT: required, an optlist of required options
65 * options, a list of options
66 * OUTPUT: if options acceptable 1 else 0
67 * SIDE EFFECTS: error logged
68 */
69 static int options_required_ok(optlist_t * required, optlist_t * options)
70 {
71 optlist_t *e;
72 for (e = required; e != NULL; e = optlist_next(e))
73 if (!optlist_exists(options, optlist_key(e))) {
74 l0g("option %s required\n", optlist_key(e));
75 return 0;
76 }
77 return 1;
78 }
79
80 /* ============================ options_deny_ok () ========================= */
81 /* INPUT: denied, an optlist of denied options
82 * options, a list of options
83 * OUTPUT: if options acceptable 1 else 0
84 * SIDE EFFECTS: error logged
85 */
86 static int options_deny_ok(optlist_t * denied, optlist_t * options)
87 {
88 optlist_t *e;
89 if (!optlist_len(denied)) {
90 w4rn("no denied options\n");
91 return 1;
92 } else if (optlist_exists(denied, "*") && optlist_len(options) > 0) {
93 l0g("all mount options denied, user tried to specify one\n");
94 return 0;
95 }
96 for (e = denied; e != NULL; e = optlist_next(e))
97 if (optlist_exists(options, optlist_key(e))) {
98 l0g("option %s denied\n", optlist_key(e));
99 return 0;
100 }
101 return 1;
102 }
103
104 /* ============================ _options_ok () ============================= */
105 /* INPUT: config, the configuration to use as a basis for checking
106 * volume, a volume to check
107 * OUTPUT: if volume checks okay 1, else 0
108 * SIDE EFFECTS: error logged
109 */
110 static int _options_ok(const struct config *config, const struct vol *volume)
111 {
112 assert(config != NULL);
113 assert(volume != NULL);
114
115 if (optlist_len(config->options_allow) > 0 &&
116 optlist_len(config->options_deny) > 0) {
117 l0g("possible conflicting option settings (use allow OR deny)\n");
118 return 0;
119 }
120 if (!volume->use_fstab) {
121 if (!options_required_ok(config->options_require,
122 volume->options))
123 return 0;
124 else if (optlist_len(config->options_allow) > 0) {
125 if (!options_allow_ok(config->options_allow,
126 volume->options))
127 return 0;
128 } else if (optlist_len(config->options_deny) > 0) {
129 if (!options_deny_ok(config->options_deny,
130 volume->options))
131 return 0;
132 } else if (optlist_len(volume->options) > 0) {
133 l0g("user specified options denied by default\n");
134 return 0;
135 }
136 }
137 return 1;
138 }
139
140 /* ============================ luserconf_volume_record_sane () ============ */
141 /* PRE: config points to a valid struct config
142 vol...
143 */
144 /* FIXME: check to ensure input is legal and reject all else instead of rejecting everyhing that is illegal */
145 bool luserconf_volume_record_sane(const struct config *config, int vol)
146 {
147 const struct vol *vpt;
148 assert(config != NULL);
149 assert(config->volume != NULL);
150 vpt = &config->volume[vol];
151
152 if (config->volume[vol].used_wildcard) {
153 l0g("You may not use wildcards in user-defined volumes\n");
154 return 0;
155 }
156 if (!_options_ok(config, &config->volume[vol])) {
157 l0g("illegal option specified by user\n");
158 return 0;
159 }
160 return 1;
161 }
162
163 /* ============================ volume_record_sane () ====================== */
164 /* PRE: config points to a valid struct config
165 * FN VAL: if error string error message else NULL */
166 /* FIXME: check to ensure input is legal and reject all else instead of rejecting everyhing that is illegal */
167 bool volume_record_sane(const struct config *config, int vol)
168 {
169 const struct vol *vpt;
170
171 assert(config != NULL);
172 assert(config->volume != NULL);
173 vpt = &config->volume[vol];
174
175 w4rn("checking sanity of volume record (%s)\n", vpt->volume);
176 if (config->command[vpt->type][0] == NULL) {
177 l0g("mount command not defined for this type\n");
178 return 0;
179 }
180 if ((vpt->type == CMD_SMBMOUNT || vpt->type == CMD_CIFSMOUNT ||
181 vpt->type == CMD_NCPMOUNT || vpt->type == CMD_NFSMOUNT ||
182 vpt->type == CMD_DAVMOUNT) && strlen(vpt->server) == 0) {
183 l0g("remote mount type specified without server\n");
184 return 0;
185 }
186 if (vpt->type == CMD_NCPMOUNT &&
187 !optlist_exists(vpt->options, "user")) {
188 l0g("NCP volume definition missing user option\n");
189 return 0;
190 }
191 if (config->command[CMD_UMOUNT][0] == NULL) {
192 l0g("umount command not defined\n");
193 return 0;
194 }
195 if (strlen(vpt->fs_key_cipher) > 0 && strlen(vpt->fs_key_path) == 0) {
196 l0g("fs_key_cipher defined without fs_key_path\n");
197 return 0;
198 }
199 if (strlen(vpt->fs_key_cipher) == 0 && strlen(vpt->fs_key_path) > 0) {
200 l0g("fs_key_path defined without fs_key_cipher\n");
201 return 0;
202 }
203 return 1;
204 }
205
206 //=============================================================================
+0
-975
src/readconfig.c less more
0 /*=============================================================================
1 readconfig.c
2 Copyright (C) Elvis Pfützenreuter <epx@conectiva.com>, 2000
3 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
4 Copyright © Bastian Kleineidam <calvin [at] debian org>, 2005
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as
8 published by the Free Software Foundation; either version 2.1 of
9 the License, or (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with this program; if not, write to:
18 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 Boston, MA 02110-1301 USA
20
21 -- For details, see the file named "LICENSE.LGPL2"
22 =============================================================================*/
23 #include <sys/types.h>
24 #include <alloca.h>
25 #include <assert.h>
26 #include <errno.h>
27 #include <grp.h>
28 #include <limits.h>
29 #include <stdio.h>
30 #include <stdlib.h>
31 #include <string.h>
32 #include <pwd.h>
33 #include "compiler.h"
34 #include "dotconf.h"
35 #include "misc.h"
36 #include "optlist.h"
37 #include "pam_mount.h"
38 #include "private.h"
39 #include "readconfig.h"
40 #include "xstdlib.h"
41 #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
42 # include <fstab.h>
43 #elif defined(__linux__)
44 # include <mntent.h>
45 #endif
46
47 // Definitions
48 #define DEBUG_DEFAULT FALSE
49 #define MKMOUNTPOINT_DEFAULT FALSE
50 #define FSCKLOOP_DEFAULT "/dev/loop7"
51 #define ICONTEXT (*static_cast(int *, cmd->context))
52 #define ICONFIG static_cast(struct config *, cmd->option->info)
53
54 enum fstab_field {
55 FSTAB_VOLUME,
56 FSTAB_MNTPT,
57 FSTAB_FSTYPE,
58 FSTAB_OPTS,
59 };
60
61 struct pm_command {
62 enum command_type type;
63 char *fs;
64 char *command_name;
65 char *def[MAX_PAR + 1];
66 };
67
68 // Functions
69 static char *expand_home(const char *, const char *, char *, size_t);
70 static char *expand_user_wildcard(const char *, const char *, char *, size_t);
71 static int fstab_value(const char *, const enum fstab_field, char *, const int);
72 static enum command_type get_command_index(const struct pm_command *, const char *);
73 static FUNC_ERRORHANDLER(log_error);
74 static DOTCONF_CB(read_command);
75 static DOTCONF_CB(read_debug);
76 static DOTCONF_CB(read_fsckloop);
77 static DOTCONF_CB(read_int_param);
78 static DOTCONF_CB(read_luserconf);
79 static DOTCONF_CB(read_options_allow);
80 static DOTCONF_CB(read_options_deny);
81 static DOTCONF_CB(read_options_require);
82 static DOTCONF_CB(read_volume);
83 static int _options_ok(const struct config *, const struct vol *);
84 static int options_allow_ok(optlist_t *, optlist_t *);
85 static int options_deny_ok(optlist_t *, optlist_t *);
86 static int options_required_ok(optlist_t *, optlist_t *);
87 static int user_in_sgrp(const char *, const char *);
88
89 // Variables
90 /* defaults are included here but these are overridden by pam_mount.conf */
91 static const struct pm_command Command[] = {
92 {SMBMOUNT, "smbfs", "smbmount", {"/usr/bin/smbmount", "//%(SERVER)/%(VOLUME)", "%(MNTPT)", "-o", "username=%(USER),uid=%(USERUID),gid=%(USERGID)%(before=\",\" OPTIONS)", NULL}},
93 {SMBUMOUNT, "smbfs", "smbumount", {"/usr/bin/smbumount", "%(MNTPT)", NULL}},
94 {CIFSMOUNT, "cifs", "cifsmount", {"/bin/mount", "-t", "cifs", "//%(SERVER)/%(VOLUME)", "%(MNTPT)", "-o", "username=%(USER),uid=%(USERUID),gid=%(USERGID)%(before=\",\" OPTIONS)", NULL}},
95 {NCPMOUNT, "ncpfs", "ncpmount", {"/usr/bin/ncpmount", "%(SERVER)/%(USER)", "%(MNTPT)", "-o", "pass-fd=0,volume=%(VOLUME)%(before=\",\" OPTIONS)", NULL}},
96 {NCPUMOUNT, "ncpfs", "ncpumount", {"/usr/bin/ncpumount", "%(MNTPT)", NULL}},
97 {FUSEMOUNT, "fuse", "fusemount", {"/sbin/mount.fuse", "%(VOLUME)", "%(MNTPT)", "%(before=\"-o\" OPTIONS)", NULL}},
98 {FUSEUMOUNT, "fuse", "fuseumount", {"/usr/bin/fusermount", "-u", "%(MNTPT)", NULL}},
99 {NFSMOUNT, "nfs", "nfsmount", {"/bin/mount", "%(SERVER):%(VOLUME)", "%(MNTPT)%(before=\"-o\" OPTIONS)", NULL}}, /* Don't use LCLMOUNT to avoid fsck */
100 {LCLMOUNT, NULL, "lclmount", {"/bin/mount", "-p0", "-t", "%(FSTYPE)", "%(VOLUME)", "%(MNTPT)", "%(before=\"-o\" OPTIONS)", NULL}},
101 /* FIXME: hope to have this in util-linux (LCLMOUNT) some day: */
102 {CRYPTMOUNT, "crypt", "cryptmount", {"/bin/mount", "-t", "crypt", "%(before=\"-o\" OPTIONS)", "%(VOLUME)", "%(MNTPT)", NULL}},
103 {UMOUNT, NULL, "umount", {"/bin/umount", "%(MNTPT)", NULL}},
104 {LSOF, NULL, "lsof", {"/usr/bin/lsof", "%(MNTPT)", NULL}},
105 {MNTAGAIN, NULL, "mntagain", {"/bin/mount", "--bind", "%(PREVMNTPT)", "%(MNTPT)", NULL}},
106 /*
107 * Leave mntcheck available on GNU/Linux so I can ship one config file
108 * example
109 */
110 {MNTCHECK, NULL, "mntcheck", {"/bin/mount", NULL}},
111 {FSCK, NULL, "fsck", {"/sbin/fsck", "-p", "%(FSCKTARGET)", NULL}},
112 {LOSETUP, NULL, "losetup", {"/sbin/losetup", "-p0", "%(before=\"-e\" CIPHER)", "%(before=\"-k\" KEYBITS)", "%(FSCKLOOP)", "%(VOLUME)", NULL}},
113 {UNLOSETUP, NULL, "unlosetup", {"/sbin/losetup", "-d", "%(FSCKLOOP)", NULL}},
114 {PMVARRUN, NULL, "pmvarrun", {"/usr/sbin/pmvarrun", "-u", "%(USER)", "-d", "-o", "%(OPERATION)", NULL}},
115 {-1, NULL, NULL, {NULL}},
116 };
117
118 static const struct configoption legal_config[] = {
119 {"debug", ARG_TOGGLE, read_debug, &Config.debug, CTX_ALL},
120 {"mkmountpoint", ARG_TOGGLE, read_int_param, &Config.mkmntpoint, CTX_ALL},
121 {"luserconf", ARG_STR, read_luserconf, &Config, CTX_ALL},
122 {"fsckloop", ARG_STR, read_fsckloop, &Config, CTX_ALL},
123 {"smbmount", ARG_LIST, read_command, &Config, CTX_ALL},
124 {"smbumount", ARG_LIST, read_command, &Config, CTX_ALL},
125 {"cifsmount", ARG_LIST, read_command, &Config, CTX_ALL},
126 {"ncpmount", ARG_LIST, read_command, &Config, CTX_ALL},
127 {"ncpumount", ARG_LIST, read_command, &Config, CTX_ALL},
128 {"fusemount", ARG_LIST, read_command, &Config, CTX_ALL},
129 {"fuseumount", ARG_LIST, read_command, &Config, CTX_ALL},
130 {"umount", ARG_LIST, read_command, &Config, CTX_ALL},
131 {"lclmount", ARG_LIST, read_command, &Config, CTX_ALL},
132 /* FIXME: hope to have this in util-linux (LCLMOUNT) some day: */
133 {"cryptmount", ARG_LIST, read_command, &Config, CTX_ALL},
134 {"nfsmount", ARG_LIST, read_command, &Config, CTX_ALL},
135 {"lsof", ARG_LIST, read_command, &Config, CTX_ALL},
136 {"mntagain", ARG_LIST, read_command, &Config, CTX_ALL},
137 {"mntcheck", ARG_LIST, read_command, &Config, CTX_ALL},
138 {"fsck", ARG_LIST, read_command, &Config, CTX_ALL},
139 {"losetup", ARG_LIST, read_command, &Config, CTX_ALL},
140 {"unlosetup", ARG_LIST, read_command, &Config, CTX_ALL},
141 {"pmvarrun", ARG_LIST, read_command, &Config, CTX_ALL},
142 {"options_require", ARG_STR, read_options_require, &Config, CTX_ALL},
143 {"options_allow", ARG_STR, read_options_allow, &Config, CTX_ALL},
144 {"options_deny", ARG_STR, read_options_deny, &Config, CTX_ALL},
145 {"volume", ARG_LIST, read_volume, &Config, CTX_ALL},
146 LAST_OPTION,
147 };
148
149 /* ============================ log_error () =============================== */
150 /* NOTE: callback helper function for handling errors
151 * frees msg after logging it! */
152 static FUNC_ERRORHANDLER(log_error)
153 {
154 l0g(PMPREFIX "%s\n", msg);
155 /* FIXME: This free is broken.
156 * If an invalid command definition (ie: foomount) exists in
157 * pam_mount.conf then su, loging, gdm, etc. segfault with:
158 * pam_mount: Unknown Config-Option: 'fsck'
159 * Segmentation fault
160 * Other circumstances will also cause this segfault. For example.
161 * some functions do a return "foo."
162 free(msg);
163 */
164 return 0;
165 }
166
167 /* ============================ read_options_require () ==================== */
168 /* NOTE: callback function for reading required options */
169 static DOTCONF_CB(read_options_require)
170 {
171 assert(cmd != NULL);
172 assert(cmd->data.str != NULL);
173 assert(cmd->option != NULL);
174 assert(cmd->option->info != NULL);
175
176
177 if(!ICONTEXT)
178 return "tried to set options_require from user config";
179 w4rn(PMPREFIX "reading options_require...\n");
180 if(!str_to_optlist(&ICONFIG->options_require, cmd->data.str))
181 return "error parsing required options";
182 return NULL;
183 }
184
185 /* ============================ read_options_allow () ====================== */
186 /* NOTE: callback function for reading required options */
187 static DOTCONF_CB(read_options_allow)
188 {
189 assert(cmd != NULL);
190 assert(cmd->data.str != NULL);
191 assert(cmd->option != NULL);
192 assert(cmd->option->info != NULL);
193
194 if(!ICONTEXT)
195 return "tried to set options_allow from user config";
196 w4rn(PMPREFIX "reading options_allow...\n");
197 if(!str_to_optlist(&ICONFIG->options_allow, cmd->data.str))
198 return "error parsing allowed options";
199 return NULL;
200 }
201
202 /* ============================ read_options_deny () ======================= */
203 /* NOTE: callback function for reading required options */
204 static DOTCONF_CB(read_options_deny)
205 {
206 assert(cmd != NULL);
207 assert(cmd->data.str != NULL);
208 assert(cmd->option != NULL);
209 assert(cmd->option->info != NULL);
210
211 if(!ICONTEXT)
212 return "tried to set options_deny from user config";
213 w4rn(PMPREFIX "reading options_deny...\n");
214 if(!str_to_optlist(&ICONFIG->options_deny, cmd->data.str))
215 return "error parsing denied options";
216 return NULL;
217 }
218
219 /* ============================ get_command_index () ======================= */
220 /* INPUT: command, a struct pm_command array full of commands
221 * name, the name of the command that is being looked for
222 * OUTPUT: the index into the struct pm_command cooresponding to name
223 */
224 static enum command_type get_command_index(const struct pm_command *command,
225 const char *name)
226 {
227 int i;
228
229 /* FIXME: need to assert(command[i])? */
230 for (i = 0; command[i].type != -1; i++)
231 assert(command[i].command_name != NULL);
232 assert(name != NULL);
233
234 for (i = 0; command[i].type != -1; i++)
235 if (strcmp(command[i].command_name, name) == 0)
236 return command[i].type;
237 return -1;
238 }
239
240 /* ============================ read_command () ============================ */
241 /* NOTE: callback function for reading command configurations
242 * command array must be initialized to [ 0x00, ..., 0x00 ]
243 * (see initconfig)
244 * mount.c's functions do checks on command array before it tries to
245 * execv anything so don't worry about missing configurations */
246 static DOTCONF_CB(read_command)
247 {
248 #define COMMAND(n) ICONFIG->command[n][command_index]
249 int i;
250 enum command_type command_index;
251
252 assert(cmd != NULL);
253 assert(cmd->name != NULL);
254 assert(cmd->context != NULL);
255 assert(cmd->data.list != NULL);
256 assert(cmd->option != NULL);
257 assert(ICONFIG != NULL);
258 assert(ICONFIG->command != NULL);
259 for (i = 0; i < cmd->arg_count; i++)
260 /* FIXME: causes seg. fault, command_index not set: assert(COMMAND(i) == NULL); */
261 assert(cmd->data.list[i] != NULL);
262
263 /* FIXME: causes seg. fault, command_index not set: assert(COMMAND(i) == NULL); */
264
265 if(!ICONTEXT)
266 return "tried to set command from user config";
267 if((command_index = get_command_index(Command, cmd->name)) == -1)
268 return PMPREFIX "bad command in config";
269 if (cmd->arg_count <= 0)
270 return "command type specified without definition";
271 for (i = 0; i < cmd->arg_count; i++)
272 if (strlen(cmd->data.list[i]) > MAX_PAR)
273 return "command too long";
274 COMMAND(0) = xstrdup(cmd->data.list[0]);
275 for (i = 1; i < cmd->arg_count; i++) {
276 if (i > MAX_PAR)
277 return PMPREFIX "configured command line too long";
278 COMMAND(i) = xstrdup(cmd->data.list[i]);
279 }
280 if(i <= MAX_PAR)
281 COMMAND(i) = NULL;
282 return NULL;
283 }
284
285 /* ============================ options_allow_ok () ======================== */
286 /* INPUT: allowed, an optlist of allowed options
287 * options, a list of options
288 * OUTPUT: if options acceptable 1 else 0
289 * SIDE EFFECTS: error logged
290 */
291 static int options_allow_ok(optlist_t * allowed, optlist_t * options)
292 {
293 optlist_t *e;
294
295 if (optlist_exists(allowed, "*") || !optlist_len(options))
296 return 1;
297 for(e = options; e != NULL; e = optlist_next(e))
298 if(!optlist_exists(allowed, optlist_key(e))) {
299 l0g(PMPREFIX "option %s not allowed\n", optlist_key(e));
300 return 0;
301 }
302 return 1;
303 }
304
305 /* ============================ options_required_ok () ===================== */
306 /* INPUT: required, an optlist of required options
307 * options, a list of options
308 * OUTPUT: if options acceptable 1 else 0
309 * SIDE EFFECTS: error logged
310 */
311 static int options_required_ok(optlist_t * required, optlist_t * options)
312 {
313 optlist_t *e;
314 for(e = required; e != NULL; e = optlist_next(e))
315 if(!optlist_exists(options, optlist_key(e))) {
316 l0g(PMPREFIX "option %s required\n", optlist_key(e));
317 return 0;
318 }
319 return 1;
320 }
321
322 /* ============================ options_deny_ok () ========================= */
323 /* INPUT: denied, an optlist of denied options
324 * options, a list of options
325 * OUTPUT: if options acceptable 1 else 0
326 * SIDE EFFECTS: error logged
327 */
328 static int options_deny_ok(optlist_t * denied, optlist_t * options)
329 {
330 optlist_t *e;
331 if (!optlist_len(denied)) {
332 w4rn(PMPREFIX "no denied options\n");
333 return 1;
334 } else if(optlist_exists(denied, "*") && optlist_len(options) > 0) {
335 l0g(PMPREFIX "all mount options denied, user tried to specify one\n");
336 return 0;
337 }
338 for(e = denied; e != NULL; e = optlist_next(e))
339 if(optlist_exists(options, optlist_key(e))) {
340 l0g(PMPREFIX "option %s denied\n", optlist_key(e));
341 return 0;
342 }
343 return 1;
344 }
345
346 /* ============================ _options_ok () ============================= */
347 /* INPUT: config, the configuration to use as a basis for checking
348 * volume, a volume to check
349 * OUTPUT: if volume checks okay 1, else 0
350 * SIDE EFFECTS: error logged
351 */
352 static int _options_ok(const struct config *config, const struct vol *volume) {
353
354 assert(config != NULL);
355 assert(volume != NULL);
356
357 if(optlist_len(config->options_allow) > 0 &&
358 optlist_len(config->options_deny) > 0) {
359 l0g(PMPREFIX "possible conflicting option settings (use allow OR deny)\n");
360 return 0;
361 }
362 if(!volume->use_fstab) {
363 if (!options_required_ok
364 (config->options_require, volume->options))
365 return 0;
366 else if(optlist_len(config->options_allow) > 0) {
367 if (!options_allow_ok(config->
368 options_allow,
369 volume->options))
370 return 0;
371 } else if(optlist_len(config->options_deny) > 0) {
372 if (!options_deny_ok(config->
373 options_deny,
374 volume->options))
375 return 0;
376 } else if(optlist_len(volume->options) > 0) {
377 l0g(PMPREFIX "user specified options denied by default\n");
378 return 0;
379 }
380 }
381 return 1;
382 }
383
384 /* ============================ luserconf_volume_record_sane () ============ */
385 /* PRE: config points to a valid struct config
386 vol...
387 */
388 /* FIXME: check to ensure input is legal and reject all else instead of rejecting everyhing that is illegal */
389 bool luserconf_volume_record_sane(const struct config *config, int vol) {
390 const struct vol *vpt;
391 assert(config != NULL);
392 assert(config->volume != NULL);
393 vpt = &config->volume[vol];
394
395 if(config->volume[vol].used_wildcard) {
396 l0g(PMPREFIX "You may not use wildcards in user-defined volumes\n");
397 return FALSE;
398 }
399 if (!_options_ok(config, &config->volume[vol])) {
400 l0g(PMPREFIX "illegal option specified by user\n");
401 return FALSE;
402 }
403 return TRUE;
404 }
405
406 /* ============================ volume_record_sane () ====================== */
407 /* PRE: config points to a valid struct config
408 * FN VAL: if error string error message else NULL */
409 /* FIXME: check to ensure input is legal and reject all else instead of rejecting everyhing that is illegal */
410 bool volume_record_sane(const struct config *config, int vol) {
411 const struct vol *vpt;
412
413 assert(config != NULL);
414 assert(config->volume != NULL);
415 vpt = &config->volume[vol];
416
417 w4rn(PMPREFIX "checking sanity of volume record (%s)\n", vpt->volume);
418 if(!config->command[0][vpt->type]) {
419 l0g("mount command not defined for this type\n");
420 return FALSE;
421 }
422 if((vpt->type == SMBMOUNT || vpt->type == CIFSMOUNT ||
423 vpt->type == NCPMOUNT || vpt->type == NFSMOUNT) &&
424 strlen(vpt->server) == 0) {
425 l0g("remote mount type specified without server\n");
426 return FALSE;
427 }
428 if(vpt->type == NCPMOUNT && !optlist_exists(vpt->options, "user")) {
429 l0g("NCP volume definition missing user option\n");
430 return FALSE;
431 }
432 if(config->command[0][UMOUNT] == NULL) {
433 l0g("umount command not defined\n");
434 return FALSE;
435 }
436 if(strlen(vpt->fs_key_cipher) > 0 && strlen(vpt->fs_key_path) == 0) {
437 l0g("fs_key_cipher defined without fs_key_path\n");
438 return FALSE;
439 }
440 if(strlen(vpt->fs_key_cipher) == 0 && strlen(vpt->fs_key_path) > 0) {
441 l0g("fs_key_path defined without fs_key_cipher\n");
442 return FALSE;
443 }
444 return TRUE;
445 }
446
447 /* ============================ read_luserconf () ========================== */
448 /* NOTE: callback function for reading configuration parameters */
449 static DOTCONF_CB(read_luserconf)
450 {
451 char *home_dir;
452 struct passwd *passwd_ent;
453 if(!ICONTEXT)
454 return "tried to set luserconf from user config";
455 passwd_ent = getpwnam(ICONFIG->user);
456 if(passwd_ent == NULL)
457 home_dir = "~";
458 else
459 home_dir = passwd_ent->pw_dir;
460
461 if(strlen(home_dir) + 1 + strlen(cmd->data.str) > PATH_MAX) // +"/"
462 return "expanded luserconf path too long";
463 strcpy(ICONFIG->luserconf, home_dir);
464 strcat(ICONFIG->luserconf, "/");
465 strcat(ICONFIG->luserconf, cmd->data.str);
466 w4rn(PMPREFIX "path to luserconf set to %s\n", ICONFIG->luserconf);
467 return NULL;
468 }
469
470 /* ============================ read_fsckloop () =========================== */
471 /* NOTE: callback function for reading configuration parameters */
472 static DOTCONF_CB(read_fsckloop)
473 {
474 if(!ICONTEXT)
475 return "tried to set fsckloop from user config";
476 if (strlen(cmd->data.str) > PATH_MAX)
477 return "fsckloop path too long";
478 strncpy(ICONFIG->fsckloop, cmd->data.str, PATH_MAX);
479 ICONFIG->fsckloop[PATH_MAX] = '\0';
480 return NULL;
481 }
482
483 /* ============================ read_int_param () ========================== */
484 /* NOTE: callback function for reading configuration parameters */
485 static DOTCONF_CB(read_int_param)
486 {
487 if(!ICONTEXT)
488 return "tried to set int param from user config";
489 *static_cast(int *, cmd->option->info) = cmd->data.value;
490 return NULL;
491 }
492
493 /* ============================ read_debug () ============================== */
494 /* NOTE: callback function for reading debug parameter */
495 static DOTCONF_CB(read_debug)
496 {
497 /* debug is handled as a special case so global debug can be set ASAP */
498 Debug = cmd->data.value != 0;
499 return read_int_param(cmd, ctx);
500 }
501
502 /* ============================ fstab_value () ============================= */
503 static int fstab_value(const char *volume, const enum fstab_field field,
504 char *value, const int size)
505 {
506 /* PRE: volume points to a valid string != NULL
507 * 0 <= field < 4 (last two fields are integers)
508 * value points to a valid string of size size
509 * POST: value points to the volume's field'th field from /etc/fstab
510 * FN VAL: if error 0 else 1, errors are logged
511 */
512 char *val;
513 #if defined(__linux__)
514 FILE *fstab;
515 struct mntent *fstab_record;
516 if((fstab = setmntent("/etc/fstab", "r")) == NULL) {
517 l0g(PMPREFIX "could not open fstab\n");
518 return 0;
519 }
520 fstab_record = getmntent(fstab);
521 while(fstab_record != NULL && strcmp(fstab_record->mnt_fsname, volume) != 0)
522 fstab_record = getmntent(fstab);
523 if(fstab_record == NULL) {
524 l0g(PMPREFIX "could not get %dth fstab field for %s\n",
525 field, volume);
526 return 0;
527 }
528 switch (field) {
529 case FSTAB_VOLUME:
530 val = fstab_record->mnt_fsname;
531 break;
532 case FSTAB_MNTPT:
533 val = fstab_record->mnt_dir;
534 break;
535 case FSTAB_FSTYPE:
536 val = fstab_record->mnt_type;
537 break;
538 case FSTAB_OPTS:
539 val = fstab_record->mnt_opts;
540 break;
541 default:
542 l0g(PMPREFIX "field of %d invalid\n", field);
543 return 0;
544 }
545 #elif defined (__FreeBSD__) || defined (__OpenBSD__) || defined(__APPLE__)
546 struct fstab *fstab_record;
547 if (!setfsent()) {
548 l0g(PMPREFIX "could not open fstab to determine mount point for %s\n", volume);
549 return 0;
550 }
551 if((fstab_record = getfsspec(volume)) == NULL) {
552 l0g(PMPREFIX "could not get %dth fstab field for %s\n",
553 field, volume);
554 return 0;
555 }
556 switch (field) {
557 case FSTAB_VOLUME:
558 val = fstab_record->fs_spec;
559 break;
560 case FSTAB_MNTPT:
561 val = fstab_record->fs_file;
562 break;
563 case FSTAB_FSTYPE:
564 val = fstab_record->fs_vfstype;
565 break;
566 case FSTAB_OPTS:
567 val = fstab_record->fs_mntops;
568 break;
569 default:
570 l0g(PMPREFIX "field of %d invalid\n", field);
571 return 0;
572 }
573 #else
574 /* FIXME */
575 l0g(PMPREFIX "reading fstab not implemented on arch.\n");
576 return 0;
577 #endif
578 strncpy(value, val, size - 1);
579 value[size - 1] = '\0';
580 #if defined(__linux__)
581 endmntent(fstab);
582 #elif defined (__FreeBSD__) || defined (__OpenBSD__) || defined(__APPLE__)
583 endfsent();
584 #endif
585 return 1;
586 }
587
588 /* ============================ read_volume () ============================= */
589 /* NOTE: callback function for reading volume parameters */
590 static DOTCONF_CB(read_volume) {
591 #define VOL ICONFIG->volume
592 #define VOLCOUNT ICONFIG->volcount
593 enum wildcard_type {
594 WC_NONE = 0,
595 WC_ANYUSER,
596 WC_PGRP,
597 WC_SGRP,
598 } wildcard = WC_NONE;
599 struct passwd *pent;
600 struct vol *vpt;
601 int i;
602
603 if (cmd->arg_count != 8)
604 return "bad number of args for volume";
605
606 if((pent = getpwnam(Config.user)) == NULL) {
607 w4rn(PMPREFIX "getpwnam(\"%s\") failed: %s\n",
608 Config.user, strerror(errno));
609 return NULL;
610 }
611
612 if(strcmp(*cmd->data.list, "*") == 0)
613 wildcard = WC_ANYUSER;
614 else if(strncmp(*cmd->data.list, "@@", 2) == 0)
615 wildcard = WC_SGRP;
616 else if(**cmd->data.list == '@')
617 wildcard = WC_PGRP;
618
619 if(wildcard != WC_NONE && (strcmp(Config.user, "root") == 0 ||
620 pent->pw_uid == 0)) {
621 w4rn(PMPREFIX "volume wildcards ignored for root\n");
622 return NULL;
623 }
624
625 if(wildcard == WC_NONE && strcmp(Config.user, *cmd->data.list) != 0)
626 goto notforme;
627
628 if(wildcard == WC_PGRP || wildcard == WC_SGRP) {
629 const char *gname = *cmd->data.list + strspn(*cmd->data.list, "@");
630 struct group *gent;
631
632 if((gent = getgrgid(pent->pw_gid)) == NULL) {
633 w4rn(PMPREFIX "getgrgid(%ld) failed: %s\n",
634 static_cast(long, pent->pw_gid), strerror(errno));
635 return NULL;
636 }
637 if(strcmp(gname, gent->gr_name) != 0 &&
638 !(wildcard == WC_SGRP && user_in_sgrp(Config.user, gname)))
639 goto notforme;
640 }
641
642 for (i = 0; i < cmd->arg_count; i++)
643 if (strlen(cmd->data.list[i]) > MAX_PAR)
644 return "command too long";
645
646 VOL = xrealloc(VOL, sizeof(struct vol) * (VOLCOUNT + 1));
647 vpt = &VOL[VOLCOUNT];
648 memset(vpt, 0, sizeof(struct vol));
649
650 vpt->globalconf = ICONTEXT ? TRUE : FALSE;
651 strncpy(vpt->user, *cmd->data.list, MAX_PAR);
652 vpt->type = LCLMOUNT;
653 strncpy(vpt->fstype, cmd->data.list[1], sizeof(vpt->fstype));
654
655 for(i = 0; Command[i].type != -1; ++i)
656 if(Command[i].fs != NULL &&
657 strcasecmp(cmd->data.list[1], Command[i].fs) == 0) {
658 vpt->type = Command[i].type;
659 break;
660 }
661
662 if (*cmd->data.list[2] == '-')
663 *vpt->server = '\0';
664 else
665 strncpy(vpt->server, cmd->data.list[2], MAX_PAR);
666 strncpy(vpt->volume, cmd->data.list[3], MAX_PAR);
667 if (*cmd->data.list[4] == '-') {
668 if(!fstab_value(vpt->volume, FSTAB_MNTPT, vpt->mountpoint, PATH_MAX + 1))
669 return "could not determine mount point";
670 vpt->use_fstab = TRUE;
671 } else
672 strncpy(vpt->mountpoint, cmd->data.list[4], MAX_PAR);
673 if (*cmd->data.list[5] == '-') {
674 /* three options: field defined, field is '-' and fstab
675 * should be used (when no mount point was provided either)
676 * or field is '-' and this means no options */
677 if(vpt->use_fstab) {
678 char options[MAX_PAR + 1];
679 if(!fstab_value(vpt->volume, FSTAB_OPTS, options, sizeof(options)))
680 return "could not determine options";
681 if(!str_to_optlist(&vpt->options, options))
682 return "error parsing mount options";
683 } else
684 vpt->options = NULL;
685 } else if(!str_to_optlist(&vpt->options, cmd->data.list[5]))
686 return "error parsing mount options";
687
688 if(*cmd->data.list[6] == '-')
689 *vpt->fs_key_cipher = '\0';
690 else
691 strncpy(vpt->fs_key_cipher, cmd->data.list[6], MAX_PAR);
692
693 if(*cmd->data.list[7] == '-')
694 *vpt->fs_key_path = '\0';
695 else
696 strncpy(vpt->fs_key_path, cmd->data.list[7], MAX_PAR);
697
698 vpt->used_wildcard = FALSE; /* expandconfig() sets this */
699 /* FIXME: these should l0g an error and return NULL so other volumes can continue */
700 VOLCOUNT++;
701 return NULL;
702 #undef VOL
703 #undef VOLCOUNT
704
705 notforme:
706 w4rn(PMPREFIX "ignoring volume record %.20s... (not for me)\n", *cmd->data.list);
707 return NULL;
708 }
709
710 /* ============================ readconfig () ============================== */
711 /* PRE: user is a valid string != NULL
712 * file is the path of config file to read
713 * globalconf == TRUE if file is a global config, else FALSE
714 * config points to a valid struct config
715 * POST: command is an array containing configured mount command lines
716 * config points to a struct config containing configuration read
717 * FN VAL: if error 0 else 1, errors are logged */
718 int readconfig(const char *user, const char *file, int globalconf,
719 struct config *config)
720 {
721 struct configfile *configfile;
722 if(
723 (configfile =
724 dotconf_create(file, legal_config, &globalconf, 0)) == NULL) {
725 l0g(PMPREFIX "error opening %s: %s\n", file, strerror(errno));
726 return 0;
727 }
728 configfile->errorhandler = log_error;
729 if(!dotconf_command_loop(configfile)) {
730 // may not be fatal
731 l0g(PMPREFIX "error reading %s: %s\n", file, strerror(errno));
732 }
733 dotconf_cleanup(configfile);
734 return 1;
735 }
736
737 /* ============================ initconfig () ============================== */
738 /* PRE: config points to a valid struct config
739 * POST: config is initialized (ie: config.volcount == 0) */
740 int initconfig(struct config *config) {
741 int i, j;
742 config->user = NULL;
743 config->debug = DEBUG_DEFAULT;
744 config->mkmntpoint = MKMOUNTPOINT_DEFAULT;
745 config->volcount = 0;
746 /* FIXME: initialize luserconf */
747 strcpy(config->fsckloop, FSCKLOOP_DEFAULT);
748
749 /* set commands to defaults */
750 for(i = 0; Command[i].type != -1; i++) {
751 config->command[0][Command[i].type] = xstrdup(Command[i].def[0]);
752 for(j = 1; Command[i].def[j] != NULL; ++j)
753 config->command[j][Command[i].type] = xstrdup(Command[i].def[j]);
754 config->command[j + 1][Command[i].type] = NULL;
755 }
756
757 /* FIXME: initialize options_require, _allow and _deny */
758
759 config->volume = NULL;
760 /* FIXME: post condition assert all commands not NULL and NULL terminated */
761 return 1;
762 }
763
764 /* ============================ freeconfig () ============================== */
765 /* PRE: config is a valid, initialized struct config
766 * POST: all dynamically allocated memory in config is freed */
767 void freeconfig(struct config *config) {
768 int i = 0, j = 0;
769 /* FIXME: not implemented:
770 optlist_free(&config.options_require);
771 optlist_free(&config.options_allow);
772 optlist_free(&config.options_deny);
773 for (i = 0; i < config.volcount; i++)
774 optlist_free(&config.volume[i].options); FIXME: May be NULL!!
775 */
776 free(config->user);
777 for(i = 0; i < COMMAND_MAX; ++i) {
778 for(j = 0; config->command[j][i] != NULL; ++j) {
779 free(config->command[j][i]);
780 config->command[j][i] = NULL;
781 }
782 }
783 return;
784 }
785
786 /*@@@ Currently copied from libHX @@@*/
787
788 /* noproto */
789 static inline char *HX_strlcat(char *dest, const char *src, size_t len) {
790 return strncat(dest, src, len - strlen(dest));
791 }
792
793 /* noproto */ static inline
794 char *HX_strlncat(char *dest, const char *src, size_t dlen, size_t slen) {
795 size_t r = dlen - strlen(dest);
796 r = (slen < r) ? slen : r;
797 return strncat(dest, src, r);
798 }
799
800 /* noproto */ static
801 char *HX_strclone(char **pa, const char *pb) {
802 if(*pa == pb)
803 return *pa;
804 if(*pa != NULL) {
805 free(*pa);
806 *pa = NULL;
807 }
808 if(pb == NULL)
809 return NULL;
810 if((*pa = malloc(strlen(pb) + 1)) == NULL)
811 return NULL;
812 strcpy(*pa, pb);
813 return *pa;
814 }
815
816 /*
817 FUNCTION <expand_home>
818 INPUT: A pathname like "~" or "~/foo" (PATH) and the username (USER)
819 First char must be '~'. DEST and STR may overlap.
820 ACTION: Expands the pathname
821 OUTPUT: Result is put into DEST, of size SIZE
822 RETURNS: NULL on failure, otherwise DEST
823 */
824 static char *expand_home(const char *path, const char *user, char *dest,
825 size_t size)
826 {
827 struct passwd *pe;
828 char *buf;
829
830 if(*path != '~') {
831 l0g(PMPREFIX "expand_home(path=%s); path does not begin with ~\n", path);
832 return NULL;
833 }
834
835 if((pe = getpwnam(user)) == NULL) {
836 l0g(PMPREFIX "Could not lookup account information for %s\n", user);
837 return NULL;
838 }
839
840 buf = alloca(size);
841 if(snprintf(buf, size, "%s%s", pe->pw_dir, path + 1) >= size)
842 l0g(PMPREFIX "Warning: Not enough buffer space in expand_home()\n");
843
844 strncpy(dest, buf, size);
845 return dest;
846 }
847
848 /*
849 FUNCTION <expand_user_wildcard>
850 INPUT: Username (USER) and string to process (STR)
851 DEST and STR may overlap.
852 ACTION: Substitues all occurrences of & by the username
853 OUTPUT: Writes the result into DEST, which is of size SIZE.
854 RETURNS: NULL on failure, otherwise DEST.
855 */
856 static char *expand_user_wildcard(const char *str, const char *user,
857 char *dest, size_t size)
858 {
859 const char *w_begin = str, *w_end;
860 char *buf;
861
862 if(str == NULL) {
863 l0g(PMPREFIX "expand_user_wildcard(str=NULL)\n");
864 return NULL;
865 }
866 if(dest == NULL)
867 l0g(PMPREFIX "expand_user_wildcard(dest=NULL), please fix\n");
868
869 buf = alloca(size);
870 *buf = '\0';
871 while((w_end = strchr(w_begin, '&')) != NULL) {
872 HX_strlncat(buf, w_begin, size, w_end - w_begin);
873 HX_strlcat(buf, user, size);
874 w_begin = w_end + 1;
875 }
876 if(*w_begin != '\0')
877 HX_strlcat(buf, w_begin, size);
878
879 strncpy(dest, buf, size);
880 return dest;
881 }
882
883 /*
884 FUNCTION <expand_config>
885 INPUT: Filled and valid struct config
886 ACTION: Expands all wildcards in the structure
887 RETURNS: (boolean) false on error
888 */
889 int expandconfig(const struct config *config) {
890 struct vol *vpt;
891 int i;
892
893 for(i = 0; i < config->volcount; ++i) {
894 char tmp[MAX_PAR + 1];
895 vpt = &config->volume[i];
896
897 if(*vpt->mountpoint == '~' && !expand_home(vpt->mountpoint,
898 config->user, vpt->mountpoint, sizeof(vpt->mountpoint)))
899 return 0;
900
901 if(*vpt->volume == '~' && !expand_home(vpt->volume, config->user,
902 vpt->volume, sizeof(vpt->volume)))
903 return 0;
904
905 if(*vpt->fs_key_path == '~' && !expand_home(vpt->fs_key_path,
906 config->user, vpt->fs_key_path, sizeof(vpt->fs_key_path)))
907 return 0;
908
909 if(strcmp(vpt->user, "*") == 0 || *vpt->user == '@') {
910 optlist_t *e;
911 vpt->used_wildcard = TRUE;
912 strcpy(vpt->user, config->user);
913
914 if(!expand_user_wildcard(vpt->volume, config->user,
915 vpt->volume, sizeof(vpt->volume)))
916 return 0;
917
918 if(!expand_user_wildcard(vpt->mountpoint, config->user,
919 vpt->mountpoint, sizeof(vpt->mountpoint)))
920 return 0;
921
922 for(e = vpt->options; e != NULL; e = optlist_next(e)) {
923 if(!expand_user_wildcard(optlist_key(e), config->user,
924 tmp, sizeof(tmp)))
925 return 0;
926 HX_strclone(static_cast(char **, static_cast(void *,
927 &optlist_key(e))), tmp);
928
929
930 if(!expand_user_wildcard(optlist_val(e), config->user,
931 tmp, sizeof(tmp)))
932 return 0;
933 HX_strclone(static_cast(char **, static_cast(void *,
934 &optlist_val(e))), tmp);
935 }
936
937 if(!expand_user_wildcard(vpt->fs_key_path, config->user,
938 vpt->fs_key_path, sizeof(vpt->fs_key_path)))
939 return 0;
940 }
941 }
942 return 1;
943 }
944
945 //-----------------------------------------------------------------------------
946 /*
947 FUNCTION <user_in_sgrp>
948 INPUT: Username (USER) and group (GRP).
949 ACTION: Checks whether the user has GRP as one of its _secondary_
950 group memberships.
951 OUTPUT: -
952 RETURNS: positive non-zero if user is in GRP, zero if not,
953 negative non-zero on failure
954 */
955 static int user_in_sgrp(const char *user, const char *grp) {
956 /* const */ char **wp;
957 struct group *gent;
958
959 if((gent = getgrnam(grp)) == NULL) {
960 w4rn(PMPREFIX "getgrnam(\"%s\") failed: %s\n", grp, strerror(errno));
961 return -1;
962 }
963
964 wp = gent->gr_mem;
965 while(wp != NULL && *wp != NULL) {
966 if(strcmp(*wp, user) == 0)
967 return 1;
968 ++wp;
969 }
970
971 return 0;
972 }
973
974 //=============================================================================
0 /*=============================================================================
1 readconfig.h
2 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of
7 the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to:
16 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 Boston, MA 02110-1301 USA
18
19 -- For details, see the file named "LICENSE.LGPL2"
20 =============================================================================*/
210 #ifndef PMT_READCONFIG_H
221 #define PMT_READCONFIG_H 1
232
24 #include "dotconf.h"
25 #include "xstdlib.h"
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
3 #include <stdbool.h>
304
315 struct config;
326
337 /*
34 * READCONFIG.C
8 * RDCONF1.C
359 */
3610 extern int expandconfig(const struct config *);
11 extern void initconfig(struct config *);
12 extern int readconfig(const char *, int, struct config *);
3713 extern void freeconfig(struct config *);
38 extern int initconfig(struct config *);
14
15 /*
16 * RDCONF2.C
17 */
3918 extern bool luserconf_volume_record_sane(const struct config *, int);
40 extern int readconfig(const char *, const char *, int, struct config *);
4119 extern bool volume_record_sane(const struct config *, int);
4220
43 #ifdef __cplusplus
44 } // extern "C"
45 #endif
46
47 #endif // PMT_READCONFIG_H
48
49 //=============================================================================
21 #endif /* PMT_READCONFIG_H */
00 /*=============================================================================
1 spawn.c
2 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2006
1 pam_mount - spawn.c
2 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2006 - 2007
33
44 This program is free software; you can redistribute it and/or modify
55 it under the terms of the GNU Lesser General Public License as
2727 #include "misc.h"
2828 #include "spawn.h"
2929
30 // Variables
30 /* Variables */
3131 static struct sigaction saved_handler = {.sa_handler = SIG_DFL};
3232
3333 //-----------------------------------------------------------------------------
34 /* spawn_apS
35
36 Wrapper around that glib funky prototype spawn thing. Saves the old
37 %SIGCHLD handler before installing our own (just %SIG_DFL actually).
38
39 On success, returns 1 and the handler is NOT reset. Every [successful] call
40 to spawn_apS() must be followed by spawn_restore_sigchld(). This is usually
41 done after waitpid(), when we are sure there are no more pam_mount-created
42 childs that could potentially confuse GDM.
43
44 On failure, this function returns 0 and the original %SIGCHLD handler will
45 be restored.
46
47 All of this mess is required because GDM gets confused when the waitpid()
48 from its %SIGCHLD handler sees a PID it did not spawn (note: pam_mount
49 creates some). The workaround is to put GDM's %SIGCHLD handler back and
50 set our own. Since pam_mount will explicitly wait for the exact PID it
51 spawned, GDM childs are not touched. Afterwards, the handler is set back
52 to its original value (see semantics above) so that GDM can handle its
53 zombies.
54 */
34 /*
35 * spawn_apS -
36 *
37 * Wrapper around that glib funky prototype spawn thing. Saves the old
38 * %SIGCHLD handler before installing our own (just %SIG_DFL actually).
39 *
40 * On success, returns 1 and the handler is NOT reset. Every [successful] call
41 * to spawn_apS() must be followed by spawn_restore_sigchld(). This is usually
42 * done after waitpid(), when we are sure there are no more pam_mount-created
43 * children that could potentially confuse GDM.
44 *
45 * On failure, this function returns 0 and the original %SIGCHLD handler will
46 * be restored.
47 *
48 * All of this mess is required because GDM gets confused when the waitpid()
49 * from its %SIGCHLD handler sees a PID it did not spawn (note: pam_mount
50 * creates some). The workaround is to put GDM's %SIGCHLD handler back and
51 * set our own. Since pam_mount will explicitly wait for the exact PID it
52 * spawned, GDM childs are not touched. Afterwards, the handler is set back
53 * to its original value (see semantics above) so that GDM can handle its
54 * zombies.
55 */
5556 int spawn_apS(const char *wd, const char *const *argv, const char *const *envp,
56 GSpawnFlags flags, GSpawnChildSetupFunc cs, void *data, int *pid, int *istdin,
57 int *istdout, int *istderr, GError **err)
57 GSpawnFlags flags, GSpawnChildSetupFunc cs, void *data, int *pid,
58 int *istdin, int *istdout, int *istderr, GError **err)
5859 {
59 spawn_set_sigchld();
60 if(g_spawn_async_with_pipes(wd, const_cast(char **, argv),
61 const_cast(char **, envp), flags, cs, data, pid, istdin,
62 istdout, istderr, err))
63 return 1;
64 spawn_restore_sigchld();
65 return 0;
60 spawn_set_sigchld();
61 if (g_spawn_async_with_pipes(wd, const_cast(char **, argv),
62 const_cast(char **, envp), flags | G_SPAWN_SEARCH_PATH, cs, data,
63 pid, istdin, istdout, istderr, err))
64 return 1;
65 spawn_restore_sigchld();
66 return 0;
6667 }
6768
69 /*
70 * spawn_set_sigchld -
71 *
72 * Save the old SIGCHLD handler and then set SIGCHLD to SIG_DFL. This is used
73 * against GDM which does not reap childs as we wanted in its SIGCHLD handler,
74 * so we install our own handler. Returns the value from sigaction().
75 */
76 int spawn_set_sigchld(void)
77 {
78 struct sigaction nh;
6879
69 /* spawn_set_sigchld
80 if (saved_handler.sa_handler != SIG_DFL) {
81 w4rn("saved_handler already grabbed, not overwriting\n");
82 return 0;
83 }
7084
71 Save the old SIGCHLD handler and then set SIGCHLD to SIG_DFL. This is used
72 against GDM which does not reap childs as we wanted in its SIGCHLD handler,
73 so we install our own handler. Returns the value from sigaction().
74 */
75 int spawn_set_sigchld(void) {
76 struct sigaction nh;
77
78 if(saved_handler.sa_handler != SIG_DFL) {
79 w4rn("%s: saved_handler already grabbed, not overwriting\n");
80 return 0;
81 }
82
83 memset(&nh, 0, sizeof(nh));
84 nh.sa_handler = SIG_DFL;
85 sigemptyset(&nh.sa_mask);
86 return sigaction(SIGCHLD, &nh, &saved_handler);
85 memset(&nh, 0, sizeof(nh));
86 nh.sa_handler = SIG_DFL;
87 sigemptyset(&nh.sa_mask);
88 return sigaction(SIGCHLD, &nh, &saved_handler);
8789 }
8890
89
90 /* spawn_restore_sigchld
91
92 Restore the SIGCHLD handler that was saved during spawn_set_sigchld().
93 Returns the value from sigaction().
94 */
95 int spawn_restore_sigchld(void) {
96 int ret;
97 if((ret = sigaction(SIGCHLD, &saved_handler, NULL)) == -1)
98 l0g("%s: sigaction: %s\n", __FUNCTION__, strerror(errno));
99 else
100 saved_handler.sa_handler = NULL;
101 return ret;
91 /*
92 * spawn_restore_sigchld -
93 *
94 * Restore the SIGCHLD handler that was saved during spawn_set_sigchld().
95 * Returns the value from sigaction().
96 */
97 int spawn_restore_sigchld(void)
98 {
99 int ret;
100 if ((ret = sigaction(SIGCHLD, &saved_handler, NULL)) == -1)
101 l0g("%s: sigaction: %s\n", __func__, strerror(errno));
102 else
103 saved_handler.sa_handler = NULL;
104 return ret;
102105 }
103
104 //=============================================================================
0 /*=============================================================================
1 spawn.h
2 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of
7 the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to:
16 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 Boston, MA 02110-1301 USA
18
19 -- For details, see the file named "LICENSE.LGPL2"
20 =============================================================================*/
210 #ifndef PMT_SPAWN_H
221 #define PMT_SPAWN_H 1
232
243 #include <glib.h>
254
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
305 /*
31 * SPAWN.C
6 * SPAWN.C
327 */
338 extern int spawn_apS(const char *, const char *const *, const char *const *,
34 GSpawnFlags, GSpawnChildSetupFunc, void *, int *, int *, int *, int *,
35 GError **);
9 GSpawnFlags, GSpawnChildSetupFunc, void *, int *, int *, int *, int *,
10 GError **);
3611 extern int spawn_restore_sigchld(void);
3712 extern int spawn_set_sigchld(void);
3813
39 #ifdef __cplusplus
40 } // extern "C"
41 #endif
42
43 #endif // PMT_SPAWN_H
44
45 //=============================================================================
14 #endif /* PMT_SPAWN_H */
+0
-1
src/template-nolibtool.c less more
0 #include "template.c"
+0
-95
src/template.c less more
0 /*=============================================================================
1 template.c
2 Copyright (C) W. Michael Putello <new@flyn.org>, 1999
3 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of
8 the License, or (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this program; if not, write to:
17 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18 Boston, MA 02110-1301 USA
19
20 -- For details, see the file named "LICENSE.LGPL2"
21 =============================================================================*/
22 #include <config.h>
23 #include <sys/stat.h>
24 #include <dirent.h>
25 #include <glib.h>
26 #include <libgen.h> // basename()
27 #include <limits.h>
28 #include <stdio.h>
29 #include <string.h>
30 #include <unistd.h>
31 #ifdef HAVE_PWDB_PWDB_PUBLIC_H
32 # include <pwdb/pwdb_public.h>
33 #else
34 # include <pwd.h>
35 #endif
36 #include "fmt_ptrn.h"
37 #include "template.h"
38
39 // Functions
40 static int _at_path(char *);
41 static void _build_template_dir(char *, const char *, const char *);
42
43 // Variables
44 static char _template_errmsg[BUFSIZ + 1];
45 static char _template_local_dir[PATH_MAX + 1];
46 static char _template_global_dir[PATH_MAX + 1];
47
48 /* ============================ _build_template_dir () ====================== */
49 static void _build_template_dir(char *path, const char *dir,
50 const char *type)
51 {
52 strcpy(path, dir);
53 if(type != NULL) {
54 strcat(path, "/");
55 strcat(path, type);
56 }
57 strcat(path, "/");
58 }
59
60 /* ============================ _at_path () ================================= */
61 static int _at_path(char *template_path) {
62 /* Make sure template_path is big enough to have .gz added to the end! */
63 struct stat stat_buf;
64 if(stat(template_path, &stat_buf) == 0 && S_ISREG(stat_buf.st_mode))
65 return 1;
66 else {
67 strcat(template_path, ".gz");
68 if(stat(template_path, &stat_buf) == 0 && S_ISREG(stat_buf.st_mode))
69 return 1;
70 }
71 return 0;
72 }
73
74 /* ============================ template_find () ============================ */
75 int template_find(char *template_path, /*const char *filename,*/
76 const char *type, const char *template_name,
77 const int use_global)
78 {
79 if (!use_global) {
80 /* Try $HOME/.new/templates first. */
81 _build_template_dir(template_path, _template_local_dir, type);
82 strcat(template_path, template_name);
83 }
84 if((!use_global && !_at_path(template_path))
85 || use_global) {
86 _build_template_dir(template_path, _template_global_dir, type);
87 strcat(template_path, template_name);
88 }
89 if (!_at_path(template_path)) {
90 sprintf(_template_errmsg, "no template for type %s", type);
91 return 0;
92 }
93 return 1;
94 }
+0
-37
src/template.h less more
0 /*=============================================================================
1 template.h
2 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2005 - 2006
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of
7 the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to:
16 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 Boston, MA 02110-1301 USA
18
19 -- For details, see the file named "LICENSE.LGPL2"
20 =============================================================================*/
21 #ifndef PMT_TEMPLATE_H
22 #define PMT_TEMPLATE_H 1
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 extern int template_find(char *, const char *, const char *, const int);
29
30 #ifdef __cplusplus
31 } // extern "C"
32 #endif
33
34 #endif // PMT_TEMPLATE_H
35
36 //=============================================================================
00 /*=============================================================================
1 xstdlib.c
2 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2006
1 pam_mount - xstdlib.c
2 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2006 - 2007
33
44 This program is free software; you can redistribute it and/or modify
55 it under the terms of the GNU Lesser General Public License as
2727 #include "xstdlib.h"
2828
2929 //-----------------------------------------------------------------------------
30 /* xmalloc
31 @n: size of the new buffer
32
33 Wrapper around malloc() that warns when no new memory block could be
34 obtained.
35 */
36 void *xmalloc(size_t n) {
37 void *ret;
38 if((ret = malloc(n)) == NULL)
39 l0g(PMPREFIX "xmalloc: Could not allocate %lu bytes\n",
40 static_cast(unsigned long, n));
41 return ret;
30 /*
31 * xmalloc - allocate memory
32 * @n: size of the new buffer
33 *
34 * Wrapper around malloc() that warns when no new memory block could be
35 * obtained.
36 */
37 void *xmalloc(size_t n)
38 {
39 void *ret;
40 if ((ret = malloc(n)) == NULL)
41 l0g("%s: Could not allocate %lu bytes\n",
42 __func__, static_cast(unsigned long, n));
43 return ret;
4244 }
4345
44
45 /* xrealloc
46 @orig: original address of the buffer
47 @n: new size of the buffer
48
49 Wrapper around realloc() that warns when no new memory block could be
50 obtained.
51 */
52 void *xrealloc(void *orig, size_t n) {
53 void *ret;
54 if((ret = realloc(orig, n)) == NULL)
55 l0g(PMPREFIX "xrealloc: Could not reallocate to %lu bytes\n",
56 static_cast(unsigned long, n));
57 return ret;
46 /*
47 * xrealloc - resize memory block
48 * @orig: original address of the buffer
49 * @n: new size of the buffer
50 *
51 * Wrapper around realloc() that warns when no new memory block could be
52 * obtained.
53 */
54 void *xrealloc(void *orig, size_t n)
55 {
56 void *ret;
57 if ((ret = realloc(orig, n)) == NULL)
58 l0g("%s: Could not reallocate to %lu bytes\n",
59 __func__, static_cast(unsigned long, n));
60 return ret;
5861 }
5962
60
61 /* xzalloc
62 @n: bytes to allocate
63
64 Allocates @n bytes and clears them if the allocation succeded. Returns
65 the pointer to the newly allocated memory if any, or %NULL on failure.
66 */
67 void *xzalloc(size_t n) {
68 void *ret;
69 if((ret = xmalloc(n)) != NULL)
70 memset(ret, 0, n);
71 return ret;
63 /*
64 * xzalloc -
65 * @n: bytes to allocate
66 *
67 * Allocates @n bytes and clears them if the allocation succeded. Returns
68 * the pointer to the newly allocated memory if any, or %NULL on failure.
69 */
70 void *xzalloc(size_t n)
71 {
72 void *ret;
73 if ((ret = xmalloc(n)) != NULL)
74 memset(ret, 0, n);
75 return ret;
7276 }
7377
74
75 /* xmemdup
76 @src: pointer to source data
77 @n: amount of bytes to copy
78
79 Allocates a new block of size @n and copies @n bytes from @src to it,
80 and returns it. Returns %NULL on allocation failure.
81 */
82 void *xmemdup(const void *src, size_t n) {
83 void *ret;
84 if((ret = xmalloc(n)) == NULL)
85 return ret;
86 return memcpy(ret, src, n);
78 /*
79 * xmemdup -
80 * @src: pointer to source data
81 * @n: amount of bytes to copy
82 *
83 * Allocates a new block of size @n and copies @n bytes from @src to it,
84 * and returns it. Returns %NULL on allocation failure.
85 */
86 void *xmemdup(const void *src, size_t n)
87 {
88 void *ret;
89 if ((ret = xmalloc(n)) == NULL)
90 return ret;
91 return memcpy(ret, src, n);
8792 }
8893
89
90 /* xstrdup
91 @src: source string
92
93 Basically just the usual strdup(), but with error reporting to fprintf()
94 should allocation fail.
95 */
96 char *xstrdup(const char *src) {
97 return xmemdup(src, strlen(src) + 1);
94 /*
95 * xstrdup -
96 * @src: source string
97 *
98 * Basically just the usual strdup(), but with error reporting to fprintf()
99 * should allocation fail.
100 */
101 char *xstrdup(const char *src)
102 {
103 return xmemdup(src, strlen(src) + 1);
98104 }
99105
106 /*
107 * xstrndup -
108 * @src: source string
109 * @max: maximum number of characters to copy
110 *
111 * Basically just the usual strndup(), but with error reporting to fprintf()
112 * should allocation fail.
113 */
114 char *xstrndup(const char *src, size_t max)
115 {
116 size_t s = strlen(src);
117 char *ret;
100118
101 /* xstrndup
102 @src: source string
103 @max: maximum number of characters to copy
119 if (max < s)
120 s = max;
121 if ((ret = xmemdup(src, s + 1)) == NULL)
122 return NULL;
104123
105 Basically just the usual strndup(), but with error reporting to fprintf()
106 should allocation fail.
107 */
108 char *xstrndup(const char *src, size_t max) {
109 size_t s = strlen(src);
110 char *ret;
111
112 if(max < s)
113 s = max;
114 if((ret = xmemdup(src, s + 1)) == NULL)
115 return NULL;
116
117 ret[s] = '\0';
118 return ret;
124 ret[s] = '\0';
125 return ret;
119126 }
120
121 //=============================================================================
0 /*=============================================================================
1 xstdlib.h
2 Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2006
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of
7 the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to:
16 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 Boston, MA 02110-1301 USA
18
19 -- For details, see the file named "LICENSE.LGPL2"
20 =============================================================================*/
210 #ifndef PMT_XSTDLIB_H
221 #define PMT_XSTDLIB_H 1
232
243 #include <sys/types.h>
254
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 typedef int bool;
31
325 /*
33 * XSTDLIB.C
6 * XSTDLIB.C
347 */
358 extern void *xmalloc(size_t);
369 extern void *xmemdup(const void *, size_t);
3912 extern char *xstrndup(const char *, size_t);
4013 extern void *xzalloc(size_t);
4114
42 #ifdef __cplusplus
43 } // extern "C"
44 #endif
45
46 #endif // PMT_XSTDLIB_H
47
48 //=============================================================================
15 #endif /* PMT_XSTDLIB_H */