Skip to main content

pavao_src/
lib.rs

1#![warn(missing_docs)]
2
3//! Builds the bundled Samba source used by Pavão's `vendored` feature.
4//!
5//! This crate is intended for build scripts. It clones the Samba release matching this crate's
6//! version, configures the native build, and produces a static `libsmbclient` archive plus public
7//! headers.
8//!
9//! # Examples
10//!
11//! ```no_run
12//! let artifacts = pavao_src::Build::new().build();
13//! println!("cargo:rustc-link-search=native={}", artifacts.lib_dir.display());
14//! ```
15
16use std::collections::HashSet;
17use std::ffi::OsStr;
18use std::path::{Path, PathBuf};
19use std::process::Command;
20use std::{env, fs};
21
22/// Source files included in the static `libsmbclient` archive.
23const SRC_FILES: &[&str] = &[
24    "third_party/heimdal/lib/com_err/compile_et.c",
25    "third_party/heimdal/lib/com_err/parse.tab.c",
26    "third_party/heimdal/lib/com_err/lex.lex.c",
27    "lib/replace/replace.c",
28    "third_party/heimdal/lib/vers/print_version.c",
29    "third_party/heimdal_build/version.c",
30    "third_party/heimdal_build/compile_et.objlist.empty.c",
31    "third_party/heimdal/lib/roken/base64.c",
32    "third_party/heimdal/lib/roken/ct.c",
33    "third_party/heimdal/lib/roken/hex.c",
34    "third_party/heimdal/lib/roken/bswap.c",
35    "third_party/heimdal/lib/roken/dumpdata.c",
36    "third_party/heimdal/lib/roken/emalloc.c",
37    // Only built by Samba's own `third_party/heimdal_build/wscript_build`
38    // when `HAVE_MEMSET_S` is unset. Darwin's libc has provided `memset_s`
39    // since macOS 10.9, so macOS's own configure sets `HAVE_MEMSET_S` and
40    // never compiles this fallback; glibc still lacks it, so Linux builds
41    // still need it.
42    #[cfg(target_os = "linux")]
43    "third_party/heimdal/lib/roken/memset_s.c",
44    "third_party/heimdal/lib/roken/ecalloc.c",
45    "third_party/heimdal/lib/roken/getarg.c",
46    "third_party/heimdal/lib/roken/getauxval.c",
47    "third_party/heimdal/lib/roken/get_window_size.c",
48    "third_party/heimdal/lib/roken/getdtablesize.c",
49    "third_party/heimdal/lib/roken/h_errno.c",
50    "third_party/heimdal/lib/roken/issuid.c",
51    "third_party/heimdal/lib/roken/net_read.c",
52    "third_party/heimdal/lib/roken/net_write.c",
53    "third_party/heimdal/lib/roken/parse_time.c",
54    "third_party/heimdal/lib/roken/parse_units.c",
55    "third_party/heimdal/lib/roken/vis.c",
56    "third_party/heimdal/lib/roken/strlwr.c",
57    "third_party/heimdal/lib/roken/strsep_copy.c",
58    "third_party/heimdal/lib/roken/strsep.c",
59    "third_party/heimdal/lib/roken/strupr.c",
60    "third_party/heimdal/lib/roken/strpool.c",
61    "third_party/heimdal/lib/roken/estrdup.c",
62    "third_party/heimdal/lib/roken/erealloc.c",
63    "third_party/heimdal/lib/roken/secure_getenv.c",
64    "third_party/heimdal/lib/roken/simple_exec.c",
65    "third_party/heimdal/lib/roken/strcollect.c",
66    "third_party/heimdal/lib/roken/rtbl.c",
67    "third_party/heimdal/lib/roken/rand.c",
68    "third_party/heimdal/lib/roken/cloexec.c",
69    "third_party/heimdal/lib/roken/clz.c",
70    "third_party/heimdal/lib/roken/xfree.c",
71    "third_party/heimdal/lib/roken/timeval.c",
72    "third_party/heimdal/lib/roken/mergesort.c",
73    "third_party/heimdal/lib/roken/mergesort_r.c",
74    "third_party/heimdal_build/replace.c",
75    "third_party/heimdal/lib/base/array.c",
76    "third_party/heimdal/lib/base/bool.c",
77    "third_party/heimdal/lib/base/bsearch.c",
78    "third_party/heimdal/lib/base/data.c",
79    "third_party/heimdal/lib/base/db.c",
80    "third_party/heimdal/lib/base/dict.c",
81    "third_party/heimdal/lib/base/error.c",
82    "third_party/heimdal/lib/base/heimbase.c",
83    "third_party/heimdal/lib/base/string.c",
84    "third_party/heimdal/lib/base/number.c",
85    "third_party/heimdal/lib/base/null.c",
86    "third_party/heimdal/lib/base/json.c",
87    "third_party/heimdal/lib/base/heim_err.c",
88    "third_party/heimdal/lib/com_err/com_err.c",
89    "third_party/heimdal/lib/com_err/error.c",
90    "third_party/heimdal/lib/asn1/gen_copy.c",
91    "third_party/heimdal/lib/asn1/gen_print.c",
92    "third_party/heimdal/lib/asn1/gen_decode.c",
93    "third_party/heimdal/lib/asn1/gen_encode.c",
94    "third_party/heimdal/lib/asn1/gen_free.c",
95    "third_party/heimdal/lib/asn1/gen_glue.c",
96    "third_party/heimdal/lib/asn1/gen_length.c",
97    "third_party/heimdal/lib/asn1/gen_seq.c",
98    "third_party/heimdal/lib/asn1/gen_template.c",
99    "third_party/heimdal/lib/asn1/hash.c",
100    "third_party/heimdal/lib/asn1/symbol.c",
101    "third_party/heimdal/lib/asn1/main.c",
102    "third_party/heimdal/lib/asn1/asn1parse.tab.c",
103    "third_party/heimdal/lib/asn1/lex.lex.c",
104    "third_party/heimdal_build/asn1_compile.objlist.empty.c",
105    "third_party/heimdal/lib/asn1/gen.c",
106    "lib/talloc/talloc.c",
107    "lib/util/time_basic.c",
108    "lib/util/blocking.c",
109    "lib/util/close_low_fd.c",
110    #[cfg(target_os = "linux")]
111    "lib/util/gpfswrap.c",
112    "lib/util/debug.c",
113    "lib/util/iov_buf.c",
114    "third_party/heimdal/lib/roken/resolve.c",
115    "third_party/heimdal/lib/roken/socket.c",
116    "third_party/heimdal/lib/roken/roken_gethostby.c",
117    "third_party/heimdal/lib/roken/mkostemp.c",
118    "third_party/heimdal/lib/roken/getuserinfo.c",
119    "lib/tevent/tevent.c",
120    "lib/tevent/tevent_debug.c",
121    "lib/tevent/tevent_fd.c",
122    "lib/tevent/tevent_immediate.c",
123    "lib/tevent/tevent_queue.c",
124    "lib/tevent/tevent_req.c",
125    "lib/tevent/tevent_wrapper.c",
126    "lib/tevent/tevent_poll.c",
127    "lib/tevent/tevent_threads.c",
128    "lib/tevent/tevent_signal.c",
129    "lib/tevent/tevent_standard.c",
130    "lib/tevent/tevent_timed.c",
131    "lib/tevent/tevent_util.c",
132    "lib/tevent/tevent_wakeup.c",
133    #[cfg(target_os = "linux")]
134    "lib/tevent/tevent_epoll.c",
135    "lib/util/sys_rw.c",
136    "lib/util/sys_rw_data.c",
137    "lib/util/fault.c",
138    "lib/util/signal.c",
139    "lib/util/util_process.c",
140    "lib/util/genrand.c",
141    "lib/util/setid.c",
142    "lib/util/charset/iconv.c",
143    "lib/util/charset/weird.c",
144    "lib/util/charset/charset_macosxfs.c",
145    "lib/util/tini.c",
146    "lib/util/charset/codepoints.c",
147    "lib/util/charset/convert_string.c",
148    "lib/util/charset/util_str.c",
149    "lib/util/charset/util_unistr_w.c",
150    "lib/util/charset/pull_push.c",
151    "lib/util/charset/util_unistr.c",
152    "lib/util/tiniparser.c",
153    "lib/util/data_blob.c",
154    "lib/util/util_file.c",
155    "lib/util/sys_popen.c",
156    "lib/util/time.c",
157    "lib/util/util.c",
158    "lib/util/idtree.c",
159    "lib/util/substitute.c",
160    "lib/util/util_strlist.c",
161    "lib/util/strv_util.c",
162    "lib/util/bitmap.c",
163    "lib/util/select.c",
164    "lib/util/pidfile.c",
165    "lib/util/become_daemon.c",
166    "lib/util/mkdir_p.c",
167    "lib/util/smb_strtox.c",
168    "lib/crypto/md4.c",
169    "lib/util/ms_fnmatch.c",
170    "lib/util/strv.c",
171    "lib/util/base64.c",
172    "lib/util/dprintf.c",
173    "lib/util/dns_cmp.c",
174    "lib/util/fsusage.c",
175    "lib/util/genrand_util.c",
176    "lib/util/getpass.c",
177    "lib/util/idtree_random.c",
178    "lib/util/memcache.c",
179    "lib/util/params.c",
180    "lib/util/rbtree.c",
181    "lib/util/rfc1738.c",
182    "lib/util/server_id.c",
183    "lib/util/smb_threads.c",
184    "lib/util/system.c",
185    "lib/util/talloc_keep_secret.c",
186    "lib/util/talloc_stack.c",
187    "lib/util/tevent_debug.c",
188    "lib/util/tfork.c",
189    "lib/util/tftw.c",
190    "lib/util/unix_match.c",
191    "lib/util/util_id.c",
192    "lib/util/util_net.c",
193    "lib/util/util_paths.c",
194    "lib/util/util_str.c",
195    "lib/util/util_str_common.c",
196    "lib/util/util_strlist_v3.c",
197    "dynconfig/dynconfig.c",
198    "lib/util/util_str_hex.c",
199    "libcli/util/doserr.c",
200    "libcli/util/errormap.c",
201    "libcli/util/nterr.c",
202    "libcli/util/errmap_unix.c",
203    "libcli/util/hresult.c",
204    "third_party/heimdal/lib/base/config_file.c",
205    "third_party/heimdal/lib/base/context.c",
206    "third_party/heimdal/lib/base/error_string.c",
207    "third_party/heimdal/lib/base/expand_path.c",
208    "third_party/heimdal/lib/base/log.c",
209    "third_party/heimdal/lib/base/plugin.c",
210    "third_party/heimdal/lib/base/warn.c",
211    "librpc/ndr/ndr_string.c",
212    "librpc/ndr/ndr_basic.c",
213    "librpc/ndr/uuid.c",
214    "librpc/ndr/ndr.c",
215    "librpc/ndr/ndr_misc.c",
216    "librpc/gen_ndr/ndr_misc.c",
217    "librpc/ndr/util.c",
218    "lib/util/stable_sort.c",
219    "third_party/heimdal/lib/asn1/asn1_pkcs8_asn1.c",
220    "third_party/heimdal/lib/asn1/asn1_pkcs9_asn1.c",
221    "third_party/heimdal/lib/asn1/asn1_rfc4108_asn1.c",
222    "third_party/heimdal/lib/asn1/asn1_rfc2459_asn1.c",
223    "third_party/heimdal/lib/hx509/asn1_pkcs10_asn1.c",
224    "third_party/heimdal/lib/asn1/asn1_krb5_asn1.c",
225    "third_party/heimdal/lib/asn1/der_get.c",
226    "third_party/heimdal/lib/asn1/der_put.c",
227    "third_party/heimdal/lib/asn1/der_free.c",
228    "third_party/heimdal/lib/asn1/der_format.c",
229    "third_party/heimdal/lib/asn1/der_length.c",
230    "third_party/heimdal/lib/asn1/der_copy.c",
231    "third_party/heimdal/lib/asn1/der_cmp.c",
232    "third_party/heimdal/lib/asn1/der_print.c",
233    "third_party/heimdal/lib/asn1/extra.c",
234    "third_party/heimdal/lib/asn1/timegm.c",
235    "third_party/heimdal/lib/asn1/template.c",
236    "third_party/heimdal/lib/asn1/oid_resolution.c",
237    "third_party/heimdal/lib/asn1/asn1_err.c",
238    "third_party/heimdal_build/asn1.empty.c",
239    "third_party/heimdal/lib/asn1/asn1_kx509_asn1.c",
240    "third_party/heimdal/lib/hx509/asn1_ocsp_asn1.c",
241    "third_party/heimdal/lib/asn1/asn1_digest_asn1.c",
242    "third_party/heimdal/lib/asn1/asn1_pkinit_asn1.c",
243    "third_party/heimdal/lib/asn1/asn1_cms_asn1.c",
244    "third_party/heimdal/lib/asn1/asn1_pkcs12_asn1.c",
245    "lib/tdb/common/check.c",
246    "lib/tdb/common/error.c",
247    "lib/tdb/common/tdb.c",
248    "lib/tdb/common/traverse.c",
249    "lib/tdb/common/freelistcheck.c",
250    "lib/tdb/common/lock.c",
251    "lib/tdb/common/dump.c",
252    "lib/tdb/common/freelist.c",
253    "lib/tdb/common/io.c",
254    "lib/tdb/common/open.c",
255    "lib/tdb/common/transaction.c",
256    "lib/tdb/common/hash.c",
257    "lib/tdb/common/summary.c",
258    "lib/tdb/common/rescue.c",
259    "lib/tdb/common/mutex.c",
260    "librpc/gen_ndr/ndr_security.c",
261    "librpc/ndr/ndr_sec_helper.c",
262    "librpc/gen_ndr/ndr_conditional_ace.c",
263    "libcli/security/dom_sid.c",
264    "libcli/security/display_sec.c",
265    "libcli/security/secace.c",
266    "libcli/security/secacl.c",
267    "libcli/security/security_descriptor.c",
268    "libcli/security/sddl.c",
269    "libcli/security/privileges.c",
270    "libcli/security/security_token.c",
271    "libcli/security/access_check.c",
272    "libcli/security/object_tree.c",
273    "libcli/security/create_descriptor.c",
274    "libcli/security/util_sid.c",
275    "libcli/security/session.c",
276    "libcli/security/secdesc.c",
277    "libcli/security/conditional_ace.c",
278    "libcli/security/sddl_conditional_ace.c",
279    "libcli/security/claims-conversions.c",
280    "libcli/security/trust_forest_info.c",
281    "libcli/security/claims_transformation.lex.c",
282    "libcli/security/claims_transformation.tab.c",
283    "third_party/heimdal/lib/hcrypto/libtommath/bn_cutoffs.c",
284    "third_party/heimdal/lib/hcrypto/libtommath/bn_deprecated.c",
285    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_2expt.c",
286    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_abs.c",
287    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_add.c",
288    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_add_d.c",
289    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_addmod.c",
290    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_and.c",
291    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_clamp.c",
292    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_clear.c",
293    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_clear_multi.c",
294    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_cmp.c",
295    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_cmp_d.c",
296    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_cmp_mag.c",
297    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_cnt_lsb.c",
298    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_complement.c",
299    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_copy.c",
300    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_count_bits.c",
301    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_decr.c",
302    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_div.c",
303    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_div_2.c",
304    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_div_2d.c",
305    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_div_3.c",
306    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_div_d.c",
307    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_dr_is_modulus.c",
308    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_dr_reduce.c",
309    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_dr_setup.c",
310    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_error_to_string.c",
311    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_exch.c",
312    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_expt_u32.c",
313    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_exptmod.c",
314    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_exteuclid.c",
315    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_fread.c",
316    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_from_sbin.c",
317    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_from_ubin.c",
318    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_fwrite.c",
319    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_gcd.c",
320    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_get_double.c",
321    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_get_i32.c",
322    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_get_i64.c",
323    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_get_l.c",
324    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_get_ll.c",
325    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_get_mag_u32.c",
326    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_get_mag_u64.c",
327    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_get_mag_ul.c",
328    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_get_mag_ull.c",
329    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_grow.c",
330    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_incr.c",
331    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_init.c",
332    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_init_copy.c",
333    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_init_i32.c",
334    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_init_i64.c",
335    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_init_l.c",
336    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_init_ll.c",
337    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_init_multi.c",
338    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_init_set.c",
339    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_init_size.c",
340    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_init_u32.c",
341    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_init_u64.c",
342    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_init_ul.c",
343    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_init_ull.c",
344    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_invmod.c",
345    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_is_square.c",
346    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_iseven.c",
347    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_isodd.c",
348    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_kronecker.c",
349    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_lcm.c",
350    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_log_u32.c",
351    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_lshd.c",
352    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_mod.c",
353    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_mod_2d.c",
354    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_mod_d.c",
355    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_montgomery_calc_normalization.c",
356    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_montgomery_reduce.c",
357    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_montgomery_setup.c",
358    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_mul.c",
359    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_mul_2.c",
360    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_mul_2d.c",
361    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_mul_d.c",
362    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_mulmod.c",
363    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_neg.c",
364    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_or.c",
365    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_pack.c",
366    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_pack_count.c",
367    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_prime_fermat.c",
368    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_prime_frobenius_underwood.c",
369    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_prime_is_prime.c",
370    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_prime_miller_rabin.c",
371    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_prime_next_prime.c",
372    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_prime_rabin_miller_trials.c",
373    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_prime_rand.c",
374    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_prime_strong_lucas_selfridge.c",
375    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_radix_size.c",
376    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_radix_smap.c",
377    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_rand.c",
378    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_read_radix.c",
379    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_reduce.c",
380    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_reduce_2k.c",
381    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_reduce_2k_l.c",
382    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_reduce_2k_setup.c",
383    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_reduce_2k_setup_l.c",
384    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_reduce_is_2k.c",
385    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_reduce_is_2k_l.c",
386    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_reduce_setup.c",
387    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_root_u32.c",
388    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_rshd.c",
389    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_sbin_size.c",
390    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_set.c",
391    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_set_double.c",
392    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_set_i32.c",
393    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_set_i64.c",
394    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_set_l.c",
395    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_set_ll.c",
396    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_set_u32.c",
397    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_set_u64.c",
398    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_set_ul.c",
399    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_set_ull.c",
400    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_shrink.c",
401    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_signed_rsh.c",
402    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_sqr.c",
403    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_sqrmod.c",
404    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_sqrt.c",
405    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_sqrtmod_prime.c",
406    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_sub.c",
407    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_sub_d.c",
408    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_submod.c",
409    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_to_radix.c",
410    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_to_sbin.c",
411    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_to_ubin.c",
412    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_ubin_size.c",
413    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_unpack.c",
414    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_xor.c",
415    "third_party/heimdal/lib/hcrypto/libtommath/bn_mp_zero.c",
416    "third_party/heimdal/lib/hcrypto/libtommath/bn_prime_tab.c",
417    "third_party/heimdal/lib/hcrypto/libtommath/bn_s_mp_add.c",
418    "third_party/heimdal/lib/hcrypto/libtommath/bn_s_mp_balance_mul.c",
419    "third_party/heimdal/lib/hcrypto/libtommath/bn_s_mp_exptmod.c",
420    "third_party/heimdal/lib/hcrypto/libtommath/bn_s_mp_exptmod_fast.c",
421    "third_party/heimdal/lib/hcrypto/libtommath/bn_s_mp_get_bit.c",
422    "third_party/heimdal/lib/hcrypto/libtommath/bn_s_mp_invmod_fast.c",
423    "third_party/heimdal/lib/hcrypto/libtommath/bn_s_mp_invmod_slow.c",
424    "third_party/heimdal/lib/hcrypto/libtommath/bn_s_mp_karatsuba_mul.c",
425    "third_party/heimdal/lib/hcrypto/libtommath/bn_s_mp_karatsuba_sqr.c",
426    "third_party/heimdal/lib/hcrypto/libtommath/bn_s_mp_montgomery_reduce_fast.c",
427    "third_party/heimdal/lib/hcrypto/libtommath/bn_s_mp_mul_digs.c",
428    "third_party/heimdal/lib/hcrypto/libtommath/bn_s_mp_mul_digs_fast.c",
429    "third_party/heimdal/lib/hcrypto/libtommath/bn_s_mp_mul_high_digs.c",
430    "third_party/heimdal/lib/hcrypto/libtommath/bn_s_mp_mul_high_digs_fast.c",
431    "third_party/heimdal/lib/hcrypto/libtommath/bn_s_mp_prime_is_divisible.c",
432    "third_party/heimdal/lib/hcrypto/libtommath/bn_s_mp_rand_jenkins.c",
433    "third_party/heimdal/lib/hcrypto/libtommath/bn_s_mp_rand_platform.c",
434    "third_party/heimdal/lib/hcrypto/libtommath/bn_s_mp_reverse.c",
435    "third_party/heimdal/lib/hcrypto/libtommath/bn_s_mp_sqr.c",
436    "third_party/heimdal/lib/hcrypto/libtommath/bn_s_mp_sqr_fast.c",
437    "third_party/heimdal/lib/hcrypto/libtommath/bn_s_mp_sub.c",
438    "third_party/heimdal/lib/hcrypto/libtommath/bn_s_mp_toom_mul.c",
439    "third_party/heimdal/lib/hcrypto/libtommath/bn_s_mp_toom_sqr.c",
440    "third_party/heimdal/lib/hcrypto/aes.c",
441    "third_party/heimdal/lib/hcrypto/bn.c",
442    "third_party/heimdal/lib/hcrypto/dh.c",
443    "third_party/heimdal/lib/hcrypto/dh-ltm.c",
444    "third_party/heimdal/lib/hcrypto/des.c",
445    "third_party/heimdal/lib/hcrypto/dsa.c",
446    "third_party/heimdal/lib/hcrypto/engine.c",
447    "third_party/heimdal/lib/hcrypto/md4.c",
448    "third_party/heimdal/lib/hcrypto/md5.c",
449    "third_party/heimdal/lib/hcrypto/rsa.c",
450    "third_party/heimdal/lib/hcrypto/rsa-ltm.c",
451    "third_party/heimdal/lib/hcrypto/rc2.c",
452    "third_party/heimdal/lib/hcrypto/rc4.c",
453    "third_party/heimdal/lib/hcrypto/rijndael-alg-fst.c",
454    "third_party/heimdal/lib/hcrypto/rnd_keys.c",
455    "third_party/heimdal/lib/hcrypto/sha.c",
456    "third_party/heimdal/lib/hcrypto/sha256.c",
457    "third_party/heimdal/lib/hcrypto/sha512.c",
458    "third_party/heimdal/lib/hcrypto/ui.c",
459    "third_party/heimdal/lib/hcrypto/evp.c",
460    "third_party/heimdal/lib/hcrypto/evp-hcrypto.c",
461    "third_party/heimdal/lib/hcrypto/pkcs5.c",
462    "third_party/heimdal/lib/hcrypto/pkcs12.c",
463    "third_party/heimdal/lib/hcrypto/rand.c",
464    "third_party/heimdal/lib/hcrypto/rand-unix.c",
465    "third_party/heimdal/lib/hcrypto/rand-fortuna.c",
466    "third_party/heimdal/lib/hcrypto/rand-timer.c",
467    "third_party/heimdal/lib/hcrypto/hmac.c",
468    "third_party/heimdal/lib/hcrypto/camellia.c",
469    "third_party/heimdal/lib/hcrypto/camellia-ntt.c",
470    "third_party/heimdal/lib/hcrypto/common.c",
471    "third_party/heimdal/lib/hcrypto/validate.c",
472    "third_party/heimdal/lib/wind/wind_err.c",
473    "third_party/heimdal/lib/wind/stringprep.c",
474    "third_party/heimdal/lib/wind/errorlist.c",
475    "third_party/heimdal/lib/wind/errorlist_table.c",
476    "third_party/heimdal/lib/wind/normalize.c",
477    "third_party/heimdal/lib/wind/normalize_table.c",
478    "third_party/heimdal/lib/wind/combining.c",
479    "third_party/heimdal/lib/wind/combining_table.c",
480    "third_party/heimdal/lib/wind/utf8.c",
481    "third_party/heimdal/lib/wind/bidi.c",
482    "third_party/heimdal/lib/wind/bidi_table.c",
483    "third_party/heimdal/lib/wind/ldap.c",
484    "third_party/heimdal/lib/wind/map.c",
485    "third_party/heimdal/lib/wind/map_table.c",
486    "librpc/gen_ndr/ndr_dns.c",
487    "librpc/ndr/ndr_dns.c",
488    "librpc/ndr/ndr_dns_utils.c",
489    "librpc/gen_ndr/ndr_nbt.c",
490    "librpc/ndr/ndr_nbt.c",
491    "librpc/gen_ndr/ndr_dnsp.c",
492    "librpc/ndr/ndr_dnsp.c",
493    "libcli/nbt/nbtname.c",
494    "third_party/heimdal/lib/hx509/ca.c",
495    "third_party/heimdal/lib/hx509/cert.c",
496    "third_party/heimdal/lib/hx509/cms.c",
497    "third_party/heimdal/lib/hx509/collector.c",
498    "third_party/heimdal/lib/hx509/crypto.c",
499    "third_party/heimdal/lib/hx509/crypto-ec.c",
500    "third_party/heimdal/lib/hx509/error.c",
501    "third_party/heimdal/lib/hx509/env.c",
502    "third_party/heimdal/lib/hx509/file.c",
503    "third_party/heimdal/lib/hx509/keyset.c",
504    "third_party/heimdal/lib/hx509/ks_dir.c",
505    "third_party/heimdal/lib/hx509/ks_file.c",
506    "third_party/heimdal/lib/hx509/ks_keychain.c",
507    "third_party/heimdal/lib/hx509/ks_mem.c",
508    "third_party/heimdal/lib/hx509/ks_null.c",
509    "third_party/heimdal/lib/hx509/ks_p11.c",
510    "third_party/heimdal/lib/hx509/ks_p12.c",
511    "third_party/heimdal/lib/hx509/lock.c",
512    "third_party/heimdal/lib/hx509/name.c",
513    "third_party/heimdal/lib/hx509/peer.c",
514    "third_party/heimdal/lib/hx509/print.c",
515    "third_party/heimdal/lib/hx509/req.c",
516    "third_party/heimdal/lib/hx509/revoke.c",
517    "third_party/heimdal/lib/hx509/sel.c",
518    "third_party/heimdal/lib/hx509/hx509_err.c",
519    "third_party/heimdal/lib/hx509/sel-lex.lex.c",
520    "third_party/heimdal/lib/hx509/sel-gram.tab.c",
521    "lib/util/tevent_unix.c",
522    "lib/util/tevent_ntstatus.c",
523    "lib/util/tevent_werror.c",
524    "lib/util/tevent_req_profile.c",
525    "lib/util/util_tdb.c",
526    "lib/tdb_wrap/tdb_wrap.c",
527    "lib/param/loadparm_server_role.c",
528    "librpc/gen_ndr/ndr_wkssvc.c",
529    "librpc/gen_ndr/ndr_dssetup.c",
530    "librpc/gen_ndr/ndr_netlogon.c",
531    "librpc/ndr/ndr_netlogon.c",
532    "librpc/gen_ndr/ndr_notify.c",
533    "librpc/gen_ndr/ndr_srvsvc.c",
534    "librpc/ndr-standard.empty.c",
535    "librpc/gen_ndr/ndr_samr.c",
536    "librpc/gen_ndr/ndr_ntsvcs.c",
537    "librpc/gen_ndr/ndr_initshutdown.c",
538    "librpc/ndr/ndr_spoolss_buf.c",
539    "librpc/gen_ndr/ndr_echo.c",
540    "librpc/gen_ndr/ndr_eventlog6.c",
541    "librpc/gen_ndr/ndr_winreg.c",
542    "librpc/gen_ndr/ndr_eventlog.c",
543    "librpc/gen_ndr/ndr_atsvc.c",
544    "librpc/gen_ndr/ndr_file_id.c",
545    "librpc/gen_ndr/ndr_dfs.c",
546    "librpc/gen_ndr/ndr_server_id.c",
547    "librpc/gen_ndr/ndr_lsa.c",
548    "librpc/gen_ndr/ndr_svcctl.c",
549    "librpc/ndr/ndr_svcctl.c",
550    "librpc/gen_ndr/ndr_spoolss.c",
551    "third_party/heimdal/lib/krb5/crypto.c",
552    "third_party/heimdal/lib/krb5/acache.c",
553    "third_party/heimdal/lib/krb5/add_et_list.c",
554    "third_party/heimdal/lib/krb5/addr_families.c",
555    "third_party/heimdal/lib/krb5/appdefault.c",
556    "third_party/heimdal/lib/krb5/asn1_glue.c",
557    "third_party/heimdal/lib/krb5/auth_context.c",
558    "third_party/heimdal/lib/krb5/authdata.c",
559    "third_party/heimdal/lib/krb5/build_ap_req.c",
560    "third_party/heimdal/lib/krb5/build_auth.c",
561    "third_party/heimdal/lib/krb5/cache.c",
562    "third_party/heimdal/lib/krb5/changepw.c",
563    "third_party/heimdal/lib/krb5/codec.c",
564    "third_party/heimdal/lib/krb5/config_file.c",
565    "third_party/heimdal/lib/krb5/constants.c",
566    "third_party/heimdal/lib/krb5/convert_creds.c",
567    "third_party/heimdal/lib/krb5/copy_host_realm.c",
568    "third_party/heimdal/lib/krb5/crc.c",
569    "third_party/heimdal/lib/krb5/creds.c",
570    "third_party/heimdal/lib/krb5/crypto-aes-sha1.c",
571    "third_party/heimdal/lib/krb5/crypto-aes-sha2.c",
572    "third_party/heimdal/lib/krb5/crypto-algs.c",
573    "third_party/heimdal/lib/krb5/crypto-arcfour.c",
574    "third_party/heimdal/lib/krb5/crypto-des3.c",
575    "third_party/heimdal/lib/krb5/crypto-des.c",
576    "third_party/heimdal/lib/krb5/crypto-des-common.c",
577    "third_party/heimdal/lib/krb5/crypto-evp.c",
578    "third_party/heimdal/lib/krb5/crypto-null.c",
579    "third_party/heimdal/lib/krb5/crypto-pk.c",
580    "third_party/heimdal/lib/krb5/crypto-rand.c",
581    "third_party/heimdal/lib/krb5/data.c",
582    "third_party/heimdal/lib/krb5/dcache.c",
583    "third_party/heimdal/lib/krb5/db_plugin.c",
584    "third_party/heimdal/lib/krb5/deprecated.c",
585    "third_party/heimdal/lib/krb5/eai_to_heim_errno.c",
586    "third_party/heimdal/lib/krb5/enomem.c",
587    "third_party/heimdal/lib/krb5/error_string.c",
588    "third_party/heimdal/lib/krb5/expand_hostname.c",
589    "third_party/heimdal/lib/krb5/fast.c",
590    "third_party/heimdal/lib/krb5/fcache.c",
591    "third_party/heimdal/lib/krb5/free.c",
592    "third_party/heimdal/lib/krb5/free_host_realm.c",
593    "third_party/heimdal/lib/krb5/generate_seq_number.c",
594    "third_party/heimdal/lib/krb5/generate_subkey.c",
595    "third_party/heimdal/lib/krb5/get_addrs.c",
596    "third_party/heimdal/lib/krb5/get_cred.c",
597    "third_party/heimdal/lib/krb5/get_default_principal.c",
598    "third_party/heimdal/lib/krb5/get_default_realm.c",
599    "third_party/heimdal/lib/krb5/get_for_creds.c",
600    "third_party/heimdal/lib/krb5/get_host_realm.c",
601    "third_party/heimdal/lib/krb5/get_in_tkt.c",
602    "third_party/heimdal/lib/krb5/get_port.c",
603    "third_party/heimdal/lib/krb5/init_creds.c",
604    "third_party/heimdal/lib/krb5/init_creds_pw.c",
605    "third_party/heimdal/lib/krb5/kcm.c",
606    "third_party/heimdal/lib/krb5/keyblock.c",
607    "third_party/heimdal/lib/krb5/keytab.c",
608    "third_party/heimdal/lib/krb5/keytab_any.c",
609    "third_party/heimdal/lib/krb5/keytab_file.c",
610    "third_party/heimdal/lib/krb5/keytab_memory.c",
611    "third_party/heimdal/lib/krb5/keytab_keyfile.c",
612    "third_party/heimdal/lib/krb5/krbhst.c",
613    "third_party/heimdal/lib/krb5/krcache.c",
614    "third_party/heimdal/lib/krb5/log.c",
615    "third_party/heimdal/lib/krb5/mcache.c",
616    "third_party/heimdal/lib/krb5/misc.c",
617    "third_party/heimdal/lib/krb5/mk_error.c",
618    "third_party/heimdal/lib/krb5/mk_priv.c",
619    "third_party/heimdal/lib/krb5/mk_rep.c",
620    "third_party/heimdal/lib/krb5/mk_req.c",
621    "third_party/heimdal/lib/krb5/mk_req_ext.c",
622    "third_party/heimdal/lib/krb5/mit_glue.c",
623    "third_party/heimdal/lib/krb5/net_read.c",
624    "third_party/heimdal/lib/krb5/net_write.c",
625    "third_party/heimdal/lib/krb5/n-fold.c",
626    "third_party/heimdal/lib/krb5/padata.c",
627    "third_party/heimdal/lib/krb5/pkinit.c",
628    "third_party/heimdal/lib/krb5/pkinit-ec.c",
629    "third_party/heimdal/lib/krb5/principal.c",
630    "third_party/heimdal/lib/krb5/prog_setup.c",
631    "third_party/heimdal/lib/krb5/pac.c",
632    "third_party/heimdal/lib/krb5/pcache.c",
633    "third_party/heimdal/lib/krb5/prompter_posix.c",
634    "third_party/heimdal/lib/krb5/rd_cred.c",
635    "third_party/heimdal/lib/krb5/rd_error.c",
636    "third_party/heimdal/lib/krb5/rd_priv.c",
637    "third_party/heimdal/lib/krb5/rd_rep.c",
638    "third_party/heimdal/lib/krb5/rd_req.c",
639    "third_party/heimdal/lib/krb5/replay.c",
640    "third_party/heimdal/lib/krb5/salt.c",
641    "third_party/heimdal/lib/krb5/salt-aes-sha1.c",
642    "third_party/heimdal/lib/krb5/salt-aes-sha2.c",
643    "third_party/heimdal/lib/krb5/salt-arcfour.c",
644    "third_party/heimdal/lib/krb5/salt-des3.c",
645    "third_party/heimdal/lib/krb5/salt-des.c",
646    "third_party/heimdal/lib/krb5/send_to_kdc.c",
647    "third_party/heimdal/lib/krb5/set_default_realm.c",
648    "third_party/heimdal/lib/krb5/store.c",
649    "third_party/heimdal/lib/krb5/store-int.c",
650    "third_party/heimdal/lib/krb5/store_emem.c",
651    "third_party/heimdal/lib/krb5/store_fd.c",
652    "third_party/heimdal/lib/krb5/store_mem.c",
653    "third_party/heimdal/lib/krb5/store_stdio.c",
654    "third_party/heimdal/lib/krb5/ticket.c",
655    "third_party/heimdal/lib/krb5/time.c",
656    "third_party/heimdal/lib/krb5/transited.c",
657    "third_party/heimdal/lib/krb5/version.c",
658    "third_party/heimdal/lib/krb5/warn.c",
659    "third_party/heimdal/lib/krb5/krb5_err.c",
660    "third_party/heimdal/lib/krb5/sp800-108-kdf.c",
661    "third_party/heimdal/lib/krb5/aname_to_localname.c",
662    "third_party/heimdal/lib/krb5/kuserok.c",
663    "third_party/heimdal/lib/krb5/kx509.c",
664    "third_party/heimdal/lib/krb5/mk_cred.c",
665    "third_party/heimdal/lib/krb5/kx509_err.c",
666    "third_party/heimdal/lib/krb5/k524_err.c",
667    "third_party/heimdal/lib/krb5/krb_err.c",
668    "third_party/heimdal/lib/krb5/k5e1_err.c",
669    "third_party/heimdal_build/krb5-glue.c",
670    "third_party/heimdal/lib/ipc/client.c",
671    "third_party/heimdal/lib/ipc/common.c",
672    "third_party/heimdal/lib/krb5/expand_path.c",
673    "third_party/heimdal/lib/krb5/plugin.c",
674    "third_party/heimdal/lib/krb5/context.c",
675    "lib/util/asn1.c",
676    "lib/crypto/gnutls_error.c",
677    "lib/crypto/gnutls_aead_aes_256_cbc_hmac_sha512.c",
678    "lib/crypto/gnutls_arcfour_confounded_md5.c",
679    "lib/crypto/gnutls_weak_crypto.c",
680    "lib/crypto/gnutls_sp800_108.c",
681    "lib/param/loadparm.c",
682    "lib/param/util.c",
683    "lib/param/param_table.c",
684    "lib/dbwrap/dbwrap.c",
685    "lib/dbwrap/dbwrap_util.c",
686    "lib/dbwrap/dbwrap_rbt.c",
687    "lib/dbwrap/dbwrap_tdb.c",
688    "lib/dbwrap/dbwrap_local_open.c",
689    "librpc/ndr/ndr_krb5pac.c",
690    "librpc/gen_ndr/ndr_krb5pac.c",
691    "librpc/ndr/ndr_compression.c",
692    "lib/compression/lzxpress.c",
693    "lib/compression/lzxpress_huffman.c",
694    "librpc/gen_ndr/ndr_claims.c",
695    "librpc/ndr/ndr_claims.c",
696    "third_party/heimdal/lib/gssapi/asn1_gssapi_asn1.c",
697    "third_party/heimdal_build/gssapi.empty.c",
698    "third_party/heimdal/lib/gssapi/asn1_spnego_asn1.c",
699    "third_party/heimdal/lib/gssapi/spnego/init_sec_context.c",
700    "third_party/heimdal/lib/gssapi/spnego/external.c",
701    "third_party/heimdal/lib/gssapi/spnego/compat.c",
702    "third_party/heimdal/lib/gssapi/spnego/context_stubs.c",
703    "third_party/heimdal/lib/gssapi/spnego/context_storage.c",
704    "third_party/heimdal/lib/gssapi/spnego/accept_sec_context.c",
705    "third_party/heimdal/lib/gssapi/spnego/negoex_ctx.c",
706    "third_party/heimdal/lib/gssapi/spnego/negoex_err.c",
707    "third_party/heimdal/lib/gssapi/spnego/negoex_util.c",
708    "third_party/heimdal/lib/gssapi/krb5/copy_ccache.c",
709    "third_party/heimdal/lib/gssapi/krb5/delete_sec_context.c",
710    "third_party/heimdal/lib/gssapi/krb5/duplicate_cred.c",
711    "third_party/heimdal/lib/gssapi/krb5/init_sec_context.c",
712    "third_party/heimdal/lib/gssapi/krb5/context_time.c",
713    "third_party/heimdal/lib/gssapi/krb5/init.c",
714    "third_party/heimdal/lib/gssapi/krb5/address_to_krb5addr.c",
715    "third_party/heimdal/lib/gssapi/krb5/get_mic.c",
716    "third_party/heimdal/lib/gssapi/krb5/inquire_context.c",
717    "third_party/heimdal/lib/gssapi/krb5/add_cred.c",
718    "third_party/heimdal/lib/gssapi/krb5/inquire_cred.c",
719    "third_party/heimdal/lib/gssapi/krb5/inquire_cred_by_oid.c",
720    "third_party/heimdal/lib/gssapi/krb5/inquire_cred_by_mech.c",
721    "third_party/heimdal/lib/gssapi/krb5/inquire_mechs_for_name.c",
722    "third_party/heimdal/lib/gssapi/krb5/inquire_names_for_mech.c",
723    "third_party/heimdal/lib/gssapi/krb5/indicate_mechs.c",
724    "third_party/heimdal/lib/gssapi/krb5/inquire_sec_context_by_oid.c",
725    "third_party/heimdal/lib/gssapi/krb5/name_attrs.c",
726    "third_party/heimdal/lib/gssapi/krb5/export_sec_context.c",
727    "third_party/heimdal/lib/gssapi/krb5/import_sec_context.c",
728    "third_party/heimdal/lib/gssapi/krb5/duplicate_name.c",
729    "third_party/heimdal/lib/gssapi/krb5/import_name.c",
730    "third_party/heimdal/lib/gssapi/krb5/compare_name.c",
731    "third_party/heimdal/lib/gssapi/krb5/export_name.c",
732    "third_party/heimdal/lib/gssapi/krb5/canonicalize_name.c",
733    "third_party/heimdal/lib/gssapi/krb5/unwrap.c",
734    "third_party/heimdal/lib/gssapi/krb5/wrap.c",
735    "third_party/heimdal/lib/gssapi/krb5/release_name.c",
736    "third_party/heimdal/lib/gssapi/krb5/cfx.c",
737    "third_party/heimdal/lib/gssapi/krb5/8003.c",
738    "third_party/heimdal/lib/gssapi/krb5/arcfour.c",
739    "third_party/heimdal/lib/gssapi/krb5/encapsulate.c",
740    "third_party/heimdal/lib/gssapi/krb5/display_name.c",
741    "third_party/heimdal/lib/gssapi/krb5/sequence.c",
742    "third_party/heimdal/lib/gssapi/krb5/display_status.c",
743    "third_party/heimdal/lib/gssapi/krb5/release_buffer.c",
744    "third_party/heimdal/lib/gssapi/krb5/external.c",
745    "third_party/heimdal/lib/gssapi/krb5/compat.c",
746    "third_party/heimdal/lib/gssapi/krb5/creds.c",
747    "third_party/heimdal/lib/gssapi/krb5/ccache_name.c",
748    "third_party/heimdal/lib/gssapi/krb5/acquire_cred.c",
749    "third_party/heimdal/lib/gssapi/krb5/release_cred.c",
750    "third_party/heimdal/lib/gssapi/krb5/store_cred.c",
751    "third_party/heimdal/lib/gssapi/krb5/set_cred_option.c",
752    "third_party/heimdal/lib/gssapi/krb5/decapsulate.c",
753    "third_party/heimdal/lib/gssapi/krb5/verify_mic.c",
754    "third_party/heimdal/lib/gssapi/krb5/accept_sec_context.c",
755    "third_party/heimdal/lib/gssapi/krb5/set_sec_context_option.c",
756    "third_party/heimdal/lib/gssapi/krb5/process_context_token.c",
757    "third_party/heimdal/lib/gssapi/krb5/prf.c",
758    "third_party/heimdal/lib/gssapi/krb5/aeap.c",
759    "third_party/heimdal/lib/gssapi/krb5/pname_to_uid.c",
760    "third_party/heimdal/lib/gssapi/krb5/authorize_localname.c",
761    "third_party/heimdal/lib/gssapi/krb5/gkrb5_err.c",
762    "third_party/heimdal/lib/gssapi/mech/cred.c",
763    "third_party/heimdal/lib/gssapi/mech/context.c",
764    "third_party/heimdal/lib/gssapi/mech/gss_krb5.c",
765    "third_party/heimdal/lib/gssapi/mech/gss_mech_switch.c",
766    "third_party/heimdal/lib/gssapi/mech/gss_process_context_token.c",
767    "third_party/heimdal/lib/gssapi/mech/gss_buffer_set.c",
768    "third_party/heimdal/lib/gssapi/mech/gss_aeap.c",
769    "third_party/heimdal/lib/gssapi/mech/gss_add_cred.c",
770    "third_party/heimdal/lib/gssapi/mech/gss_add_cred_from.c",
771    "third_party/heimdal/lib/gssapi/mech/gss_acquire_cred_from.c",
772    "third_party/heimdal/lib/gssapi/mech/gss_cred.c",
773    "third_party/heimdal/lib/gssapi/mech/gss_store_cred_into.c",
774    "third_party/heimdal/lib/gssapi/mech/gss_add_oid_set_member.c",
775    "third_party/heimdal/lib/gssapi/mech/gss_compare_name.c",
776    "third_party/heimdal/lib/gssapi/mech/gss_release_oid_set.c",
777    "third_party/heimdal/lib/gssapi/mech/gss_create_empty_oid_set.c",
778    "third_party/heimdal/lib/gssapi/mech/gss_duplicate_oid_set.c",
779    "third_party/heimdal/lib/gssapi/mech/gss_decapsulate_token.c",
780    "third_party/heimdal/lib/gssapi/mech/gss_inquire_cred_by_oid.c",
781    "third_party/heimdal/lib/gssapi/mech/gss_canonicalize_name.c",
782    "third_party/heimdal/lib/gssapi/mech/gss_inquire_sec_context_by_oid.c",
783    "third_party/heimdal/lib/gssapi/mech/gss_inquire_names_for_mech.c",
784    "third_party/heimdal/lib/gssapi/mech/gss_inquire_mechs_for_name.c",
785    "third_party/heimdal/lib/gssapi/mech/gss_wrap_size_limit.c",
786    "third_party/heimdal/lib/gssapi/mech/gss_names.c",
787    "third_party/heimdal/lib/gssapi/mech/gss_verify.c",
788    "third_party/heimdal/lib/gssapi/mech/gss_display_name.c",
789    "third_party/heimdal/lib/gssapi/mech/gss_duplicate_oid.c",
790    "third_party/heimdal/lib/gssapi/mech/gss_duplicate_cred.c",
791    "third_party/heimdal/lib/gssapi/mech/gss_display_status.c",
792    "third_party/heimdal/lib/gssapi/mech/gss_release_buffer.c",
793    "third_party/heimdal/lib/gssapi/mech/gss_release_oid.c",
794    "third_party/heimdal/lib/gssapi/mech/gss_test_oid_set_member.c",
795    "third_party/heimdal/lib/gssapi/mech/gss_release_cred.c",
796    "third_party/heimdal/lib/gssapi/mech/gss_set_sec_context_option.c",
797    "third_party/heimdal/lib/gssapi/mech/gss_export_name.c",
798    "third_party/heimdal/lib/gssapi/mech/gss_seal.c",
799    "third_party/heimdal/lib/gssapi/mech/gss_acquire_cred.c",
800    "third_party/heimdal/lib/gssapi/mech/gss_unseal.c",
801    "third_party/heimdal/lib/gssapi/mech/gss_verify_mic.c",
802    "third_party/heimdal/lib/gssapi/mech/gss_accept_sec_context.c",
803    "third_party/heimdal/lib/gssapi/mech/gss_inquire_cred_by_mech.c",
804    "third_party/heimdal/lib/gssapi/mech/gss_indicate_mechs.c",
805    "third_party/heimdal/lib/gssapi/mech/gss_get_neg_mechs.c",
806    "third_party/heimdal/lib/gssapi/mech/gss_delete_sec_context.c",
807    "third_party/heimdal/lib/gssapi/mech/gss_sign.c",
808    "third_party/heimdal/lib/gssapi/mech/gss_utils.c",
809    "third_party/heimdal/lib/gssapi/mech/gss_init_sec_context.c",
810    "third_party/heimdal/lib/gssapi/mech/gss_oid_equal.c",
811    "third_party/heimdal/lib/gssapi/mech/gss_oid.c",
812    "third_party/heimdal/lib/gssapi/mech/gss_oid_to_str.c",
813    "third_party/heimdal/lib/gssapi/mech/gss_mo.c",
814    "third_party/heimdal/lib/gssapi/mech/gss_context_time.c",
815    "third_party/heimdal/lib/gssapi/mech/gss_encapsulate_token.c",
816    "third_party/heimdal/lib/gssapi/mech/gss_get_mic.c",
817    "third_party/heimdal/lib/gssapi/mech/gss_import_sec_context.c",
818    "third_party/heimdal/lib/gssapi/mech/gss_inquire_cred.c",
819    "third_party/heimdal/lib/gssapi/mech/gss_wrap.c",
820    "third_party/heimdal/lib/gssapi/mech/gss_import_name.c",
821    "third_party/heimdal/lib/gssapi/mech/gss_duplicate_name.c",
822    "third_party/heimdal/lib/gssapi/mech/gss_unwrap.c",
823    "third_party/heimdal/lib/gssapi/mech/gss_export_sec_context.c",
824    "third_party/heimdal/lib/gssapi/mech/gss_export_name_composite.c",
825    "third_party/heimdal/lib/gssapi/mech/gss_inquire_context.c",
826    "third_party/heimdal/lib/gssapi/mech/gss_release_name.c",
827    "third_party/heimdal/lib/gssapi/mech/gss_set_cred_option.c",
828    "third_party/heimdal/lib/gssapi/mech/gss_pseudo_random.c",
829    "third_party/heimdal/lib/gssapi/mech/gss_authorize_localname.c",
830    "third_party/heimdal/lib/gssapi/mech/gss_get_name_attribute.c",
831    "third_party/heimdal/lib/gssapi/mech/gssspi_exchange_meta_data.c",
832    "third_party/heimdal/lib/gssapi/mech/gssspi_query_mechanism_info.c",
833    "third_party/heimdal/lib/gssapi/mech/gssspi_query_meta_data.c",
834    "third_party/heimdal_build/gssapi-glue.c",
835    "lib/util/msghdr.c",
836    "lib/socket/interfaces.c",
837    "source4/lib/events/tevent_s4.c",
838    "librpc/gen_ndr/ndr_krb5ccache.c",
839    "librpc/ndr/ndr_negoex.c",
840    "librpc/gen_ndr/ndr_negoex.c",
841    "librpc/gen_ndr/ndr_smb2_lease_struct.c",
842    "librpc/gen_ndr/ndr_named_pipe_auth.c",
843    "librpc/ndr/ndr_drsuapi.c",
844    "librpc/gen_ndr/ndr_drsuapi.c",
845    "librpc/gen_ndr/ndr_epmapper.c",
846    "librpc/gen_ndr/ndr_mgmt.c",
847    "librpc/ndr-samba.empty.c",
848    "librpc/gen_ndr/ndr_mdssvc.c",
849    "librpc/gen_ndr/ndr_gmsa.c",
850    "librpc/gen_ndr/ndr_smb3posix.c",
851    "librpc/gen_ndr/ndr_wsp.c",
852    "librpc/wsp/wsp_helper.c",
853    "librpc/wsp/wsp_props_gen.c",
854    "source3/librpc/gen_ndr/ndr_rpcd_witness.c",
855    "source3/librpc/gen_ndr/ndr_open_files.c",
856    "librpc/ndr/ndr_drsblobs.c",
857    "librpc/gen_ndr/ndr_drsblobs.c",
858    "librpc/gen_ndr/ndr_dnsserver.c",
859    "librpc/ndr/ndr_dnsserver.c",
860    "librpc/gen_ndr/ndr_fsrvp.c",
861    "librpc/ndr/ndr_schannel.c",
862    "librpc/gen_ndr/ndr_schannel.c",
863    "librpc/ndr/ndr_xattr.c",
864    "librpc/gen_ndr/ndr_xattr.c",
865    "librpc/gen_ndr/ndr_ntprinting.c",
866    "librpc/ndr/ndr_ntprinting.c",
867    "librpc/gen_ndr/ndr_idmap.c",
868    "librpc/gen_ndr/ndr_unixinfo.c",
869    "librpc/ndr/ndr_ntlmssp.c",
870    "librpc/gen_ndr/ndr_ntlmssp.c",
871    "librpc/gen_ndr/ndr_auth.c",
872    "librpc/ndr/ndr_auth.c",
873    "librpc/gen_ndr/ndr_witness.c",
874    "librpc/ndr/ndr_witness.c",
875    "source3/librpc/gen_ndr/ndr_smbXsrv.c",
876    "librpc/gen_ndr/ndr_gkdi.c",
877    "lib/ldb/common/ldb.c",
878    "lib/ldb/common/ldb_modules.c",
879    "lib/ldb/common/ldb_ldif.c",
880    "lib/ldb/common/ldb_parse.c",
881    "lib/ldb/common/ldb_msg.c",
882    "lib/ldb/common/ldb_utf8.c",
883    "lib/ldb/common/ldb_debug.c",
884    "lib/ldb/common/ldb_dn.c",
885    "lib/ldb/common/ldb_match.c",
886    "lib/ldb/common/ldb_options.c",
887    "lib/ldb/common/ldb_pack.c",
888    "lib/ldb/common/ldb_attributes.c",
889    "lib/ldb/common/attrib_handlers.c",
890    "lib/ldb/common/ldb_controls.c",
891    "lib/ldb/common/qsort.c",
892    "lib/ldb/ldb_map/ldb_map.c",
893    "lib/ldb/ldb_map/ldb_map_inbound.c",
894    "lib/ldb/ldb_map/ldb_map_outbound.c",
895    "lib/krb5_wrap/krb5_samba.c",
896    "lib/krb5_wrap/gss_samba.c",
897    "lib/krb5_wrap/keytab_util.c",
898    "lib/krb5_wrap/enctype_convert.c",
899    "lib/krb5_wrap/krb5_errs.c",
900    "lib/messaging/messages_dgm.c",
901    "lib/messaging/messages_dgm_ref.c",
902    "lib/pthreadpool/pthreadpool.c",
903    "lib/pthreadpool/pthreadpool_pipe.c",
904    "lib/pthreadpool/pthreadpool_tevent.c",
905    "lib/util/server_id_db.c",
906    "source3/lib/messages_util.c",
907    "source4/cluster/cluster.c",
908    "source4/cluster/local.c",
909    "source4/lib/socket/socket_ip.c",
910    "source4/libcli/resolve/resolve.c",
911    "source4/libcli/composite/composite.c",
912    "lib/samba-sockets.empty.c",
913    "source4/lib/socket/socket_unix.c",
914    "lib/util/access.c",
915    "source4/lib/socket/socket.c",
916    "source4/lib/socket/access.c",
917    "source4/lib/socket/connect_multi.c",
918    "source4/lib/socket/connect.c",
919    "lib/tsocket/tsocket.c",
920    "lib/tsocket/tsocket_helpers.c",
921    "lib/tsocket/tsocket_bsd.c",
922    "source4/lib/messaging/messaging_send.c",
923    "lib/util/unix_privs.c",
924    "libcli/ldap/ldap_message.c",
925    "libcli/ldap/ldap_ndr.c",
926    "libcli/auth/pam_errors.c",
927    "libcli/lsarpc/util_lsarpc.c",
928    "libcli/auth/ntlm_check.c",
929    "lib/util/util_str_escape.c",
930    "libcli/auth/credentials.c",
931    "libcli/auth/session.c",
932    "libcli/auth/smbencrypt.c",
933    "libcli/auth/smbdes.c",
934    "libcli/auth/msrpc_parse.c",
935    "libcli/auth/cliauth.empty.c",
936    "libcli/auth/spnego_parse.c",
937    "libcli/auth/schannel_state_tdb.c",
938    "libds/common/flag_mapping.c",
939    "auth/authn_policy.c",
940    "lib/audit_logging/audit_logging.c",
941    "auth/auth_sam_reply.c",
942    "auth/wbc_auth_util.c",
943    "auth/auth_log.c",
944    "auth/auth_util.c",
945    "lib/crypto/gmsa.c",
946    "lib/util/util_runcmd.c",
947    "source4/dsdb/common/util.c",
948    "source4/dsdb/common/util_trusts.c",
949    "source4/dsdb/common/util_groups.c",
950    "source4/dsdb/common/util_samr.c",
951    "source4/dsdb/common/dsdb_dn.c",
952    "source4/dsdb/common/dsdb_access.c",
953    "source4/dsdb/common/util_links.c",
954    "source4/dsdb/common/rodc_helper.c",
955    "source4/dsdb/gmsa/gkdi.c",
956    "source4/dsdb/gmsa/util.c",
957    "source3/lib/version.c",
958    "lib/crypto/gkdi.c",
959    "lib/util/util_ldb.c",
960    "lib/ldb-samba/ldb_wrap.c",
961    "source4/dsdb/schema/schema_init.c",
962    "source4/dsdb/schema/schema_set.c",
963    "source4/dsdb/schema/schema_query.c",
964    "source4/dsdb/schema/schema_syntax.c",
965    "source4/dsdb/schema/schema_description.c",
966    "source4/dsdb/schema/schema_convert_to_ol.c",
967    "source4/dsdb/schema/schema_inferiors.c",
968    "source4/dsdb/schema/schema_prefixmap.c",
969    "source4/dsdb/schema/schema_info_attr.c",
970    "source4/dsdb/schema/schema_filtered.c",
971    "source4/dsdb/schema/dsdb_dn.c",
972    "lib/ldb-samba/ldif_handlers.c",
973    "lib/ldb-samba/ldb_matching_rules.c",
974    "source4/auth/kerberos/kerberos_pac.c",
975    "source4/lib/tls/tlscert.c",
976    "source4/lib/tls/tls_tstream.c",
977    // SMB-over-QUIC transport, bundled by Samba since 4.23 as a transitive
978    // dependency of `source4/lib/tls/tls_tstream.c` (no external QUIC library
979    // required). Samba's own `third_party/ngtcp2/wscript` and
980    // `third_party/quic/wscript` gate this feature to Linux
981    // (`sys.platform.startswith('linux')`), setting the `ngtcp2` and `quic`
982    // waf targets to `EMPTY` elsewhere, so none of these object files exist
983    // outside Linux builds.
984    #[cfg(target_os = "linux")]
985    "third_party/ngtcp2/crypto/gnutls/gnutls.c",
986    #[cfg(target_os = "linux")]
987    "third_party/ngtcp2/crypto/shared.c",
988    #[cfg(target_os = "linux")]
989    "third_party/ngtcp2/lib/ngtcp2_acktr.c",
990    #[cfg(target_os = "linux")]
991    "third_party/ngtcp2/lib/ngtcp2_addr.c",
992    #[cfg(target_os = "linux")]
993    "third_party/ngtcp2/lib/ngtcp2_balloc.c",
994    #[cfg(target_os = "linux")]
995    "third_party/ngtcp2/lib/ngtcp2_bbr.c",
996    #[cfg(target_os = "linux")]
997    "third_party/ngtcp2/lib/ngtcp2_buf.c",
998    #[cfg(target_os = "linux")]
999    "third_party/ngtcp2/lib/ngtcp2_callbacks.c",
1000    #[cfg(target_os = "linux")]
1001    "third_party/ngtcp2/lib/ngtcp2_cc.c",
1002    #[cfg(target_os = "linux")]
1003    "third_party/ngtcp2/lib/ngtcp2_cid.c",
1004    #[cfg(target_os = "linux")]
1005    "third_party/ngtcp2/lib/ngtcp2_conn.c",
1006    #[cfg(target_os = "linux")]
1007    "third_party/ngtcp2/lib/ngtcp2_conn_info.c",
1008    #[cfg(target_os = "linux")]
1009    "third_party/ngtcp2/lib/ngtcp2_conv.c",
1010    #[cfg(target_os = "linux")]
1011    "third_party/ngtcp2/lib/ngtcp2_crypto.c",
1012    #[cfg(target_os = "linux")]
1013    "third_party/ngtcp2/lib/ngtcp2_dcidtr.c",
1014    #[cfg(target_os = "linux")]
1015    "third_party/ngtcp2/lib/ngtcp2_err.c",
1016    #[cfg(target_os = "linux")]
1017    "third_party/ngtcp2/lib/ngtcp2_frame_chain.c",
1018    #[cfg(target_os = "linux")]
1019    "third_party/ngtcp2/lib/ngtcp2_gaptr.c",
1020    #[cfg(target_os = "linux")]
1021    "third_party/ngtcp2/lib/ngtcp2_idtr.c",
1022    #[cfg(target_os = "linux")]
1023    "third_party/ngtcp2/lib/ngtcp2_ksl.c",
1024    #[cfg(target_os = "linux")]
1025    "third_party/ngtcp2/lib/ngtcp2_log.c",
1026    #[cfg(target_os = "linux")]
1027    "third_party/ngtcp2/lib/ngtcp2_map.c",
1028    #[cfg(target_os = "linux")]
1029    "third_party/ngtcp2/lib/ngtcp2_mem.c",
1030    #[cfg(target_os = "linux")]
1031    "third_party/ngtcp2/lib/ngtcp2_objalloc.c",
1032    #[cfg(target_os = "linux")]
1033    "third_party/ngtcp2/lib/ngtcp2_opl.c",
1034    #[cfg(target_os = "linux")]
1035    "third_party/ngtcp2/lib/ngtcp2_path.c",
1036    #[cfg(target_os = "linux")]
1037    "third_party/ngtcp2/lib/ngtcp2_pcg.c",
1038    #[cfg(target_os = "linux")]
1039    "third_party/ngtcp2/lib/ngtcp2_pkt.c",
1040    #[cfg(target_os = "linux")]
1041    "third_party/ngtcp2/lib/ngtcp2_pmtud.c",
1042    #[cfg(target_os = "linux")]
1043    "third_party/ngtcp2/lib/ngtcp2_ppe.c",
1044    #[cfg(target_os = "linux")]
1045    "third_party/ngtcp2/lib/ngtcp2_pq.c",
1046    #[cfg(target_os = "linux")]
1047    "third_party/ngtcp2/lib/ngtcp2_pv.c",
1048    #[cfg(target_os = "linux")]
1049    "third_party/ngtcp2/lib/ngtcp2_qlog.c",
1050    #[cfg(target_os = "linux")]
1051    "third_party/ngtcp2/lib/ngtcp2_range.c",
1052    #[cfg(target_os = "linux")]
1053    "third_party/ngtcp2/lib/ngtcp2_ratelim.c",
1054    #[cfg(target_os = "linux")]
1055    "third_party/ngtcp2/lib/ngtcp2_ringbuf.c",
1056    #[cfg(target_os = "linux")]
1057    "third_party/ngtcp2/lib/ngtcp2_rob.c",
1058    #[cfg(target_os = "linux")]
1059    "third_party/ngtcp2/lib/ngtcp2_rst.c",
1060    #[cfg(target_os = "linux")]
1061    "third_party/ngtcp2/lib/ngtcp2_rtb.c",
1062    #[cfg(target_os = "linux")]
1063    "third_party/ngtcp2/lib/ngtcp2_settings.c",
1064    #[cfg(target_os = "linux")]
1065    "third_party/ngtcp2/lib/ngtcp2_str.c",
1066    #[cfg(target_os = "linux")]
1067    "third_party/ngtcp2/lib/ngtcp2_strm.c",
1068    #[cfg(target_os = "linux")]
1069    "third_party/ngtcp2/lib/ngtcp2_transport_params.c",
1070    #[cfg(target_os = "linux")]
1071    "third_party/ngtcp2/lib/ngtcp2_unreachable.c",
1072    #[cfg(target_os = "linux")]
1073    "third_party/ngtcp2/lib/ngtcp2_vec.c",
1074    #[cfg(target_os = "linux")]
1075    "third_party/ngtcp2/lib/ngtcp2_version.c",
1076    #[cfg(target_os = "linux")]
1077    "third_party/ngtcp2/lib/ngtcp2_window_filter.c",
1078    #[cfg(target_os = "linux")]
1079    "third_party/ngtcp2/libngtcp2.empty.c",
1080    #[cfg(target_os = "linux")]
1081    "third_party/ngtcp2/libngtcp2_crypto_gnutls.empty.c",
1082    #[cfg(target_os = "linux")]
1083    "third_party/quic/libquic_handshake_wrapper.c",
1084    "source4/auth/kerberos/krb5_init_context.c",
1085    "source4/lib/stream/packet.c",
1086    "auth/kerberos/gssapi_pac.c",
1087    "auth/kerberos/kerberos_pac.c",
1088    "auth/kerberos/gssapi_helper.c",
1089    "auth/credentials/credentials_secrets.c",
1090    "auth/credentials/credentials.c",
1091    "auth/credentials/credentials_krb5.c",
1092    "source4/auth/kerberos/srv_keytab.c",
1093    "source4/param/secrets.c",
1094    "auth/credentials/credentials_ntlm.c",
1095    "source4/auth/kerberos/kerberos_util.c",
1096    "auth/credentials/credentials_gmsa.c",
1097    "nsswitch/libwbclient/wbc_guid.c",
1098    "nsswitch/libwbclient/wbc_idmap.c",
1099    "nsswitch/libwbclient/wbclient.c",
1100    "nsswitch/libwbclient/wbc_pam.c",
1101    "nsswitch/libwbclient/wbc_pwd.c",
1102    "nsswitch/libwbclient/wbc_sid.c",
1103    "nsswitch/libwbclient/wbc_util.c",
1104    "nsswitch/wb_common.c",
1105    "libcli/drsuapi/repl_decrypt.c",
1106    "source4/auth/session.c",
1107    "source4/dsdb/samdb/samdb.c",
1108    "source4/dsdb/samdb/samdb_privilege.c",
1109    "source4/dsdb/samdb/cracknames.c",
1110    "source4/dsdb/repl/replicated_objects.c",
1111    "source4/auth/sam.c",
1112    "source4/auth/system_session.c",
1113    "lib/util/modules.c",
1114    "libcli/http/gensec/generic.c",
1115    "auth/ntlmssp/gensec_ntlmssp.c",
1116    "auth/ntlmssp/ntlmssp.c",
1117    "auth/ntlmssp/ntlmssp_util.c",
1118    "auth/ntlmssp/ntlmssp_ndr.c",
1119    "auth/ntlmssp/ntlmssp_client.c",
1120    "auth/ntlmssp/ntlmssp_server.c",
1121    "auth/ntlmssp/ntlmssp_sign.c",
1122    "auth/ntlmssp/gensec_ntlmssp_server.c",
1123    "auth/gensec/external.c",
1124    "auth/gensec/schannel.c",
1125    "source4/auth/gensec/gensec_tstream.c",
1126    "auth/gensec/ncalrpc.c",
1127    "auth/gensec/gensec.c",
1128    "auth/gensec/gensec_start.c",
1129    "auth/gensec/gensec_util.c",
1130    "source4/auth/gensec/gensec_gssapi.c",
1131    "auth/ntlmssp/gensec_ntlmssp.empty.c",
1132    "auth/gensec/spnego.c",
1133    "libcli/http/gensec/basic.c",
1134    "source3/lib/util_sec.c",
1135    "source3/lib/util_str.c",
1136    "source3/lib/adt_tree.c",
1137    "source3/lib/util_malloc.c",
1138    "source3/lib/file_id.c",
1139    "source3/lib/cbuf.c",
1140    "source3/lib/per_thread_cwd.c",
1141    "libcli/dns/dns.c",
1142    "libcli/dns/resolvconf.c",
1143    "lib/util/talloc_report_printf.c",
1144    "libcli/registry/util_reg.c",
1145    "source3/lib/cluster_support.c",
1146    "source3/lib/ctdb_dummy.c",
1147    "source3/lib/smbd_shim.c",
1148    "source3/lib/charcnv.c",
1149    "source3/lib/fstring.c",
1150    "source4/lib/socket/interface.c",
1151    "libcli/nbt/nbtsocket.c",
1152    "libcli/nbt/namequery.c",
1153    "libcli/nbt/nameregister.c",
1154    "libcli/nbt/namerefresh.c",
1155    "libcli/nbt/namerelease.c",
1156    "libcli/nbt/lmhosts.c",
1157    "lib/addns/dnsquery.c",
1158    "lib/addns/dnsrecord.c",
1159    "lib/addns/dnsutils.c",
1160    "lib/addns/dnssock.c",
1161    "lib/addns/dnsgss.c",
1162    "lib/addns/dnsmarshall.c",
1163    "lib/addns/error.c",
1164    "lib/addns/dnsquery_srv.c",
1165    "libcli/dns/dns_lookup.c",
1166    "source3/param/util.c",
1167    "source3/registry/reg_backend_smbconf.c",
1168    "source3/registry/reg_init_smbconf.c",
1169    "source3/registry/reg_util_token.c",
1170    "source3/registry/reg_api_util.c",
1171    "librpc/gen_ndr/ndr_messaging.c",
1172    "source3/registry/reg_api.c",
1173    "source3/registry/reg_dispatcher.c",
1174    "source3/registry/reg_cachehook.c",
1175    "source3/registry/reg_objects.c",
1176    "source3/registry/reg_util_internal.c",
1177    "source3/lib/util_nttoken.c",
1178    "source3/registry/reg_backend_db.c",
1179    "source3/registry/reg_parse_internal.c",
1180    "source3/registry/reg_parse.c",
1181    "source3/lib/srprs.c",
1182    "source3/registry/reg_init_basic.c",
1183    "source3/lib/dbwrap/dbwrap_open.c",
1184    "source3/lib/dbwrap/dbwrap_watch.c",
1185    "source3/lib/g_lock.c",
1186    "lib/smbconf/smbconf.c",
1187    "lib/smbconf/smbconf_txt.c",
1188    "lib/smbconf/smbconf_util.c",
1189    "source3/lib/util_tdb.c",
1190    "source3/lib/smbconf/smbconf_init.c",
1191    "source3/lib/smbconf/smbconf_reg.c",
1192    "source3/lib/util_tsock.c",
1193    "source3/param/loadparm.c",
1194    "source3/lib/sharesec.c",
1195    "source3/lib/ldap_debug_handler.c",
1196    "source3/lib/util_names.c",
1197    "source3/param/loadparm_ctx.c",
1198    "source3/libsmb/errormap.c",
1199    "source3/libsmb/smberr.c",
1200    "source3/lib/errmap_unix.c",
1201    "lib/util/util_pw.c",
1202    "lib/async_req/async_sock.c",
1203    "source3/lib/system.c",
1204    "source3/lib/sendfile.c",
1205    "source3/lib/recvfile.c",
1206    "source3/lib/time.c",
1207    "source3/lib/util_sid.c",
1208    "source3/lib/util_specialsids.c",
1209    "source3/lib/util_file.c",
1210    "source3/lib/util.c",
1211    "source3/lib/util_path.c",
1212    "source3/lib/util_matching.c",
1213    "source3/lib/util_procid.c",
1214    "source3/lib/util_sock.c",
1215    "source3/lib/util_transfer_file.c",
1216    "source3/lib/util_macstreams.c",
1217    "source3/lib/messages.c",
1218    "source3/lib/util_cluster.c",
1219    "source3/lib/id_cache.c",
1220    "source3/lib/serverid.c",
1221    "source3/lib/server_id_watch.c",
1222    "source3/lib/server_id_db_util.c",
1223    "source3/lib/addrchange.c",
1224    "lib/util/debug_s3.c",
1225    "source3/lib/dumpcore.c",
1226    "source3/lib/interface.c",
1227    "source3/lib/username.c",
1228    "source3/lib/smbrun.c",
1229    "source3/lib/wins_srv.c",
1230    "source3/lib/substitute.c",
1231    "source3/lib/substitute_generic.c",
1232    "source3/lib/ms_fnmatch.c",
1233    "source3/lib/tallocmsg.c",
1234    "source3/lib/dmallocmsg.c",
1235    "source3/lib/gencache.c",
1236    "source3/lib/util_event.c",
1237    "source3/lib/global_contexts.c",
1238    "source3/lib/ldap_escape.c",
1239    "source3/lib/system_smbd.c",
1240    "source3/lib/audit.c",
1241    "source3/lib/idmap_cache.c",
1242    "source3/lib/namemap_cache.c",
1243    "source3/lib/util_ea.c",
1244    "source3/lib/background.c",
1245    "source4/libcli/resolve/bcast.c",
1246    "source4/libcli/resolve/nbtlist.c",
1247    "source4/libcli/resolve/wins.c",
1248    "source4/libcli/resolve/dns_ex.c",
1249    "source4/libcli/resolve/host.c",
1250    "source4/libcli/resolve/lmhosts.c",
1251    "source4/libcli/resolve/resolve_lp.c",
1252    "libcli/util/tstream.c",
1253    "source4/libcli/ldap/ldap_client.c",
1254    "source4/libcli/ldap/ldap_bind.c",
1255    "source4/libcli/ldap/ldap_ildap.c",
1256    "source4/libcli/ldap/ldap_controls.c",
1257    "librpc/gen_ndr/ndr_cab.c",
1258    "librpc/ndr/ndr_cab.c",
1259    "librpc/gen_ndr/ndr_browser.c",
1260    "librpc/gen_ndr/ndr_w32time.c",
1261    "source4/librpc/gen_ndr/ndr_sasl_helpers.c",
1262    "librpc/gen_ndr/ndr_rot.c",
1263    "librpc/gen_ndr/ndr_nfs4acl.c",
1264    "source4/librpc/ndr-samba4.empty.c",
1265    "librpc/gen_ndr/ndr_winstation.c",
1266    "librpc/ndr/ndr_table.c",
1267    "source4/librpc/gen_ndr/tables.c",
1268    "librpc/gen_ndr/ndr_printcap.c",
1269    "librpc/gen_ndr/ndr_wzcsvc.c",
1270    "source4/librpc/gen_ndr/ndr_irpc.c",
1271    "librpc/gen_ndr/ndr_clusapi.c",
1272    "source4/librpc/gen_ndr/ndr_winsif.c",
1273    "librpc/gen_ndr/ndr_audiosrv.c",
1274    "librpc/gen_ndr/ndr_winspool.c",
1275    "librpc/ndr/ndr_orpc.c",
1276    "librpc/gen_ndr/ndr_orpc.c",
1277    "librpc/gen_ndr/ndr_fsrvp_state.c",
1278    "librpc/gen_ndr/ndr_winbind.c",
1279    "librpc/gen_ndr/ndr_rap.c",
1280    "librpc/ndr/ndr_rap.c",
1281    "source4/librpc/gen_ndr/ndr_opendb.c",
1282    "librpc/NDR_NBT.empty.c",
1283    "source4/librpc/gen_ndr/ndr_winsrepl.c",
1284    "librpc/gen_ndr/ndr_dsbackup.c",
1285    "librpc/gen_ndr/ndr_frstrans.c",
1286    "librpc/gen_ndr/ndr_efs.c",
1287    "librpc/gen_ndr/ndr_dfsblobs.c",
1288    "librpc/gen_ndr/ndr_quota.c",
1289    "librpc/gen_ndr/ndr_keysvc.c",
1290    "source3/librpc/gen_ndr/ndr_leases_db.c",
1291    "librpc/gen_ndr/ndr_preg.c",
1292    "librpc/ndr/ndr_preg.c",
1293    "librpc/ndr/ndr_bkupblobs.c",
1294    "librpc/gen_ndr/ndr_bkupblobs.c",
1295    "librpc/gen_ndr/ndr_frsapi.c",
1296    "librpc/gen_ndr/ndr_msgsvc.c",
1297    "librpc/gen_ndr/ndr_policyagent.c",
1298    "source3/librpc/gen_ndr/ndr_ads.c",
1299    "source3/librpc/ndr/ndr_ads.c",
1300    "librpc/gen_ndr/ndr_dcerpc.c",
1301    "librpc/ndr/ndr_dcerpc.c",
1302    "librpc/ndr/ndr_frsrpc.c",
1303    "librpc/gen_ndr/ndr_frsrpc.c",
1304    "source3/librpc/gen_ndr/ndr_perfcount.c",
1305    "librpc/gen_ndr/ndr_trkwks.c",
1306    "librpc/gen_ndr/ndr_dbgidl.c",
1307    "librpc/gen_ndr/ndr_scerpc.c",
1308    "source4/librpc/gen_ndr/ndr_ntp_signd.c",
1309    "librpc/gen_ndr/ndr_ioctl.c",
1310    "librpc/ndr/ndr_ioctl.c",
1311    "librpc/gen_ndr/ndr_smb_acl.c",
1312    "librpc/gen_ndr/ndr_ODJ.c",
1313    "librpc/ndr/ndr_ODJ.c",
1314    "source3/librpc/gen_ndr/ndr_secrets.c",
1315    "librpc/ndr/ndr_backupkey.c",
1316    "librpc/gen_ndr/ndr_backupkey.c",
1317    "librpc/gen_ndr/ndr_fscc.c",
1318    "libcli/smb/read_smb.c",
1319    "libcli/netlogon/netlogon.c",
1320    "libcli/cldap/cldap.c",
1321    "source3/passdb/secrets.c",
1322    "source3/passdb/machine_account_secrets.c",
1323    "source3/passdb/machine_sid.c",
1324    "source3/passdb/secrets_lsa.c",
1325    "librpc/rpc/dcerpc_error.c",
1326    "librpc/rpc/binding.c",
1327    "librpc/rpc/dcerpc_util.c",
1328    "librpc/rpc/binding_handle.c",
1329    "libcli/smb/smb_signing.c",
1330    "libcli/smb/smb_seal.c",
1331    "libcli/smb/smb2_negotiate_context.c",
1332    "libcli/smb/smb2_create_blob.c",
1333    "libcli/smb/smb2_signing.c",
1334    "libcli/smb/smb2_lease.c",
1335    "libcli/smb/util.c",
1336    "libcli/smb/smbXcli_base.c",
1337    "libcli/smb/smb1cli_trans.c",
1338    "libcli/smb/smb1cli_echo.c",
1339    "libcli/smb/smb1cli_create.c",
1340    "libcli/smb/smb1cli_session.c",
1341    "libcli/smb/smb1cli_close.c",
1342    "libcli/smb/smb1cli_write.c",
1343    "libcli/smb/smb1cli_read.c",
1344    "libcli/smb/smb2cli_session.c",
1345    "libcli/smb/smb2cli_tcon.c",
1346    "libcli/smb/smb2cli_create.c",
1347    "libcli/smb/smb2cli_close.c",
1348    "libcli/smb/smb2cli_read.c",
1349    "libcli/smb/smb2cli_write.c",
1350    "libcli/smb/smb2cli_flush.c",
1351    "libcli/smb/smb2cli_set_info.c",
1352    "libcli/smb/smb2cli_query_info.c",
1353    "libcli/smb/smb2cli_notify.c",
1354    "libcli/smb/smb2cli_query_directory.c",
1355    "libcli/smb/smb2cli_ioctl.c",
1356    "libcli/smb/smb2cli_echo.c",
1357    "libcli/smb/smb2_posix.c",
1358    "libcli/smb/tstream_smbXcli_np.c",
1359    "libcli/smb/reparse.c",
1360    "source3/lib/tldap.c",
1361    "source3/lib/tldap_util.c",
1362    "source3/lib/tldap_gensec_bind.c",
1363    "source3/lib/tldap_tls_connect.c",
1364    "third_party/heimdal_build/k5crypto.empty.c",
1365    "source3/libads/cldap.c",
1366    "source3/libads/netlogon_ping.c",
1367    "source3/librpc/crypto/gse_krb5.c",
1368    "source3/librpc/crypto/gse.c",
1369    "source3/libads/kerberos.c",
1370    "source3/libads/ads_status.c",
1371    "source3/libsmb/unexpected.c",
1372    "source3/libsmb/namecache.c",
1373    "source3/libsmb/nmblib.c",
1374    "source3/libsmb/clidgram.c",
1375    "source3/libsmb/namequery.c",
1376    "source3/libsmb/conncache.c",
1377    "source3/libads/sitename_cache.c",
1378    "librpc/gen_ndr/ndr_initshutdown_c.c",
1379    "librpc/gen_ndr/ndr_eventlog_c.c",
1380    "librpc/gen_ndr/ndr_wkssvc_c.c",
1381    "librpc/dcerpc-samba.empty.c",
1382    "librpc/gen_ndr/ndr_spoolss_c.c",
1383    "librpc/gen_ndr/ndr_epmapper_c.c",
1384    "librpc/gen_ndr/ndr_dfs_c.c",
1385    "librpc/gen_ndr/ndr_winreg_c.c",
1386    "librpc/gen_ndr/ndr_lsa_c.c",
1387    "librpc/gen_ndr/ndr_srvsvc_c.c",
1388    "librpc/gen_ndr/ndr_netlogon_c.c",
1389    "librpc/gen_ndr/ndr_svcctl_c.c",
1390    "librpc/gen_ndr/ndr_echo_c.c",
1391    "librpc/gen_ndr/ndr_atsvc_c.c",
1392    "librpc/gen_ndr/ndr_ntsvcs_c.c",
1393    "librpc/gen_ndr/ndr_gkdi_c.c",
1394    "librpc/gen_ndr/ndr_samr_c.c",
1395    "librpc/gen_ndr/ndr_dnsserver_c.c",
1396    "libcli/named_pipe_auth/npa_tstream.c",
1397    "libcli/named_pipe_auth/tstream_u32_read.c",
1398    "source3/libsmb/auth_generic.c",
1399    "source3/libsmb/clientgen.c",
1400    "source3/libsmb/cliconnect.c",
1401    "source3/libsmb/clifile.c",
1402    "source3/libsmb/clirap.c",
1403    "source3/libsmb/clierror.c",
1404    "source3/libsmb/climessage.c",
1405    "source3/libsmb/clireadwrite.c",
1406    "source3/libsmb/clilist.c",
1407    "source3/libsmb/cliprint.c",
1408    "source3/libsmb/clitrans.c",
1409    "source3/libsmb/clisecdesc.c",
1410    "source3/libsmb/cliquota.c",
1411    "source3/libsmb/clifsinfo.c",
1412    "source3/libsmb/clidfs.c",
1413    "source3/libsmb/clioplock.c",
1414    "source3/libsmb/async_smb.c",
1415    "source3/libsmb/clisymlink.c",
1416    "source3/libsmb/smbsock_connect.c",
1417    "source3/libsmb/cli_smb2_fnum.c",
1418    "source3/rpc_client/cli_pipe.c",
1419    "source3/rpc_client/rpc_transport_np.c",
1420    "source3/rpc_client/rpc_transport_sock.c",
1421    "source3/rpc_client/rpc_transport_tstream.c",
1422    "source3/rpc_client/local_np.c",
1423    "source3/librpc/rpc/dcerpc_helpers.c",
1424    "libcli/auth/netlogon_creds_cli.c",
1425    "source3/rpc_client/cli_lsarpc.c",
1426    "source3/rpc_client/init_lsa.c",
1427    "source3/libsmb/libsmb_cache.c",
1428    "source3/libsmb/libsmb_compat.c",
1429    "source3/libsmb/libsmb_context.c",
1430    "source3/libsmb/libsmb_dir.c",
1431    "source3/libsmb/libsmb_file.c",
1432    "source3/libsmb/libsmb_misc.c",
1433    "source3/libsmb/libsmb_path.c",
1434    "source3/libsmb/libsmb_printjob.c",
1435    "source3/libsmb/libsmb_server.c",
1436    "source3/libsmb/libsmb_stat.c",
1437    "source3/libsmb/libsmb_xattr.c",
1438    "source3/libsmb/libsmb_setget.c",
1439];
1440
1441const TDB_SRC: &[&str] = &[
1442    "lib/tdb/common/check.c",
1443    "lib/tdb/common/error.c",
1444    "lib/tdb/common/tdb.c",
1445    "lib/tdb/common/traverse.c",
1446    "lib/tdb/common/freelistcheck.c",
1447    "lib/tdb/common/lock.c",
1448    "lib/tdb/common/dump.c",
1449    "lib/tdb/common/freelist.c",
1450    "lib/tdb/common/io.c",
1451    "lib/tdb/common/open.c",
1452    "lib/tdb/common/transaction.c",
1453    "lib/tdb/common/hash.c",
1454    "lib/tdb/common/summary.c",
1455    "lib/tdb/common/rescue.c",
1456    "lib/tdb/common/mutex.c",
1457];
1458
1459const TALLOC_SRC: &[&str] = &["lib/talloc/talloc.c"];
1460
1461const TEVENT_SRC: &[&str] = &[
1462    "lib/tevent/tevent.c",
1463    "lib/tevent/tevent_debug.c",
1464    "lib/tevent/tevent_fd.c",
1465    "lib/tevent/tevent_immediate.c",
1466    "lib/tevent/tevent_queue.c",
1467    "lib/tevent/tevent_req.c",
1468    "lib/tevent/tevent_wrapper.c",
1469    "lib/tevent/tevent_poll.c",
1470    "lib/tevent/tevent_threads.c",
1471    "lib/tevent/tevent_signal.c",
1472    "lib/tevent/tevent_standard.c",
1473    "lib/tevent/tevent_timed.c",
1474    "lib/tevent/tevent_util.c",
1475    "lib/tevent/tevent_wakeup.c",
1476    #[cfg(target_os = "linux")]
1477    "lib/tevent/tevent_epoll.c",
1478];
1479
1480/// Artifacts produced by the build process.
1481pub struct Artifacts {
1482    /// Directory containing the generated static libraries.
1483    pub lib_dir: PathBuf,
1484    /// Directory containing Samba's generated public headers.
1485    pub include_dir: PathBuf,
1486}
1487
1488/// Returns the bundled Samba version.
1489///
1490/// The build revision suffix from this crate's package version is omitted.
1491pub fn version() -> &'static str {
1492    // get pkg version and remove any `-`
1493    env!("CARGO_PKG_VERSION")
1494        .split('-')
1495        .next()
1496        .expect("Invalid version format")
1497}
1498
1499/// Configuration for compiling the bundled Samba source.
1500///
1501/// Defaults are read from Cargo's `OUT_DIR`, `TARGET`, and `HOST` environment variables.
1502pub struct Build {
1503    out_dir: Option<PathBuf>,
1504    target: Option<String>,
1505    host: Option<String>,
1506    samba_dir: Option<PathBuf>,
1507    gnutls: Option<Vec<PathBuf>>,
1508}
1509
1510impl Default for Build {
1511    fn default() -> Self {
1512        Self::new()
1513    }
1514}
1515
1516impl Build {
1517    /// Creates a build configuration from the current Cargo environment.
1518    pub fn new() -> Build {
1519        Build {
1520            out_dir: env::var_os("OUT_DIR").map(|s| PathBuf::from(s).join("samba-build")),
1521            target: env::var("TARGET").ok(),
1522            host: env::var("HOST").ok(),
1523            samba_dir: Some(PathBuf::from("/usr/local/samba")),
1524            gnutls: None,
1525        }
1526    }
1527
1528    /// Sets the directory used for cloned sources and build outputs.
1529    pub fn out_dir<P: AsRef<Path>>(&mut self, path: P) -> &mut Build {
1530        self.out_dir = Some(path.as_ref().to_path_buf());
1531        self
1532    }
1533
1534    /// Sets the target triple passed to the native toolchain.
1535    pub fn target(&mut self, target: &str) -> &mut Build {
1536        self.target = Some(target.to_string());
1537        self
1538    }
1539
1540    /// Sets the host triple used to select the native make command.
1541    pub fn host(&mut self, host: &str) -> &mut Build {
1542        self.host = Some(host.to_string());
1543        self
1544    }
1545
1546    /// Stores the intended Samba installation prefix.
1547    ///
1548    /// The current static-library build does not pass this value to Samba's configure script.
1549    pub fn samba_dir<P: AsRef<Path>>(&mut self, path: P) -> &mut Build {
1550        self.samba_dir = Some(path.as_ref().to_path_buf());
1551        self
1552    }
1553
1554    /// Sets additional GnuTLS include directories used on macOS.
1555    pub fn gnutls(&mut self, paths: Vec<PathBuf>) -> &mut Build {
1556        self.gnutls = Some(paths);
1557        self
1558    }
1559
1560    fn cmd_make(&self) -> Result<Command, &'static str> {
1561        let host = &self.host.as_ref().ok_or("HOST dir not set")?[..];
1562        Ok(
1563            if host.contains("dragonfly")
1564                || host.contains("freebsd")
1565                || host.contains("openbsd")
1566                || host.contains("solaris")
1567                || host.contains("illumos")
1568            {
1569                Command::new("gmake")
1570            } else {
1571                Command::new("make")
1572            },
1573        )
1574    }
1575
1576    /// Builds Samba and returns the generated artifacts.
1577    ///
1578    /// Build failures are emitted as Cargo warnings and written to standard error.
1579    ///
1580    /// # Process termination
1581    ///
1582    /// Exits the process with status code 1 if the native build fails.
1583    pub fn build(&mut self) -> Artifacts {
1584        match self.try_build() {
1585            Ok(a) => a,
1586            Err(e) => {
1587                println!("cargo:warning=pavao-src: failed to build samba from source");
1588                eprintln!("\n\n\n{e}\n\n\n");
1589                std::process::exit(1);
1590            }
1591        }
1592    }
1593
1594    /// Attempts to build Samba and returns the generated artifacts.
1595    ///
1596    /// This clones the matching Samba tag, runs its configuration and make steps, and assembles a
1597    /// static `libsmbclient` archive.
1598    ///
1599    /// # Errors
1600    ///
1601    /// Returns an error when required configuration is absent, the target is unsupported, source
1602    /// retrieval fails, filesystem operations fail, or a native build command fails.
1603    pub fn try_build(&mut self) -> Result<Artifacts, String> {
1604        let target = &self.target.as_ref().ok_or("TARGET dir not set")?[..];
1605        let host = &self.host.as_ref().ok_or("HOST dir not set")?[..];
1606        let os = Self::os(target)?;
1607        let out_dir = self.out_dir.as_ref().ok_or("OUT_DIR not set")?;
1608        let build_dir = out_dir.join("build");
1609
1610        if build_dir.exists() {
1611            fs::remove_dir_all(&build_dir).map_err(|e| format!("build_dir: {e}"))?;
1612        }
1613
1614        let inner_dir = build_dir.join("src");
1615        fs::create_dir_all(&inner_dir)
1616            .map_err(|e| format!("{path}: {e}", path = inner_dir.display()))?;
1617
1618        // get src at `inner_dir`
1619        clone_samba(&inner_dir)?;
1620
1621        // init cc
1622        let mut cc = cc::Build::new();
1623        cc.target(target).host(host).warnings(false).opt_level(2);
1624        let compiler = cc.get_compiler();
1625        let mut cc_env = compiler.cc_env();
1626        if cc_env.is_empty() {
1627            cc_env = compiler.path().to_path_buf().into_os_string();
1628        }
1629
1630        // get ar
1631        let ar = cc.get_archiver();
1632
1633        // configure
1634        //
1635        // These flags trim Samba's configure/build down to what the static
1636        // `libsmbclient` archive in `SRC_FILES` actually needs, so the vendored
1637        // build does not probe for (and therefore does not require) libraries
1638        // used only by smbd/winbindd/the AD DC or by disabled optional features
1639        // (CUPS, PAM, LDAP, Avahi, Spotlight/WSP, clustering, JSON, and so on).
1640        let mut configure = Command::new("sh");
1641        configure.arg("./configure");
1642        configure.arg("--disable-python");
1643        configure.arg("--without-systemd");
1644        configure.arg("--without-ldb-lmdb");
1645        configure.arg("--without-ad-dc");
1646        configure.arg("--bundled-libraries=ALL");
1647        configure.arg("--without-libarchive");
1648        configure.arg("--without-acl-support");
1649        configure.arg("--without-ads");
1650        configure.arg("--without-winbind");
1651        configure.arg("--disable-cups");
1652        configure.arg("--disable-iprint");
1653        configure.arg("--without-pam");
1654        configure.arg("--without-quotas");
1655        configure.arg("--without-utmp");
1656        configure.arg("--disable-avahi");
1657        configure.arg("--without-automount");
1658        configure.arg("--without-dmapi");
1659        configure.arg("--without-fam");
1660        configure.arg("--without-prometheus-exporter");
1661        configure.arg("--without-cluster-support");
1662        configure.arg("--without-regedit");
1663        configure.arg("--without-winexe");
1664        configure.arg("--without-fake-kaserver");
1665        configure.arg("--disable-glusterfs");
1666        configure.arg("--disable-cephfs");
1667        configure.arg("--disable-spotlight");
1668        configure.arg("--disable-wsp");
1669        configure.arg("--without-libunwind");
1670        configure.arg("--without-lttng");
1671        configure.arg("--without-kernel-keyring");
1672        configure.arg("--without-ldap");
1673        configure.arg("--without-json");
1674        configure.arg("--without-smb1-server");
1675        configure.arg("--without-systemd-userdb");
1676        // vfs_snapper is a shared module pulled in by default and requires
1677        // D-Bus; it is not part of `SRC_FILES` and is never linked in.
1678        configure.arg("--with-shared-modules=!vfs_snapper");
1679        configure.env("CC", cc_env);
1680        configure.env("AR", ar.get_program());
1681        // On MacOS we need to explicitly declare include paths for gnutls
1682        #[cfg(target_os = "macos")]
1683        {
1684            let gnutls_paths = self.gnutls.as_ref().ok_or("gnutls paths not set")?;
1685            add_env_includes(&mut configure, gnutls_paths)?;
1686        }
1687
1688        let ranlib = cc.get_ranlib();
1689        let mut args = vec![ranlib.get_program()];
1690        args.extend(ranlib.get_args());
1691        configure.env("RANLIB", args.join(OsStr::new(" ")));
1692
1693        let mut skip_next = false;
1694        let mut is_isysroot = false;
1695        let mut ios_isysroot = None;
1696        for arg in compiler.args() {
1697            // For whatever reason `-static` on MUSL seems to cause
1698            // issues...
1699            if target.contains("musl") && arg == "-static" {
1700                continue;
1701            }
1702
1703            // cc includes an `-arch` flag for Apple platforms, but we've
1704            // already selected an arch implicitly via the target above, and
1705            // OpenSSL contains about the conflict if both are specified.
1706            if target.contains("apple") && arg == "-arch" {
1707                skip_next = true;
1708                continue;
1709            }
1710
1711            // cargo-lipo specifies this but OpenSSL complains
1712            if target.contains("apple-ios") {
1713                if arg == "-isysroot" {
1714                    is_isysroot = true;
1715                    continue;
1716                }
1717
1718                if is_isysroot {
1719                    is_isysroot = false;
1720                    ios_isysroot = Some(arg.to_str().ok_or("isysroot arg")?.to_string());
1721                    continue;
1722                }
1723            }
1724
1725            if skip_next {
1726                skip_next = false;
1727                continue;
1728            }
1729        }
1730
1731        if os.contains("iossimulator")
1732            && let Some(ref isysr) = ios_isysroot
1733        {
1734            configure.env(
1735                "CC",
1736                format!(
1737                    "xcrun -sdk iphonesimulator cc -isysroot {isysroot}",
1738                    isysroot = Path::new(isysr).display()
1739                ),
1740            );
1741        }
1742
1743        configure.current_dir(&inner_dir);
1744        // run configure
1745        self.run_command(configure, "configuring samba build")?;
1746
1747        // make tdb
1748        self.build_target("tdb", &inner_dir, &ios_isysroot)?;
1749        // make smbclient
1750        self.build_target("smbclient", &inner_dir, &ios_isysroot)?;
1751
1752        // build static library -> bin/default/source3/libsmb
1753        let lib_dir = inner_dir.join("bin").join("default");
1754
1755        let mut build_static = cc.get_archiver();
1756        build_static.arg("rcs");
1757        build_static.arg("libsmbclient.a");
1758        build_static.current_dir(&lib_dir);
1759
1760        // dedup src files
1761        let unique_src: HashSet<String> = SRC_FILES
1762            .iter()
1763            .chain(TDB_SRC)
1764            .chain(TALLOC_SRC)
1765            .chain(TEVENT_SRC)
1766            .map(|s| s.to_string())
1767            .collect();
1768
1769        let mut logfile = std::fs::File::create("/tmp/samba-build.log")
1770            .map_err(|e| format!("failed to create build log: {e}"))?;
1771        // push object
1772        for object in unique_src {
1773            let path = lib_dir.join(object);
1774
1775            let object_file = Self::find_object_for_src(&path).ok_or(format!(
1776                "object file not found for source file: {}",
1777                path.display()
1778            ))?;
1779
1780            use std::io::Write;
1781            writeln!(logfile, "object file: {path}", path = object_file.display()).ok();
1782            build_static.arg(object_file.display().to_string());
1783        }
1784
1785        // run ar
1786        self.run_command(build_static, "building static library")?;
1787
1788        // include_dir -> bin/default/include/public/
1789        let include_dir = inner_dir
1790            .join("bin")
1791            .join("default")
1792            .join("include")
1793            .join("public");
1794
1795        Ok(Artifacts {
1796            lib_dir,
1797            include_dir,
1798        })
1799    }
1800
1801    fn find_object_for_src(src: &Path) -> Option<PathBuf> {
1802        let glob = format!("{source}.*.o", source = src.display());
1803        glob::glob(&glob)
1804            .ok()?
1805            .filter_map(|entry| entry.ok())
1806            .next()
1807    }
1808
1809    fn build_target(
1810        &self,
1811        target: &str,
1812        build_dir: &Path,
1813        ios_isysroot: &Option<String>,
1814    ) -> Result<(), String> {
1815        let mut make = self.cmd_make()?;
1816        make.current_dir(build_dir);
1817        make.arg(target);
1818        if let Some(s) = env::var_os("CARGO_MAKEFLAGS") {
1819            make.env("MAKEFLAGS", s);
1820        }
1821        if let Some(isysr) = ios_isysroot {
1822            let components: Vec<&str> = isysr.split("/SDKs/").collect();
1823            make.env("CROSS_TOP", components[0]);
1824            make.env("CROSS_SDK", components[1]);
1825        }
1826        self.run_command(make, &format!("building {target}"))
1827    }
1828
1829    #[track_caller]
1830    fn run_command(&self, mut command: Command, desc: &str) -> Result<(), String> {
1831        println!("running {command:?}");
1832        let status = command.status();
1833
1834        let verbose_error = match status {
1835            Ok(status) if status.success() => return Ok(()),
1836            Ok(status) => format!(
1837                "'{exe}' reported failure with {status}",
1838                exe = command.get_program().to_string_lossy()
1839            ),
1840            Err(failed) => match failed.kind() {
1841                std::io::ErrorKind::NotFound => format!(
1842                    "Command '{exe}' not found. Is {exe} installed?",
1843                    exe = command.get_program().to_string_lossy()
1844                ),
1845                _ => format!(
1846                    "Could not run '{exe}', because {failed}",
1847                    exe = command.get_program().to_string_lossy()
1848                ),
1849            },
1850        };
1851        println!("cargo:warning={desc}: {verbose_error}");
1852        Err(format!(
1853            "Error {desc}:
1854    {verbose_error}
1855    Command failed: {command:?}"
1856        ))
1857    }
1858
1859    fn os(target: &str) -> Result<&'static str, String> {
1860        let os = match target {
1861            "aarch64-apple-darwin" => "darwin64-arm64-cc",
1862            "aarch64-linux-android" => "linux-aarch64",
1863            "aarch64-unknown-freebsd" => "BSD-generic64",
1864            "aarch64-unknown-openbsd" => "BSD-generic64",
1865            "aarch64-unknown-linux-gnu" => "linux-aarch64",
1866            "aarch64-unknown-linux-musl" => "linux-aarch64",
1867            "aarch64-alpine-linux-musl" => "linux-aarch64",
1868            "aarch64-chimera-linux-musl" => "linux-aarch64",
1869            "aarch64-unknown-netbsd" => "BSD-generic64",
1870            "aarch64_be-unknown-netbsd" => "BSD-generic64",
1871            "aarch64-pc-windows-msvc" => "VC-WIN64-ARM",
1872            "aarch64-uwp-windows-msvc" => "VC-WIN64-ARM-UWP",
1873            "arm-linux-androideabi" => "linux-armv4",
1874            "armv7-linux-androideabi" => "linux-armv4",
1875            "arm-unknown-linux-gnueabi" => "linux-armv4",
1876            "arm-unknown-linux-gnueabihf" => "linux-armv4",
1877            "arm-unknown-linux-musleabi" => "linux-armv4",
1878            "arm-unknown-linux-musleabihf" => "linux-armv4",
1879            "arm-chimera-linux-musleabihf" => "linux-armv4",
1880            "armv5te-unknown-linux-gnueabi" => "linux-armv4",
1881            "armv5te-unknown-linux-musleabi" => "linux-armv4",
1882            "armv6-unknown-freebsd" => "BSD-generic32",
1883            "armv6-alpine-linux-musleabihf" => "linux-armv6",
1884            "armv7-unknown-freebsd" => "BSD-armv4",
1885            "armv7-unknown-linux-gnueabi" => "linux-armv4",
1886            "armv7-unknown-linux-musleabi" => "linux-armv4",
1887            "armv7-unknown-linux-gnueabihf" => "linux-armv4",
1888            "armv7-unknown-linux-musleabihf" => "linux-armv4",
1889            "armv7-alpine-linux-musleabihf" => "linux-armv4",
1890            "armv7-chimera-linux-musleabihf" => "linux-armv4",
1891            "armv7-unknown-netbsd-eabihf" => "BSD-generic32",
1892            "asmjs-unknown-emscripten" => "gcc",
1893            "i586-unknown-linux-gnu" => "linux-elf",
1894            "i586-unknown-linux-musl" => "linux-elf",
1895            "i586-alpine-linux-musl" => "linux-elf",
1896            "i586-unknown-netbsd" => "BSD-x86-elf",
1897            "i686-apple-darwin" => "darwin-i386-cc",
1898            "i686-linux-android" => "linux-elf",
1899            "i686-pc-windows-gnu" => "mingw",
1900            "i686-pc-windows-msvc" => "VC-WIN32",
1901            "i686-win7-windows-msvc" => "VC-WIN32",
1902            "i686-unknown-freebsd" => "BSD-x86-elf",
1903            "i686-unknown-haiku" => "haiku-x86",
1904            "i686-unknown-linux-gnu" => "linux-elf",
1905            "i686-unknown-linux-musl" => "linux-elf",
1906            "i686-unknown-netbsd" => "BSD-x86-elf",
1907            "i686-uwp-windows-msvc" => "VC-WIN32-UWP",
1908            "loongarch64-unknown-linux-gnu" => "linux-generic64",
1909            "loongarch64-unknown-linux-musl" => "linux-generic64",
1910            "mips-unknown-linux-gnu" => "linux-mips32",
1911            "mips-unknown-linux-musl" => "linux-mips32",
1912            "mips64-unknown-linux-gnuabi64" => "linux64-mips64",
1913            "mips64-unknown-linux-muslabi64" => "linux64-mips64",
1914            "mips64el-unknown-linux-gnuabi64" => "linux64-mips64",
1915            "mips64el-unknown-linux-muslabi64" => "linux64-mips64",
1916            "mipsel-unknown-linux-gnu" => "linux-mips32",
1917            "mipsel-unknown-linux-musl" => "linux-mips32",
1918            "powerpc-unknown-freebsd" => "BSD-ppc",
1919            "powerpc-unknown-linux-gnu" => "linux-ppc",
1920            "powerpc-unknown-linux-gnuspe" => "linux-ppc",
1921            "powerpc-chimera-linux-musl" => "linux-ppc",
1922            "powerpc-unknown-netbsd" => "BSD-generic32",
1923            "powerpc64-unknown-freebsd" => "BSD-ppc64",
1924            "powerpc64-unknown-linux-gnu" => "linux-ppc64",
1925            "powerpc64-unknown-linux-musl" => "linux-ppc64",
1926            "powerpc64-chimera-linux-musl" => "linux-ppc64",
1927            "powerpc64le-unknown-freebsd" => "BSD-ppc64le",
1928            "powerpc64le-unknown-linux-gnu" => "linux-ppc64le",
1929            "powerpc64le-unknown-linux-musl" => "linux-ppc64le",
1930            "powerpc64le-alpine-linux-musl" => "linux-ppc64le",
1931            "powerpc64le-chimera-linux-musl" => "linux-ppc64le",
1932            "riscv64gc-unknown-freebsd" => "BSD-riscv64",
1933            "riscv64gc-unknown-linux-gnu" => "linux64-riscv64",
1934            "riscv64gc-unknown-linux-musl" => "linux64-riscv64",
1935            "riscv64-alpine-linux-musl" => "linux64-riscv64",
1936            "riscv64-chimera-linux-musl" => "linux64-riscv64",
1937            "riscv64gc-unknown-netbsd" => "BSD-generic64",
1938            "s390x-unknown-linux-gnu" => "linux64-s390x",
1939            "sparc64-unknown-netbsd" => "BSD-generic64",
1940            "s390x-unknown-linux-musl" => "linux64-s390x",
1941            "s390x-alpine-linux-musl" => "linux64-s390x",
1942            "sparcv9-sun-solaris" => "solaris64-sparcv9-gcc",
1943            "thumbv7a-uwp-windows-msvc" => "VC-WIN32-ARM-UWP",
1944            "x86_64-apple-darwin" => "darwin64-x86_64-cc",
1945            "x86_64-linux-android" => "linux-x86_64",
1946            "x86_64-linux" => "linux-x86_64",
1947            "x86_64-pc-windows-gnu" => "mingw64",
1948            "x86_64-pc-windows-gnullvm" => "mingw64",
1949            "x86_64-pc-windows-msvc" => "VC-WIN64A",
1950            "x86_64-win7-windows-msvc" => "VC-WIN64A",
1951            "x86_64-unknown-freebsd" => "BSD-x86_64",
1952            "x86_64-unknown-dragonfly" => "BSD-x86_64",
1953            "x86_64-unknown-haiku" => "haiku-x86_64",
1954            "x86_64-unknown-illumos" => "solaris64-x86_64-gcc",
1955            "x86_64-unknown-linux-gnu" => "linux-x86_64",
1956            "x86_64-unknown-linux-musl" => "linux-x86_64",
1957            "x86_64-alpine-linux-musl" => "linux-x86_64",
1958            "x86_64-chimera-linux-musl" => "linux-x86_64",
1959            "x86_64-unknown-openbsd" => "BSD-x86_64",
1960            "x86_64-unknown-netbsd" => "BSD-x86_64",
1961            "x86_64-uwp-windows-msvc" => "VC-WIN64A-UWP",
1962            "x86_64-pc-solaris" => "solaris64-x86_64-gcc",
1963            "wasm32-unknown-emscripten" => "gcc",
1964            "wasm32-unknown-unknown" => "gcc",
1965            "wasm32-wasi" => "gcc",
1966            "aarch64-apple-ios" => "ios64-cross",
1967            "x86_64-apple-ios" => "iossimulator-xcrun",
1968            "aarch64-apple-ios-sim" => "iossimulator-xcrun",
1969            "aarch64-unknown-linux-ohos" => "linux-aarch64",
1970            "armv7-unknown-linux-ohos" => "linux-generic32",
1971            "x86_64-unknown-linux-ohos" => "linux-x86_64",
1972            _ => {
1973                return Err(format!(
1974                    "don't know how to configure OpenSSL for {}",
1975                    target
1976                ));
1977            }
1978        };
1979
1980        Ok(os)
1981    }
1982}
1983
1984/// Clones the configured Samba release into `p`.
1985fn clone_samba(p: &Path) -> Result<(), String> {
1986    let repo_url = "https://git.samba.org/samba.git";
1987    let repo = git2::Repository::clone(repo_url, p).map_err(|e| format!("cloning samba: {e}"))?;
1988
1989    let tag = format!("samba-{version}", version = version());
1990    let obj = repo
1991        .revparse_single(&tag)
1992        .map_err(|e| format!("revparse_single: {e}"))?;
1993
1994    let commit = obj
1995        .peel_to_commit()
1996        .map_err(|e| format!("peel_to_commit: {e}"))?;
1997
1998    repo.checkout_tree(&obj, None)
1999        .map_err(|e| format!("checkout_tree: {e}"))?;
2000
2001    repo.set_head_detached(commit.id())
2002        .map_err(|e| format!("set_head_detached: {e}"))?;
2003
2004    Ok(())
2005}
2006
2007#[cfg(target_os = "macos")]
2008fn add_env_includes(cmd: &mut Command, include_paths: &[PathBuf]) -> Result<(), String> {
2009    let cflags = include_paths
2010        .iter()
2011        .map(|p| format!("-I{path}", path = p.display()))
2012        .collect::<Vec<_>>()
2013        .join(" ");
2014    cmd.env("CFLAGS", cflags);
2015
2016    Ok(())
2017}