mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-31 21:06:18 +01:00
Compare commits
611
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
37af766bc5 | ||
|
|
8c053ad76b | ||
|
|
588b1cfac5 | ||
|
|
da53285e29 | ||
|
|
45d1109013 | ||
|
|
7b60928ee2 | ||
|
|
9d3c7cce0d | ||
|
|
8cfe56dbc7 | ||
|
|
413dc552c4 | ||
|
|
dee76d0646 | ||
|
|
129d643a65 | ||
|
|
cec837a8a6 | ||
|
|
3bd43bfa40 | ||
|
|
210e9a26ec | ||
|
|
b4f126985a | ||
|
|
cf9e046bb6 | ||
|
|
6bb5dc94cd | ||
|
|
ee2af9d10e | ||
|
|
58e00024f1 | ||
|
|
4410510fc7 | ||
|
|
c9e956cffd | ||
|
|
679c86086a | ||
|
|
119c692450 | ||
|
|
6289e01911 | ||
|
|
e219367127 | ||
|
|
5a22c05895 | ||
|
|
a5feedf4ae | ||
|
|
7350628a39 | ||
|
|
0c43e42be8 | ||
|
|
ef01f5d711 | ||
|
|
868372d919 | ||
|
|
45b6e80b0b | ||
|
|
36ad0a332c | ||
|
|
16fa413cce | ||
|
|
e14abeefac | ||
|
|
1774a29ac5 | ||
|
|
06a8802172 | ||
|
|
e32acbc4d4 | ||
|
|
6dcdee9d65 | ||
|
|
82ec27c7a3 | ||
|
|
b5294b5f54 | ||
|
|
f45f9584af | ||
|
|
7a7c364e59 | ||
|
|
ad9e84a4f1 | ||
|
|
704499d7d3 | ||
|
|
274fc46902 | ||
|
|
089945d6d0 | ||
|
|
61d2549fac | ||
|
|
f21ae99cfd | ||
|
|
7a58de90d2 | ||
|
|
fa3b3a92ab | ||
|
|
8066b6dacc | ||
|
|
5d48cda2cb | ||
|
|
79899a86dd | ||
|
|
60b79c6bd5 | ||
|
|
a1e3eba1e6 | ||
|
|
ceb735f913 | ||
|
|
53c3db57d1 | ||
|
|
9ac015cb2a | ||
|
|
1a00baf6e3 | ||
|
|
ad389706c8 | ||
|
|
3ccc08308b | ||
|
|
8e4ba94c27 | ||
|
|
7497b29b56 | ||
|
|
417abedd13 | ||
|
|
eba6753dc6 | ||
|
|
7f641640b7 | ||
|
|
3e737e1af0 | ||
|
|
bb4a06d70e | ||
|
|
4483c29996 | ||
|
|
619e0d9eb3 | ||
|
|
37076793ee | ||
|
|
8483485024 | ||
|
|
fdbcce4eae | ||
|
|
5862dff1d8 | ||
|
|
b9cacb3074 | ||
|
|
add956c60c | ||
|
|
3f3aa81144 | ||
|
|
e9a408dfd6 | ||
|
|
db0839bbba | ||
|
|
c27f19768f | ||
|
|
5af9d22fdb | ||
|
|
5476c04745 | ||
|
|
1600487f82 | ||
|
|
345f22121a | ||
|
|
fe86da7012 | ||
|
|
403416acb0 | ||
|
|
348216fa17 | ||
|
|
71dc3c3b92 | ||
|
|
0c636e14d0 | ||
|
|
d8bf6a63eb | ||
|
|
b0d3cb17ec | ||
|
|
c1286b19b4 | ||
|
|
afd948d483 | ||
|
|
001e39582a | ||
|
|
22d3a6ee81 | ||
|
|
5edfa7b7ba | ||
|
|
02e520d4f5 | ||
|
|
da4b6288aa | ||
|
|
fa0312bdf8 | ||
|
|
28a40134a1 | ||
|
|
039dcbd939 | ||
|
|
ec09157693 | ||
|
|
a9c9ca4e75 | ||
|
|
d2884a4f1f | ||
|
|
afbfd4ddc4 | ||
|
|
9a3551c26b | ||
|
|
ebfa796835 | ||
|
|
cd3e3376be | ||
|
|
aaaf88b62c | ||
|
|
148bd4a9cb | ||
|
|
5804cc9f3f | ||
|
|
4d98c3c89e | ||
|
|
4f3a8f6d1b | ||
|
|
3b26e469e3 | ||
|
|
e2bb7028d7 | ||
|
|
5b1940367b | ||
|
|
01eaa8277b | ||
|
|
4dc462ee20 | ||
|
|
b4d9a1b506 | ||
|
|
98415df779 | ||
|
|
cc672d0f8e | ||
|
|
47e4484151 | ||
|
|
1c4cc9f5ca | ||
|
|
39031e61e5 | ||
|
|
f24a2ca40b | ||
|
|
3c8fbbf5d5 | ||
|
|
58b955e032 | ||
|
|
00605fb558 | ||
|
|
7f45e090d2 | ||
|
|
44fbdde6f6 | ||
|
|
54d781eb05 | ||
|
|
c27e1bc191 | ||
|
|
e225da4bd9 | ||
|
|
1ec97bfb26 | ||
|
|
0f7d840303 | ||
|
|
7ca83a8619 | ||
|
|
29d95d24cb | ||
|
|
0e257c9a20 | ||
|
|
d9846bb9fa | ||
|
|
2484c3e074 | ||
|
|
8527e0fa19 | ||
|
|
f70e934735 | ||
|
|
f671778005 | ||
|
|
735efd4ee2 | ||
|
|
eaf13cabda | ||
|
|
080b5dd65d | ||
|
|
5fb6b10971 | ||
|
|
42d8c16e8a | ||
|
|
2ba36837d9 | ||
|
|
5413271fa3 | ||
|
|
f74b90cd8a | ||
|
|
4aa19e50d2 | ||
|
|
3067e3a7b1 | ||
|
|
0e1103a22c | ||
|
|
ee4ef88df7 | ||
|
|
71afe28aa5 | ||
|
|
e0d43d8c46 | ||
|
|
abd047d9ca | ||
|
|
4826a70d92 | ||
|
|
ccea7f5333 | ||
|
|
24da020e9a | ||
|
|
ce7246bbd7 | ||
|
|
b9224684b1 | ||
|
|
e3c9193f02 | ||
|
|
98b4dda153 | ||
|
|
5fe20d3462 | ||
|
|
25be5768cd | ||
|
|
f313464b9c | ||
|
|
2c54736365 | ||
|
|
5333be3a55 | ||
|
|
4901ad8342 | ||
|
|
74ef9f5937 | ||
|
|
8d25f3992b | ||
|
|
7e9d0acbbd | ||
|
|
bfbc761774 | ||
|
|
723cde126f | ||
|
|
68d4337d86 | ||
|
|
fa159da4fc | ||
|
|
0cc0e0979b | ||
|
|
dc03fed878 | ||
|
|
3d3e44cf91 | ||
|
|
eb3ab55546 | ||
|
|
3b5ab1280f | ||
|
|
6ac1294df2 | ||
|
|
130369e78c | ||
|
|
c1ff69e37b | ||
|
|
78c1d74431 | ||
|
|
f20301bc62 | ||
|
|
68632907b9 | ||
|
|
d759d38df2 | ||
|
|
ad4ae0258f | ||
|
|
986314ee61 | ||
|
|
3e6f44249f | ||
|
|
fd716e7b88 | ||
|
|
4dec8acc22 | ||
|
|
94d4b94b05 | ||
|
|
048f9a72df | ||
|
|
ed1f397d5d | ||
|
|
d5aa8e7391 | ||
|
|
c4895a9387 | ||
|
|
bbe63614bd | ||
|
|
bb33ea9f9d | ||
|
|
75f8f4881c | ||
|
|
2b43c29d3c | ||
|
|
75c413116c | ||
|
|
b0d5398bfd | ||
|
|
761d7fedf8 | ||
|
|
70600ece87 | ||
|
|
2389f43fed | ||
|
|
1b5825d037 | ||
|
|
4e1437db9b | ||
|
|
4c630bc75a | ||
|
|
15e35537a8 | ||
|
|
03f6df00fc | ||
|
|
0765d33f79 | ||
|
|
e63d88967e | ||
|
|
b2d3946118 | ||
|
|
2a05775809 | ||
|
|
0fbfb082fc | ||
|
|
cba8447ba2 | ||
|
|
b0516085d2 | ||
|
|
724a86d717 | ||
|
|
35160540ac | ||
|
|
f42675cd3d | ||
|
|
fc6fc6b8a1 | ||
|
|
027cd8b2a0 | ||
|
|
c944e534ab | ||
|
|
20dce4dcea | ||
|
|
6cf0176415 | ||
|
|
ef53c2f915 | ||
|
|
70b99cb84d | ||
|
|
f0ab510a10 | ||
|
|
cca5f3e1f3 | ||
|
|
07733fde5b | ||
|
|
52ae79af78 | ||
|
|
97eef7a334 | ||
|
|
073f2aa1a4 | ||
|
|
a7fedaae12 | ||
|
|
821205a930 | ||
|
|
fa4ac30116 | ||
|
|
51ac1c2059 | ||
|
|
5826ecda32 | ||
|
|
d08861403a | ||
|
|
47210b7a21 | ||
|
|
6514313e26 | ||
|
|
e10f1aee48 | ||
|
|
713599ef92 | ||
|
|
3bb1624cc0 | ||
|
|
a49b931485 | ||
|
|
5a66b8a5a9 | ||
|
|
2e3e99e6d5 | ||
|
|
4a7825170b | ||
|
|
51bdd0a009 | ||
|
|
a260b2a9f1 | ||
|
|
b361aea02f | ||
|
|
255be8270d | ||
|
|
09fc69c409 | ||
|
|
dd9d5c3b73 | ||
|
|
5e439568d8 | ||
|
|
845b28b433 | ||
|
|
a52058622e | ||
|
|
9aca59ead2 | ||
|
|
674b7fc081 | ||
|
|
76d19f010a | ||
|
|
b97518c85f | ||
|
|
097899589d | ||
|
|
39720130d9 | ||
|
|
e5c44db752 | ||
|
|
23458713e6 | ||
|
|
cfdb3a596e | ||
|
|
93f64eca5f | ||
|
|
9d0f820b60 | ||
|
|
4d6f18806f | ||
|
|
6041517231 | ||
|
|
b9a31f0a81 | ||
|
|
89f7b71b3f | ||
|
|
2ed1c7909e | ||
|
|
41bd758366 | ||
|
|
993a23aa0f | ||
|
|
d228c5672f | ||
|
|
ca09eeb594 | ||
|
|
c5d0a6fb2a | ||
|
|
b307ce1193 | ||
|
|
32b1013263 | ||
|
|
d870206574 | ||
|
|
c3694df51b | ||
|
|
d455718627 | ||
|
|
e3b57d69dd | ||
|
|
95484b9735 | ||
|
|
3c23d93307 | ||
|
|
8727ea9b81 | ||
|
|
8dd6d0b0cd | ||
|
|
d88da17282 | ||
|
|
cce0fedf59 | ||
|
|
c698bae7b4 | ||
|
|
761768e008 | ||
|
|
4c1f4425ff | ||
|
|
5039626403 | ||
|
|
a4b8a92fdb | ||
|
|
398b801d35 | ||
|
|
18419b4b6e | ||
|
|
2f6a098cb8 | ||
|
|
e7f739417c | ||
|
|
2978ed4459 | ||
|
|
1a6d60484f | ||
|
|
bc6e78fde2 | ||
|
|
f0650fa2d0 | ||
|
|
f86a8cc599 | ||
|
|
89d7f2e8b5 | ||
|
|
a0eaaecb79 | ||
|
|
bf868e6646 | ||
|
|
6eca4d8dc2 | ||
|
|
518b5d960e | ||
|
|
42735631d1 | ||
|
|
a03e25bfc6 | ||
|
|
bc78de4d7e | ||
|
|
9194e8e1d8 | ||
|
|
446a8be209 | ||
|
|
e7ee409b61 | ||
|
|
1140ecfb2e | ||
|
|
1483a36683 | ||
|
|
94d9ea2812 | ||
|
|
b3bf9fbe20 | ||
|
|
18c0035a0c | ||
|
|
27ea8b190a | ||
|
|
0d4dfc6153 | ||
|
|
8fb2b2e1e4 | ||
|
|
1218e3f352 | ||
|
|
e06f086118 | ||
|
|
8c49f7916c | ||
|
|
49c60b9baf | ||
|
|
398c8ab3ea | ||
|
|
5da5e255c7 | ||
|
|
8344bcc3c9 | ||
|
|
2c006322c5 | ||
|
|
80eb629e59 | ||
|
|
506c1ff0bb | ||
|
|
a397540e2b | ||
|
|
b253568b7d | ||
|
|
7689b8bfca | ||
|
|
09f5fc8eac | ||
|
|
b4d6dd3d55 | ||
|
|
b24d34d2b4 | ||
|
|
2644b630b8 | ||
|
|
d8d4036d2d | ||
|
|
3b2d4a83a1 | ||
|
|
db7ccf92ad | ||
|
|
63d937fe1a | ||
|
|
8427e3bc21 | ||
|
|
ff0000e4f3 | ||
|
|
e9c89dea5b | ||
|
|
00bf9b742b | ||
|
|
5db0c12eaa | ||
|
|
15bd8bdd0e | ||
|
|
437f1f72ad | ||
|
|
f81a13305c | ||
|
|
f9f9b3a9a6 | ||
|
|
a50f34520c | ||
|
|
d3160236a6 | ||
|
|
4162672665 | ||
|
|
307f779132 | ||
|
|
35f56d7e9a | ||
|
|
0bf2b9e61b | ||
|
|
4c616be69f | ||
|
|
31e7f0e4cb | ||
|
|
7ed851339d | ||
|
|
63bd792124 | ||
|
|
a00e70fc73 | ||
|
|
36fc70da71 | ||
|
|
d5a8261418 | ||
|
|
e3d592539d | ||
|
|
0d24467ece | ||
|
|
9307db6c70 | ||
|
|
05b343509f | ||
|
|
e6001e4599 | ||
|
|
1f131bf39b | ||
|
|
c74c9aaa85 | ||
|
|
4d8b11f741 | ||
|
|
82603e2756 | ||
|
|
95374fd349 | ||
|
|
9ab404aa2c | ||
|
|
9db4590a1e | ||
|
|
2ef8acb1bc | ||
|
|
76202b7e8d | ||
|
|
321dc8f62c | ||
|
|
7a8da03f81 | ||
|
|
2f8a818f60 | ||
|
|
a76009c482 | ||
|
|
375af6b6fc | ||
|
|
952515b9f9 | ||
|
|
61ce819886 | ||
|
|
2b4f998bc8 | ||
|
|
1f8dc459ec | ||
|
|
ccdcbdaee0 | ||
|
|
a1166db47c | ||
|
|
ff4e1b0557 | ||
|
|
8636d27f33 | ||
|
|
693dd96d8d | ||
|
|
dd10325736 | ||
|
|
b7a8f6ee84 | ||
|
|
bfbdd7197d | ||
|
|
4e6be8cec3 | ||
|
|
f06ec83eb3 | ||
|
|
1a2e22c686 | ||
|
|
97d35e4cae | ||
|
|
a8256f0e48 | ||
|
|
8045deeaab | ||
|
|
9330a79715 | ||
|
|
3aadd91e70 | ||
|
|
b68295237c | ||
|
|
6708bd4649 | ||
|
|
6c2de447e2 | ||
|
|
a116fdd5a7 | ||
|
|
e9e1f74713 | ||
|
|
9be6c823fc | ||
|
|
b3efcee77b | ||
|
|
dbca198d27 | ||
|
|
cfd9a39121 | ||
|
|
70f7ea00cf | ||
|
|
110bdbc8d6 | ||
|
|
562c65afe8 | ||
|
|
1e5d73550e | ||
|
|
fc63cf6aba | ||
|
|
0b638879a6 | ||
|
|
565b03d5d9 | ||
|
|
67831b3f1e | ||
|
|
9d485b09e9 | ||
|
|
f9846be12b | ||
|
|
392ebbb6dc | ||
|
|
f671ea43d4 | ||
|
|
2c30688e38 | ||
|
|
e42603fc91 | ||
|
|
ee09fc67ae | ||
|
|
474b39494b | ||
|
|
d846f880fa | ||
|
|
58e7810628 | ||
|
|
32c9904c26 | ||
|
|
8dfff06825 | ||
|
|
796e9d2150 | ||
|
|
9e1b59768a | ||
|
|
a1ec0f0a49 | ||
|
|
5f0dc75cb2 | ||
|
|
24f9c1b58d | ||
|
|
f34e4c7297 | ||
|
|
a7b5a3d438 | ||
|
|
4a37cab42c | ||
|
|
b1c1eb785a | ||
|
|
c1c415ee04 | ||
|
|
c4d9d4e22c | ||
|
|
a42e24b0d8 | ||
|
|
afec3343bf | ||
|
|
7125e3504c | ||
|
|
3845c5cef7 | ||
|
|
b3e4acb25f | ||
|
|
401ad1b119 | ||
|
|
13c1399ef0 | ||
|
|
2e8fbf21ce | ||
|
|
2099dd6b47 | ||
|
|
af5bcc0336 | ||
|
|
9efb797d8b | ||
|
|
b53455548e | ||
|
|
7484648ed0 | ||
|
|
fd527f059b | ||
|
|
eebe97f871 | ||
|
|
b1d34a3680 | ||
|
|
806141529a | ||
|
|
aff1a8ed8f | ||
|
|
36f28d1a96 | ||
|
|
f1c2fedce4 | ||
|
|
9d24a43eb2 | ||
|
|
408d7d3860 | ||
|
|
7c5fdf493f | ||
|
|
21035ef30b | ||
|
|
0ced828c48 | ||
|
|
379081153d | ||
|
|
24fcfd33c8 | ||
|
|
8077454f0e | ||
|
|
c81e2a762a | ||
|
|
7baab58bd0 | ||
|
|
2cff5ec308 | ||
|
|
e378e23887 | ||
|
|
c33ebf418c | ||
|
|
626b1ad429 | ||
|
|
a29e63aae5 | ||
|
|
cd442364b6 | ||
|
|
33e8b55d5f | ||
|
|
ce8642846d | ||
|
|
327d49fb81 | ||
|
|
a8aefdfd62 | ||
|
|
720e5b04d5 | ||
|
|
caeff39611 | ||
|
|
94e5e0b127 | ||
|
|
444093244f | ||
|
|
b2868dafa4 | ||
|
|
eb36d1d5c6 | ||
|
|
b0a3856986 | ||
|
|
2473fd01a7 | ||
|
|
e75df28778 | ||
|
|
8ca38783d4 | ||
|
|
766d414726 | ||
|
|
3cbacbd2a7 | ||
|
|
83bf99b00f | ||
|
|
68cee815ac | ||
|
|
91cc1e3288 | ||
|
|
b2c4b9a22e | ||
|
|
f4aa8edd2f | ||
|
|
7e94566c05 | ||
|
|
71f99825dd | ||
|
|
387d271909 | ||
|
|
e9451337b2 | ||
|
|
ccb88daec6 | ||
|
|
6a35ea9aa1 | ||
|
|
3d30b84cbd | ||
|
|
2cbabab770 | ||
|
|
65e874488f | ||
|
|
9a21f7163d | ||
|
|
74af4ca40c | ||
|
|
3af13cd5eb | ||
|
|
6648ab21f5 | ||
|
|
0f0874a4ea | ||
|
|
ce283bee80 | ||
|
|
02d44df429 | ||
|
|
1bba44a1f7 | ||
|
|
1a6f93ce25 | ||
|
|
ed687eb5c1 | ||
|
|
d86af3a140 | ||
|
|
e40cc44da9 | ||
|
|
4491d309c0 | ||
|
|
a836efd603 | ||
|
|
041c861b47 | ||
|
|
eea4d291f6 | ||
|
|
228f6900a1 | ||
|
|
bd369beb3b | ||
|
|
0636dee8c3 | ||
|
|
06c2d7b792 | ||
|
|
eb166a2f43 | ||
|
|
b0963ede94 | ||
|
|
b0a643917c | ||
|
|
c286ecae39 | ||
|
|
20eba4c5a0 | ||
|
|
aa167f98a9 | ||
|
|
d5b186ff68 | ||
|
|
44aa52718c | ||
|
|
374e02238f | ||
|
|
571d9a8ce2 | ||
|
|
674ba0143c | ||
|
|
2583cb908c | ||
|
|
94a3d9c117 | ||
|
|
eaf8401ebb | ||
|
|
65bc61ff8f | ||
|
|
184d11b059 | ||
|
|
00f7126ba4 | ||
|
|
9fffddb4d7 | ||
|
|
70a9b67634 | ||
|
|
8e8ae85c1b | ||
|
|
bc599cd463 | ||
|
|
75c4f9c349 | ||
|
|
80777ecf12 | ||
|
|
35c6052287 | ||
|
|
a83d97d13d | ||
|
|
34562f6948 | ||
|
|
504eed42f1 | ||
|
|
8a525f2a81 | ||
|
|
676165fff9 | ||
|
|
c9af249351 | ||
|
|
3349437ac6 | ||
|
|
839256769d | ||
|
|
d2780d0e9c | ||
|
|
95a780b2a0 | ||
|
|
d0aa1d8fd8 | ||
|
|
7f77095f9c | ||
|
|
8e6b7a78dd | ||
|
|
6fdece0280 | ||
|
|
83881079c2 | ||
|
|
071c8f1d6f | ||
|
|
f23ba952ff | ||
|
|
e6d3782d06 | ||
|
|
44b2556984 | ||
|
|
5eb5e1a75e | ||
|
|
6aa7ce7a6d | ||
|
|
b0353620d1 | ||
|
|
765c2abb35 | ||
|
|
cc0bfea1cc | ||
|
|
4d21e40b7d | ||
|
|
5a087fb62a | ||
|
|
80ae0001a0 | ||
|
|
e8ba7ffa4c | ||
|
|
156688772f | ||
|
|
ce980c3b30 | ||
|
|
adb2b5f8df | ||
|
|
f103f3a37f | ||
|
|
9b6c26189f | ||
|
|
0e411e5030 | ||
|
|
c17767bc23 | ||
|
|
1e41282ea7 | ||
|
|
4cca46b73c | ||
|
|
e33526fed2 | ||
|
|
1a3b683d9c | ||
|
|
78ee35a9f8 | ||
|
|
ea6e6f1fa1 | ||
|
|
4d001dba5d | ||
|
|
9aeadaf0b1 | ||
|
|
63b7e78b07 | ||
|
|
f5c3fdc949 | ||
|
|
30f639ba42 | ||
|
|
c35ab24400 | ||
|
|
8cef7215db | ||
|
|
c5f289819c | ||
|
|
18b41dce3d | ||
|
|
421c10b209 |
No files matched your search
+2
-1
@@ -552,10 +552,11 @@ includes:
|
||||
cd ${.CURDIR}/lib/libftpio; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libmd; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libmytinfo; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libncurses; ${MAKE} beforeinstall
|
||||
.if !defined(WANT_CSRG_LIBM)
|
||||
cd ${.CURDIR}/lib/msun; ${MAKE} beforeinstall
|
||||
.endif
|
||||
cd ${.CURDIR}/lib/libncurses; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libnetgraph; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libopie; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libpam/libpam; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libpcap; ${MAKE} beforeinstall
|
||||
|
||||
+1
-1
@@ -135,7 +135,7 @@ respectively.
|
||||
.Pp
|
||||
Note that not all medium changers support the
|
||||
.Ic exchange
|
||||
operation; The changer must have multiple free pickers or emulate
|
||||
operation; the changer must have multiple free pickers or emulate
|
||||
multiple free pickers with transient storage.
|
||||
.It Xo Nm position
|
||||
.Ar <to ET> <to EU>
|
||||
|
||||
+101
-58
@@ -34,11 +34,12 @@
|
||||
* Additional Copyright (c) 1997, by Matthew Jacob, for NASA/Ames Research Ctr.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__COPYRIGHT("@(#) Copyright (c) 1996 Jason R. Thorpe. All rights reserved.");
|
||||
__RCSID("$NetBSD: chio.c,v 1.6 1998/01/04 23:53:58 thorpej Exp $");
|
||||
#endif
|
||||
static const char copyright[] =
|
||||
"@(#) Copyright (c) 1996 Jason R. Thorpe. All rights reserved.";
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/chio.h>
|
||||
@@ -55,45 +56,44 @@ __RCSID("$NetBSD: chio.c,v 1.6 1998/01/04 23:53:58 thorpej Exp $");
|
||||
extern char *__progname; /* from crt0.o */
|
||||
extern int optreset; /* from getopt.o */
|
||||
|
||||
int main(int, char *[]);
|
||||
static void usage(void);
|
||||
static void cleanup(void);
|
||||
static int parse_element_type(char *);
|
||||
static int parse_element_unit(char *);
|
||||
static const char * element_type_name(int et);
|
||||
static int parse_special(char *);
|
||||
static int is_special(char *);
|
||||
static char *bits_to_string(int, const char *);
|
||||
static void usage __P((void));
|
||||
static void cleanup __P((void));
|
||||
static int parse_element_type __P((char *));
|
||||
static int parse_element_unit __P((char *));
|
||||
static const char * element_type_name __P((int et));
|
||||
static int parse_special __P((char *));
|
||||
static int is_special __P((char *));
|
||||
static const char *bits_to_string __P((int, const char *));
|
||||
|
||||
static int do_move(char *, int, char **);
|
||||
static int do_exchange(char *, int, char **);
|
||||
static int do_position(char *, int, char **);
|
||||
static int do_params(char *, int, char **);
|
||||
static int do_getpicker(char *, int, char **);
|
||||
static int do_setpicker(char *, int, char **);
|
||||
static int do_status(char *, int, char **);
|
||||
static int do_ielem(char *, int, char **);
|
||||
static int do_voltag(char *, int, char **);
|
||||
static int do_move __P((char *, int, char **));
|
||||
static int do_exchange __P((char *, int, char **));
|
||||
static int do_position __P((char *, int, char **));
|
||||
static int do_params __P((char *, int, char **));
|
||||
static int do_getpicker __P((char *, int, char **));
|
||||
static int do_setpicker __P((char *, int, char **));
|
||||
static int do_status __P((char *, int, char **));
|
||||
static int do_ielem __P((char *, int, char **));
|
||||
static int do_voltag __P((char *, int, char **));
|
||||
|
||||
/* Valid changer element types. */
|
||||
const struct element_type elements[] = {
|
||||
{ "picker", CHET_MT },
|
||||
{ "slot", CHET_ST },
|
||||
{ "portal", CHET_IE },
|
||||
{ "drive", CHET_DT },
|
||||
{ "picker", CHET_MT },
|
||||
{ "portal", CHET_IE },
|
||||
{ "slot", CHET_ST },
|
||||
{ NULL, 0 },
|
||||
};
|
||||
|
||||
/* Valid commands. */
|
||||
const struct changer_command commands[] = {
|
||||
{ "move", do_move },
|
||||
{ "exchange", do_exchange },
|
||||
{ "position", do_position },
|
||||
{ "params", do_params },
|
||||
{ "getpicker", do_getpicker },
|
||||
{ "ielem", do_ielem },
|
||||
{ "move", do_move },
|
||||
{ "params", do_params },
|
||||
{ "position", do_position },
|
||||
{ "setpicker", do_setpicker },
|
||||
{ "status", do_status },
|
||||
{ "ielem", do_ielem },
|
||||
{ "voltag", do_voltag },
|
||||
{ NULL, 0 },
|
||||
};
|
||||
@@ -107,10 +107,12 @@ const struct special_word specials[] = {
|
||||
};
|
||||
|
||||
static int changer_fd;
|
||||
static char *changer_name;
|
||||
static const char *changer_name;
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
int ch, i;
|
||||
|
||||
@@ -147,15 +149,26 @@ main(int argc, char *argv[])
|
||||
for (i = 0; commands[i].cc_name != NULL; ++i)
|
||||
if (strcmp(*argv, commands[i].cc_name) == 0)
|
||||
break;
|
||||
if (commands[i].cc_name == NULL) {
|
||||
/* look for abbreviation */
|
||||
for (i = 0; commands[i].cc_name != NULL; ++i)
|
||||
if (strncmp(*argv, commands[i].cc_name,
|
||||
strlen(*argv)) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if (commands[i].cc_name == NULL)
|
||||
errx(1, "unknown command: %s", *argv);
|
||||
|
||||
exit((*commands[i].cc_handler)(commands[i].cc_name, argc, argv));
|
||||
exit ((*commands[i].cc_handler)(commands[i].cc_name, argc, argv));
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
static int
|
||||
do_move(char *cname, int argc, char **argv)
|
||||
do_move(cname, argc, argv)
|
||||
char *cname;
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
struct changer_move cmd;
|
||||
int val;
|
||||
@@ -223,7 +236,10 @@ do_move(char *cname, int argc, char **argv)
|
||||
}
|
||||
|
||||
static int
|
||||
do_exchange(char *cname, int argc, char **argv)
|
||||
do_exchange(cname, argc, argv)
|
||||
char *cname;
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
struct changer_exchange cmd;
|
||||
int val;
|
||||
@@ -318,7 +334,10 @@ do_exchange(char *cname, int argc, char **argv)
|
||||
}
|
||||
|
||||
static int
|
||||
do_position(char *cname, int argc, char **argv)
|
||||
do_position(cname, argc, argv)
|
||||
char *cname;
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
struct changer_position cmd;
|
||||
int val;
|
||||
@@ -379,7 +398,10 @@ do_position(char *cname, int argc, char **argv)
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
do_params(char *cname, int argc, char **argv)
|
||||
do_params(cname, argc, argv)
|
||||
char *cname;
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
struct changer_params data;
|
||||
int picker;
|
||||
@@ -422,7 +444,10 @@ do_params(char *cname, int argc, char **argv)
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
do_getpicker(char *cname, int argc, char **argv)
|
||||
do_getpicker(cname, argc, argv)
|
||||
char *cname;
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
int picker;
|
||||
|
||||
@@ -449,7 +474,10 @@ do_getpicker(char *cname, int argc, char **argv)
|
||||
}
|
||||
|
||||
static int
|
||||
do_setpicker(char *cname, int argc, char **argv)
|
||||
do_setpicker(cname, argc, argv)
|
||||
char *cname;
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
int picker;
|
||||
|
||||
@@ -477,7 +505,10 @@ do_setpicker(char *cname, int argc, char **argv)
|
||||
}
|
||||
|
||||
static int
|
||||
do_status(char *cname, int argc, char **argv)
|
||||
do_status(cname, argc, argv)
|
||||
char *cname;
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
struct changer_params cp;
|
||||
struct changer_element_status_request cesr;
|
||||
@@ -496,7 +527,7 @@ do_status(char *cname, int argc, char **argv)
|
||||
description = NULL;
|
||||
|
||||
optind = optreset = 1;
|
||||
while ((c = getopt(argc, argv, "vVsSbaI")) != EOF) {
|
||||
while ((c = getopt(argc, argv, "vVsSbaI")) != -1) {
|
||||
switch (c) {
|
||||
case 'v':
|
||||
pvoltag = 1;
|
||||
@@ -656,7 +687,7 @@ do_status(char *cname, int argc, char **argv)
|
||||
printf(" avoltag: <%s:%d>",
|
||||
ces->ces_avoltag.cv_volid,
|
||||
ces->ces_avoltag.cv_serial);
|
||||
if (source)
|
||||
if (source) {
|
||||
if (ces->ces_flags & CES_SOURCE_VALID)
|
||||
printf(" source: <%s %d>",
|
||||
element_type_name(
|
||||
@@ -664,6 +695,7 @@ do_status(char *cname, int argc, char **argv)
|
||||
ces->ces_source_addr);
|
||||
else
|
||||
printf(" source: <>");
|
||||
}
|
||||
if (intaddr)
|
||||
printf(" intaddr: <%d>", ces->ces_int_addr);
|
||||
if (scsi) {
|
||||
@@ -695,7 +727,10 @@ do_status(char *cname, int argc, char **argv)
|
||||
}
|
||||
|
||||
static int
|
||||
do_ielem(char *cname, int argc, char **argv)
|
||||
do_ielem(cname, argc, argv)
|
||||
char *cname;
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
int timeout = 0;
|
||||
|
||||
@@ -718,7 +753,10 @@ do_ielem(char *cname, int argc, char **argv)
|
||||
}
|
||||
|
||||
static int
|
||||
do_voltag(char *cname, int argc, char **argv)
|
||||
do_voltag(cname, argc, argv)
|
||||
char *cname;
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
int force = 0;
|
||||
int clear = 0;
|
||||
@@ -729,7 +767,7 @@ do_voltag(char *cname, int argc, char **argv)
|
||||
bzero(&csvr, sizeof(csvr));
|
||||
|
||||
optind = optreset = 1;
|
||||
while ((c = getopt(argc, argv, "fca")) != EOF) {
|
||||
while ((c = getopt(argc, argv, "fca")) != -1) {
|
||||
switch (c) {
|
||||
case 'f':
|
||||
force = 1;
|
||||
@@ -803,7 +841,8 @@ do_voltag(char *cname, int argc, char **argv)
|
||||
}
|
||||
|
||||
static int
|
||||
parse_element_type(char *cp)
|
||||
parse_element_type(cp)
|
||||
char *cp;
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -816,7 +855,8 @@ parse_element_type(char *cp)
|
||||
}
|
||||
|
||||
static const char *
|
||||
element_type_name(int et)
|
||||
element_type_name(et)
|
||||
int et;
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -828,7 +868,8 @@ element_type_name(int et)
|
||||
}
|
||||
|
||||
static int
|
||||
parse_element_unit(char *cp)
|
||||
parse_element_unit(cp)
|
||||
char *cp;
|
||||
{
|
||||
int i;
|
||||
char *p;
|
||||
@@ -841,7 +882,8 @@ parse_element_unit(char *cp)
|
||||
}
|
||||
|
||||
static int
|
||||
parse_special(char *cp)
|
||||
parse_special(cp)
|
||||
char *cp;
|
||||
{
|
||||
int val;
|
||||
|
||||
@@ -854,7 +896,8 @@ parse_special(char *cp)
|
||||
}
|
||||
|
||||
static int
|
||||
is_special(char *cp)
|
||||
is_special(cp)
|
||||
char *cp;
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -865,8 +908,10 @@ is_special(char *cp)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static char *
|
||||
bits_to_string(int v, const char *cp)
|
||||
static const char *
|
||||
bits_to_string(v, cp)
|
||||
int v;
|
||||
const char *cp;
|
||||
{
|
||||
const char *np;
|
||||
char f, sep, *bp;
|
||||
@@ -880,7 +925,9 @@ bits_to_string(int v, const char *cp)
|
||||
np++;
|
||||
if ((v & (1 << (f - 1))) == 0)
|
||||
continue;
|
||||
bp += sprintf(bp, "%c%.*s", sep, (int)(long)(np - cp), cp);
|
||||
(void) snprintf(bp, sizeof(buf) - (bp - &buf[0]),
|
||||
"%c%.*s", sep, (int)(long)(np - cp), cp);
|
||||
bp += strlen(bp);
|
||||
sep = ',';
|
||||
}
|
||||
if (sep != '<')
|
||||
@@ -899,11 +946,7 @@ cleanup()
|
||||
static void
|
||||
usage()
|
||||
{
|
||||
|
||||
(void) fprintf(stderr, "usage: %s command arg1 arg2 ...\n", __progname);
|
||||
(void) fprintf(stderr, "Examples:\n");
|
||||
(void) fprintf(stderr, "\tchio -f /dev/ch0 move slot 1 drive 0\n");
|
||||
(void) fprintf(stderr, "\tchio ielem\n");
|
||||
(void) fprintf(stderr, "\tchio -f /dev/ch1 status\n");
|
||||
(void) fprintf(stderr, "usage: %s [-f changer] command [-<flags>] "
|
||||
"arg1 arg2 [arg3 [...]]\n", __progname);
|
||||
exit(1);
|
||||
}
|
||||
+10
-2
@@ -48,7 +48,7 @@
|
||||
.Op Fl H | Fl L | Fl P
|
||||
.Oc
|
||||
.Op Fl f | i
|
||||
.Op Fl p
|
||||
.Op Fl pv
|
||||
.Ar source_file target_file
|
||||
.Nm cp
|
||||
.Oo
|
||||
@@ -56,7 +56,7 @@
|
||||
.Op Fl H | Fl L | Fl P
|
||||
.Oc
|
||||
.Op Fl f | i
|
||||
.Op Fl p
|
||||
.Op Fl pv
|
||||
.Ar source_file ... target_directory
|
||||
.Sh DESCRIPTION
|
||||
In the first synopsis form, the
|
||||
@@ -145,6 +145,10 @@ If the source file has both its set user ID and set group ID bits on,
|
||||
and either the user ID or group ID cannot be preserved, neither
|
||||
the set user ID nor set group ID bits are preserved in the copy's
|
||||
permissions.
|
||||
.It Fl v
|
||||
Cause
|
||||
.Nm
|
||||
to be verbose, showing files as they are copied.
|
||||
.El
|
||||
.Pp
|
||||
For each destination file that already exists, its contents are
|
||||
@@ -210,6 +214,10 @@ option.
|
||||
This implementation supports that option, however, its use is strongly
|
||||
discouraged, as it does not correctly copy special files, symbolic links
|
||||
or fifo's.
|
||||
.Pp
|
||||
The
|
||||
.Fl v
|
||||
option is non-standard and its use in scripts is not recommended.
|
||||
.Sh SEE ALSO
|
||||
.Xr mv 1 ,
|
||||
.Xr rcp 1 ,
|
||||
|
||||
+26
-19
@@ -69,6 +69,7 @@ static const char rcsid[] =
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <fts.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
@@ -79,10 +80,10 @@ static const char rcsid[] =
|
||||
*--(p).p_end = 0; \
|
||||
}
|
||||
|
||||
PATH_T to = { to.p_path, "" };
|
||||
PATH_T to = { to.p_path, "", "" };
|
||||
|
||||
uid_t myuid;
|
||||
int Rflag, iflag, pflag, rflag, fflag;
|
||||
int Rflag, iflag, pflag, rflag, fflag, vflag;
|
||||
int myumask;
|
||||
|
||||
enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE };
|
||||
@@ -101,7 +102,7 @@ main(argc, argv)
|
||||
char *target;
|
||||
|
||||
Hflag = Lflag = Pflag = 0;
|
||||
while ((ch = getopt(argc, argv, "HLPRfipr")) != -1)
|
||||
while ((ch = getopt(argc, argv, "HLPRfiprv")) != -1)
|
||||
switch (ch) {
|
||||
case 'H':
|
||||
Hflag = 1;
|
||||
@@ -132,6 +133,9 @@ main(argc, argv)
|
||||
case 'r':
|
||||
rflag = 1;
|
||||
break;
|
||||
case 'v':
|
||||
vflag = 1;
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
break;
|
||||
@@ -249,23 +253,23 @@ copy(argv, type, fts_options)
|
||||
struct stat to_stat;
|
||||
FTS *ftsp;
|
||||
FTSENT *curr;
|
||||
int base = 0, dne, nlen, rval;
|
||||
int base = 0, dne, badcp, nlen, rval;
|
||||
char *p, *target_mid;
|
||||
|
||||
if ((ftsp = fts_open(argv, fts_options, mastercmp)) == NULL)
|
||||
err(1, NULL);
|
||||
for (rval = 0; (curr = fts_read(ftsp)) != NULL;) {
|
||||
for (badcp = rval = 0; (curr = fts_read(ftsp)) != NULL; badcp = 0) {
|
||||
switch (curr->fts_info) {
|
||||
case FTS_NS:
|
||||
case FTS_DNR:
|
||||
case FTS_ERR:
|
||||
warnx("%s: %s",
|
||||
curr->fts_path, strerror(curr->fts_errno));
|
||||
rval = 1;
|
||||
badcp = rval = 1;
|
||||
continue;
|
||||
case FTS_DC: /* Warn, continue. */
|
||||
warnx("%s: directory causes a cycle", curr->fts_path);
|
||||
rval = 1;
|
||||
badcp = rval = 1;
|
||||
continue;
|
||||
case FTS_DP: /* Ignore, continue. */
|
||||
continue;
|
||||
@@ -295,7 +299,7 @@ copy(argv, type, fts_options)
|
||||
* Since the first level MUST be FTS_ROOTLEVEL, base
|
||||
* is always initialized.
|
||||
*/
|
||||
if (curr->fts_level == FTS_ROOTLEVEL)
|
||||
if (curr->fts_level == FTS_ROOTLEVEL) {
|
||||
if (type != DIR_TO_DNE) {
|
||||
p = strrchr(curr->fts_path, '/');
|
||||
base = (p == NULL) ? 0 :
|
||||
@@ -306,6 +310,7 @@ copy(argv, type, fts_options)
|
||||
base += 1;
|
||||
} else
|
||||
base = curr->fts_pathlen;
|
||||
}
|
||||
|
||||
p = &curr->fts_path[base];
|
||||
nlen = curr->fts_pathlen - base;
|
||||
@@ -316,7 +321,7 @@ copy(argv, type, fts_options)
|
||||
if (target_mid - to.p_path + nlen > MAXPATHLEN) {
|
||||
warnx("%s%s: name too long (not copied)",
|
||||
to.p_path, p);
|
||||
rval = 1;
|
||||
badcp = rval = 1;
|
||||
continue;
|
||||
}
|
||||
(void)strncat(target_mid, p, nlen);
|
||||
@@ -333,7 +338,7 @@ copy(argv, type, fts_options)
|
||||
to_stat.st_ino == curr->fts_statp->st_ino) {
|
||||
warnx("%s and %s are identical (not copied).",
|
||||
to.p_path, curr->fts_path);
|
||||
rval = 1;
|
||||
badcp = rval = 1;
|
||||
if (S_ISDIR(curr->fts_statp->st_mode))
|
||||
(void)fts_set(ftsp, curr, FTS_SKIP);
|
||||
continue;
|
||||
@@ -342,7 +347,7 @@ copy(argv, type, fts_options)
|
||||
S_ISDIR(to_stat.st_mode)) {
|
||||
warnx("cannot overwrite directory %s with non-directory %s",
|
||||
to.p_path, curr->fts_path);
|
||||
rval = 1;
|
||||
badcp = rval = 1;
|
||||
continue;
|
||||
}
|
||||
dne = 0;
|
||||
@@ -351,14 +356,14 @@ copy(argv, type, fts_options)
|
||||
switch (curr->fts_statp->st_mode & S_IFMT) {
|
||||
case S_IFLNK:
|
||||
if (copy_link(curr, !dne))
|
||||
rval = 1;
|
||||
badcp = rval = 1;
|
||||
break;
|
||||
case S_IFDIR:
|
||||
if (!Rflag && !rflag) {
|
||||
warnx("%s is a directory (not copied).",
|
||||
curr->fts_path);
|
||||
(void)fts_set(ftsp, curr, FTS_SKIP);
|
||||
rval = 1;
|
||||
badcp = rval = 1;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
@@ -384,7 +389,7 @@ copy(argv, type, fts_options)
|
||||
* forever.
|
||||
*/
|
||||
if (pflag && setfile(curr->fts_statp, 0))
|
||||
rval = 1;
|
||||
badcp = rval = 1;
|
||||
else if (dne)
|
||||
(void)chmod(to.p_path,
|
||||
curr->fts_statp->st_mode);
|
||||
@@ -393,26 +398,28 @@ copy(argv, type, fts_options)
|
||||
case S_IFCHR:
|
||||
if (Rflag) {
|
||||
if (copy_special(curr->fts_statp, !dne))
|
||||
rval = 1;
|
||||
badcp = rval = 1;
|
||||
} else {
|
||||
if (copy_file(curr, dne))
|
||||
rval = 1;
|
||||
badcp = rval = 1;
|
||||
}
|
||||
break;
|
||||
case S_IFIFO:
|
||||
if (Rflag) {
|
||||
if (copy_fifo(curr->fts_statp, !dne))
|
||||
rval = 1;
|
||||
badcp = rval = 1;
|
||||
} else {
|
||||
if (copy_file(curr, dne))
|
||||
rval = 1;
|
||||
badcp = rval = 1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (copy_file(curr, dne))
|
||||
rval = 1;
|
||||
badcp = rval = 1;
|
||||
break;
|
||||
}
|
||||
if (vflag && !badcp)
|
||||
(void)printf("%s -> %s\n", curr->fts_path, to.p_path);
|
||||
}
|
||||
if (errno)
|
||||
err(1, "fts_read");
|
||||
|
||||
+7
-4
@@ -50,6 +50,7 @@ static const char rcsid[] =
|
||||
#include <fcntl.h>
|
||||
#include <fts.h>
|
||||
#include <stdio.h>
|
||||
#include <sysexits.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "extern.h"
|
||||
@@ -183,7 +184,7 @@ copy_file(entp, dne)
|
||||
*/
|
||||
#define RETAINBITS \
|
||||
(S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO)
|
||||
else if (fs->st_mode & (S_ISUID | S_ISGID) && fs->st_uid == myuid)
|
||||
else if (fs->st_mode & (S_ISUID | S_ISGID) && fs->st_uid == myuid) {
|
||||
if (fstat(to_fd, &to_stat)) {
|
||||
warn("%s", to.p_path);
|
||||
rval = 1;
|
||||
@@ -192,6 +193,7 @@ copy_file(entp, dne)
|
||||
warn("%s", to.p_path);
|
||||
rval = 1;
|
||||
}
|
||||
}
|
||||
(void)close(from_fd);
|
||||
if (close(to_fd)) {
|
||||
warn("%s", to.p_path);
|
||||
@@ -319,8 +321,9 @@ setfile(fs, fd)
|
||||
void
|
||||
usage()
|
||||
{
|
||||
|
||||
(void)fprintf(stderr, "%s\n%s\n",
|
||||
"usage: cp [-R [-H | -L | -P]] [-f | -i] [-p] src target",
|
||||
" cp [-R [-H | -L | -P]] [-f | -i] [-p] src1 ... srcN directory");
|
||||
exit(1);
|
||||
"usage: cp [-R [-H | -L | -P]] [-f | -i] [-pv] src target",
|
||||
" cp [-R [-H | -L | -P]] [-f | -i] [-pv] src1 ... srcN directory");
|
||||
exit(EX_USAGE);
|
||||
}
|
||||
+4
-4
@@ -15,10 +15,10 @@ SRCS= alloc.c char.c const.c csh.c dir.c dol.c err.c exec.c exp.c file.c \
|
||||
.PATH: ${.CURDIR}/../../usr.bin/printf
|
||||
|
||||
MAN1= csh.1
|
||||
MLINKS= csh.1 limit.1 csh.1 alias.1 csh.1 bg.1 csh.1 dirs.1 csh.1 fg.1 \
|
||||
csh.1 foreach.1 csh.1 history.1 csh.1 jobs.1 csh.1 popd.1 \
|
||||
csh.1 pushd.1 csh.1 rehash.1 csh.1 repeat.1 csh.1 suspend.1 \
|
||||
csh.1 stop.1 csh.1 source.1
|
||||
# MLINKS for Shell built in commands for which there are no userland
|
||||
# utilities of the same name are handled with the associated manpage,
|
||||
# builtin.1 in share/man/man1/.
|
||||
|
||||
CLEANFILES+=const.h errnum.h
|
||||
|
||||
const.h: errnum.h
|
||||
|
||||
+27
-12
@@ -55,8 +55,9 @@ job control facilities (see
|
||||
interactive file name
|
||||
and user name completion (see
|
||||
.Sx File Name Completion ) ,
|
||||
and a C-like syntax. It is used both as an interactive
|
||||
login shell and a shell script command processor.
|
||||
and a C-like syntax.
|
||||
It is used both as an interactive login shell and
|
||||
a shell script command processor.
|
||||
.Ss Argument list processing
|
||||
If the first argument (argument 0) to the shell is
|
||||
.Ql Fl \& ,
|
||||
@@ -236,8 +237,9 @@ may be a component of a pipeline, etc.).
|
||||
It is also possible to separate pipelines with `\&|\&|' or `&&' showing,
|
||||
as in the C language,
|
||||
that the second is to be executed only if the first fails or succeeds
|
||||
respectively. (See
|
||||
.Em Expressions . )
|
||||
respectively.
|
||||
See
|
||||
.Sx Expressions .
|
||||
.Ss Jobs
|
||||
The shell associates a
|
||||
.Ar job
|
||||
@@ -317,12 +319,15 @@ The job control mechanism requires that the
|
||||
.Xr stty 1
|
||||
option
|
||||
.Ic new
|
||||
be set. It is an artifact from a
|
||||
be set.
|
||||
It is an artifact from a
|
||||
.Em new
|
||||
implementation
|
||||
of the
|
||||
tty driver that allows generation of interrupt characters from
|
||||
the keyboard to tell jobs to stop. See stty(1) for details
|
||||
the keyboard to tell jobs to stop. See
|
||||
.Xr stty 1
|
||||
for details
|
||||
on setting options in the new tty driver.
|
||||
.Ss Status reporting
|
||||
This shell learns immediately whenever a process changes state.
|
||||
@@ -566,8 +571,8 @@ Repeat the previous substitution.
|
||||
Apply the change once on each word, prefixing the above, e.g., `g&'.
|
||||
.It a
|
||||
Apply the change as many times as possible on a single word, prefixing
|
||||
the above. It can be used together with `g' to apply a substitution
|
||||
globally.
|
||||
the above.
|
||||
It can be used together with `g' to apply a substitution globally.
|
||||
.It p
|
||||
Print the new command line but do not execute it.
|
||||
.It q
|
||||
@@ -1487,7 +1492,7 @@ entry in the stack.
|
||||
The members of the directory stack are numbered from the top starting at 0.
|
||||
.Pp
|
||||
.It Ic printf Ar format-string values
|
||||
Invokes a built-in version of
|
||||
Invokes a builtin version of
|
||||
.Ic printf
|
||||
after evaluating the
|
||||
.Ar format-string
|
||||
@@ -2134,9 +2139,18 @@ To detect looping, the shell restricts the number of
|
||||
.Ic alias
|
||||
substitutions on a single line to 20.
|
||||
.Sh SEE ALSO
|
||||
.Xr builtin 1 ,
|
||||
.Xr echo 1 ,
|
||||
.Xr kill 1 ,
|
||||
.Xr login 1 ,
|
||||
.Xr nice 1 ,
|
||||
.Xr nohup 1 ,
|
||||
.Xr printenv 1 ,
|
||||
.Xr printf 1 ,
|
||||
.Xr sh 1 ,
|
||||
.Xr su 1 ,
|
||||
.Xr time 1 ,
|
||||
.Xr which 1 ,
|
||||
.Xr access 2 ,
|
||||
.Xr execve 2 ,
|
||||
.Xr fork 2 ,
|
||||
@@ -2149,8 +2163,9 @@ substitutions on a single line to 20.
|
||||
.Xr tty 4 ,
|
||||
.Xr a.out 5 ,
|
||||
.Xr environ 7
|
||||
.br
|
||||
.Em An introduction to the C shell
|
||||
.Rs
|
||||
.%T "An introduction to the C shell"
|
||||
.Re
|
||||
.Sh HISTORY
|
||||
.Nm Csh
|
||||
appeared in
|
||||
@@ -2194,7 +2209,7 @@ shell procedures should be provided instead of aliases.
|
||||
Commands within loops, prompted for by `?', are not placed on the
|
||||
.Ic history
|
||||
list.
|
||||
Control structure should be parsed instead of being recognized as built-in
|
||||
Control structure should be parsed instead of being recognized as builtin
|
||||
commands. This would allow control commands to be placed anywhere,
|
||||
to be combined with `\&|', and to be used with `&' and `;' metasyntax.
|
||||
.Pp
|
||||
|
||||
+4
-2
@@ -49,7 +49,7 @@
|
||||
.Op Fl t Ar minutes_west
|
||||
.Op Fl v Ns Ar [+|-]val Ns Op ymwdHMS
|
||||
.Ar ...
|
||||
.Op Fl f Ar fmt Ar date | [[[[yy]mm]dd]HH]MM[\&.ss]
|
||||
.Op Fl f Ar fmt Ar date | [[[[[cc]yy]mm]dd]HH]MM[\&.ss]
|
||||
.Op Cm + Ns Ar format
|
||||
.Sh DESCRIPTION
|
||||
.Nm Date
|
||||
@@ -74,7 +74,7 @@ Use
|
||||
.Ar fmt
|
||||
as the format string to parse the date provided rather than using
|
||||
the default
|
||||
.Ar [[[[yy]mm]dd]HH]MM[.ss]
|
||||
.Ar [[[[[cc]yy]mm]dd]HH]MM[.ss]
|
||||
format. Parsing is done using
|
||||
.Xr strptime 3 .
|
||||
.It Fl n
|
||||
@@ -162,6 +162,8 @@ a value for setting the system's notion of the current date and time.
|
||||
The canonical representation for setting the date and time is:
|
||||
.Pp
|
||||
.Bl -tag -width Ds -compact -offset indent
|
||||
.It Ar cc
|
||||
Century (either 19 or 20) prepended to the abbreviated year.
|
||||
.It Ar yy
|
||||
Year in abbreviated form (e.g. 89 for 1989, 06 for 2006).
|
||||
.It Ar mm
|
||||
|
||||
+10
-2
@@ -170,6 +170,8 @@ main(argc, argv)
|
||||
}
|
||||
|
||||
#define ATOI2(ar) ((ar)[0] - '0') * 10 + ((ar)[1] - '0'); (ar) += 2;
|
||||
#define ATOI4(ar) ((ar)[0] - '0') * 1000 + ((ar)[1] - '0') * 100 + \
|
||||
((ar)[2] - '0') * 10 + ((ar)[3] - '0'); (ar) += 4;
|
||||
void
|
||||
setthetime(fmt, p)
|
||||
const char *fmt;
|
||||
@@ -215,11 +217,16 @@ setthetime(fmt, p)
|
||||
|
||||
/* if p has a ".ss" field then let's pretend it's not there */
|
||||
switch (strlen(p) - ((dot != NULL) ? 3 : 0)) {
|
||||
case 12: /* cc */
|
||||
lt->tm_year = -1900 + ATOI4(p);
|
||||
if (lt->tm_year < 0)
|
||||
badformat();
|
||||
goto year_done;
|
||||
case 10: /* yy */
|
||||
lt->tm_year = ATOI2(p);
|
||||
if (lt->tm_year < 69) /* hack for 2000 ;-} */
|
||||
lt->tm_year += 100;
|
||||
/* FALLTHROUGH */
|
||||
year_done: /* FALLTHROUGH */
|
||||
case 8: /* mm */
|
||||
lt->tm_mon = ATOI2(p);
|
||||
if (lt->tm_mon > 12)
|
||||
@@ -278,6 +285,7 @@ usage()
|
||||
(void)fprintf(stderr, "%s\n%s\n",
|
||||
"usage: date [-nu] [-d dst] [-r seconds] [-t west] "
|
||||
"[-v[+|-]val[ymwdHMS]] ... ",
|
||||
" [-f fmt date | [[[[yy]mm]dd]HH]MM[.ss]] [+format]");
|
||||
" "
|
||||
"[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]");
|
||||
exit(1);
|
||||
}
|
||||
@@ -4,4 +4,6 @@
|
||||
PROG= dd
|
||||
SRCS= args.c conv.c conv_tab.c dd.c misc.c position.c
|
||||
|
||||
MAINTAINER= [email protected]
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
+96
-57
@@ -67,10 +67,11 @@ static void f_obs __P((char *));
|
||||
static void f_of __P((char *));
|
||||
static void f_seek __P((char *));
|
||||
static void f_skip __P((char *));
|
||||
static u_long get_bsz __P((char *));
|
||||
static quad_t get_num __P((char *));
|
||||
static off_t get_offset __P((char *));
|
||||
|
||||
static struct arg {
|
||||
char *name;
|
||||
static const struct arg {
|
||||
const char *name;
|
||||
void (*f) __P((char *));
|
||||
u_int set, noset;
|
||||
} args[] = {
|
||||
@@ -141,14 +142,14 @@ jcl(argv)
|
||||
* Ascii/ebcdic and cbs implies block/unblock.
|
||||
* Block/unblock requires cbs and vice-versa.
|
||||
*/
|
||||
if (ddflags & (C_BLOCK|C_UNBLOCK)) {
|
||||
if (ddflags & (C_BLOCK | C_UNBLOCK)) {
|
||||
if (!(ddflags & C_CBS))
|
||||
errx(1, "record operations require cbs");
|
||||
if (cbsz == 0)
|
||||
errx(1, "cbs cannot be zero");
|
||||
cfunc = ddflags & C_BLOCK ? block : unblock;
|
||||
} else if (ddflags & C_CBS) {
|
||||
if (ddflags & (C_ASCII|C_EBCDIC)) {
|
||||
if (ddflags & (C_ASCII | C_EBCDIC)) {
|
||||
if (ddflags & C_ASCII) {
|
||||
ddflags |= C_UNBLOCK;
|
||||
cfunc = unblock;
|
||||
@@ -158,23 +159,14 @@ jcl(argv)
|
||||
}
|
||||
} else
|
||||
errx(1, "cbs meaningless if not doing record operations");
|
||||
if (cbsz == 0)
|
||||
errx(1, "cbs cannot be zero");
|
||||
} else
|
||||
cfunc = def;
|
||||
|
||||
if (in.dbsz == 0 || out.dbsz == 0)
|
||||
errx(1, "buffer sizes cannot be zero");
|
||||
|
||||
/*
|
||||
* Read, write and seek calls take ints as arguments. Seek sizes
|
||||
* could be larger if we wanted to do it in stages or check only
|
||||
* regular files, but it's probably not worth it.
|
||||
* Bail out if the calculation of a file offset would overflow.
|
||||
*/
|
||||
if (in.dbsz > INT_MAX || out.dbsz > INT_MAX)
|
||||
errx(1, "buffer sizes cannot be greater than %d", INT_MAX);
|
||||
if (in.offset > INT_MAX / in.dbsz || out.offset > INT_MAX / out.dbsz)
|
||||
errx(1, "seek offsets cannot be larger than %d", INT_MAX);
|
||||
if (in.offset > QUAD_MAX / in.dbsz || out.offset > QUAD_MAX / out.dbsz)
|
||||
errx(1, "seek offsets cannot be larger than %qd", QUAD_MAX);
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -182,23 +174,32 @@ c_arg(a, b)
|
||||
const void *a, *b;
|
||||
{
|
||||
|
||||
return (strcmp(((struct arg *)a)->name, ((struct arg *)b)->name));
|
||||
return (strcmp(((const struct arg *)a)->name,
|
||||
((const struct arg *)b)->name));
|
||||
}
|
||||
|
||||
static void
|
||||
f_bs(arg)
|
||||
char *arg;
|
||||
{
|
||||
quad_t res;
|
||||
|
||||
in.dbsz = out.dbsz = (int)get_bsz(arg);
|
||||
res = get_num(arg);
|
||||
if (res < 1 || res > SSIZE_MAX)
|
||||
errx(1, "bs must be between 1 and %d", SSIZE_MAX);
|
||||
in.dbsz = out.dbsz = (size_t)res;
|
||||
}
|
||||
|
||||
static void
|
||||
f_cbs(arg)
|
||||
char *arg;
|
||||
{
|
||||
quad_t res;
|
||||
|
||||
cbsz = (int)get_bsz(arg);
|
||||
res = get_num(arg);
|
||||
if (res < 1 || res > SSIZE_MAX)
|
||||
errx(1, "cbs must be between 1 and %d", SSIZE_MAX);
|
||||
cbsz = (size_t)res;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -206,9 +207,11 @@ f_count(arg)
|
||||
char *arg;
|
||||
{
|
||||
|
||||
cpy_cnt = (u_int)get_bsz(arg);
|
||||
if (!cpy_cnt)
|
||||
terminate(0);
|
||||
cpy_cnt = get_num(arg);
|
||||
if (cpy_cnt < 0)
|
||||
errx(1, "count cannot be negative");
|
||||
if (cpy_cnt == 0)
|
||||
cpy_cnt = -1;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -216,16 +219,23 @@ f_files(arg)
|
||||
char *arg;
|
||||
{
|
||||
|
||||
files_cnt = (int)get_bsz(arg);
|
||||
files_cnt = get_num(arg);
|
||||
if (files_cnt < 1)
|
||||
errx(1, "files must be between 1 and %qd", QUAD_MAX);
|
||||
}
|
||||
|
||||
static void
|
||||
f_ibs(arg)
|
||||
char *arg;
|
||||
{
|
||||
quad_t res;
|
||||
|
||||
if (!(ddflags & C_BS))
|
||||
in.dbsz = (int)get_bsz(arg);
|
||||
if (!(ddflags & C_BS)) {
|
||||
res = get_num(arg);
|
||||
if (res < 1 || res > SSIZE_MAX)
|
||||
errx(1, "ibs must be between 1 and %d", SSIZE_MAX);
|
||||
in.dbsz = (size_t)res;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -240,9 +250,14 @@ static void
|
||||
f_obs(arg)
|
||||
char *arg;
|
||||
{
|
||||
quad_t res;
|
||||
|
||||
if (!(ddflags & C_BS))
|
||||
out.dbsz = (int)get_bsz(arg);
|
||||
if (!(ddflags & C_BS)) {
|
||||
res = get_num(arg);
|
||||
if (res < 1 || res > SSIZE_MAX)
|
||||
errx(1, "obs must be between 1 and %d", SSIZE_MAX);
|
||||
out.dbsz = (size_t)res;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -258,7 +273,7 @@ f_seek(arg)
|
||||
char *arg;
|
||||
{
|
||||
|
||||
out.offset = (u_int)get_bsz(arg);
|
||||
out.offset = get_offset(arg);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -266,13 +281,13 @@ f_skip(arg)
|
||||
char *arg;
|
||||
{
|
||||
|
||||
in.offset = (u_int)get_bsz(arg);
|
||||
in.offset = get_offset(arg);
|
||||
}
|
||||
|
||||
static struct conv {
|
||||
char *name;
|
||||
static const struct conv {
|
||||
const char *name;
|
||||
u_int set, noset;
|
||||
u_char *ctab;
|
||||
const u_char *ctab;
|
||||
} clist[] = {
|
||||
{ "ascii", C_ASCII, C_EBCDIC, e2a_POSIX },
|
||||
{ "block", C_BLOCK, C_UNBLOCK, NULL },
|
||||
@@ -300,9 +315,9 @@ f_conv(arg)
|
||||
|
||||
while (arg != NULL) {
|
||||
tmp.name = strsep(&arg, ",");
|
||||
if (!(cp = (struct conv *)bsearch(&tmp, clist,
|
||||
sizeof(clist)/sizeof(struct conv), sizeof(struct conv),
|
||||
c_conv)))
|
||||
cp = bsearch(&tmp, clist, sizeof(clist) / sizeof(struct conv),
|
||||
sizeof(struct conv), c_conv);
|
||||
if (cp == NULL)
|
||||
errx(1, "unknown conversion %s", tmp.name);
|
||||
if (ddflags & cp->noset)
|
||||
errx(1, "%s: illegal conversion combination", tmp.name);
|
||||
@@ -317,34 +332,38 @@ c_conv(a, b)
|
||||
const void *a, *b;
|
||||
{
|
||||
|
||||
return (strcmp(((struct conv *)a)->name, ((struct conv *)b)->name));
|
||||
return (strcmp(((const struct conv *)a)->name,
|
||||
((const struct conv *)b)->name));
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert an expression of the following forms to an unsigned long.
|
||||
* Convert an expression of the following forms to a quad_t.
|
||||
* 1) A positive decimal number.
|
||||
* 2) A positive decimal number followed by a b (mult by 512).
|
||||
* 3) A positive decimal number followed by a k (mult by 1024).
|
||||
* 4) A positive decimal number followed by a m (mult by 512).
|
||||
* 5) A positive decimal number followed by a w (mult by sizeof int)
|
||||
* 6) Two or more positive decimal numbers (with/without k,b or w).
|
||||
* 2) A positive decimal number followed by a b (mult by 512.)
|
||||
* 3) A positive decimal number followed by a k (mult by 1 << 10.)
|
||||
* 4) A positive decimal number followed by a m (mult by 1 << 20.)
|
||||
* 5) A positive decimal number followed by a g (mult by 1 << 30.)
|
||||
* 5) A positive decimal number followed by a w (mult by sizeof int.)
|
||||
* 6) Two or more positive decimal numbers (with/without [bkmgw])
|
||||
* separated by x (also * for backwards compatibility), specifying
|
||||
* the product of the indicated values.
|
||||
*/
|
||||
static u_long
|
||||
get_bsz(val)
|
||||
static quad_t
|
||||
get_num(val)
|
||||
char *val;
|
||||
{
|
||||
u_long num, t;
|
||||
quad_t num, t;
|
||||
char *expr;
|
||||
|
||||
num = strtoul(val, &expr, 0);
|
||||
if (num == ULONG_MAX) /* Overflow. */
|
||||
errno = 0;
|
||||
num = strtoq(val, &expr, 0);
|
||||
if (errno != 0) /* Overflow or underflow. */
|
||||
err(1, "%s", oper);
|
||||
if (expr == val) /* No digits. */
|
||||
|
||||
if (expr == val) /* No valid digits. */
|
||||
errx(1, "%s: illegal numeric value", oper);
|
||||
|
||||
switch(*expr) {
|
||||
switch (*expr) {
|
||||
case 'b':
|
||||
t = num;
|
||||
num *= 512;
|
||||
@@ -354,14 +373,21 @@ get_bsz(val)
|
||||
break;
|
||||
case 'k':
|
||||
t = num;
|
||||
num *= 1024;
|
||||
num *= 1 << 10;
|
||||
if (t > num)
|
||||
goto erange;
|
||||
++expr;
|
||||
break;
|
||||
case 'm':
|
||||
t = num;
|
||||
num *= 1048576;
|
||||
num *= 1 << 20;
|
||||
if (t > num)
|
||||
goto erange;
|
||||
++expr;
|
||||
break;
|
||||
case 'g':
|
||||
t = num;
|
||||
num *= 1 << 30;
|
||||
if (t > num)
|
||||
goto erange;
|
||||
++expr;
|
||||
@@ -375,18 +401,31 @@ get_bsz(val)
|
||||
break;
|
||||
}
|
||||
|
||||
switch(*expr) {
|
||||
switch (*expr) {
|
||||
case '\0':
|
||||
break;
|
||||
case '*': /* Backward compatible. */
|
||||
case 'x':
|
||||
t = num;
|
||||
num *= get_bsz(expr + 1);
|
||||
if (t > num)
|
||||
erange: errx(1, "%s: %s", oper, strerror(ERANGE));
|
||||
break;
|
||||
num *= get_num(expr + 1);
|
||||
if (t <= num)
|
||||
break;
|
||||
erange:
|
||||
errx(1, "%s: %s", oper, strerror(ERANGE));
|
||||
default:
|
||||
errx(1, "%s: illegal numeric value", oper);
|
||||
}
|
||||
return (num);
|
||||
}
|
||||
|
||||
static off_t
|
||||
get_offset(val)
|
||||
char *val;
|
||||
{
|
||||
quad_t num;
|
||||
|
||||
num = get_num(val);
|
||||
if (num > QUAD_MAX || num < 0) /* XXX quad_t != off_t */
|
||||
errx(1, "%s: illegal offset", oper); /* Too big/negative. */
|
||||
return ((off_t)num);
|
||||
}
|
||||
+29
-24
@@ -60,8 +60,9 @@ static const char rcsid[] =
|
||||
void
|
||||
def()
|
||||
{
|
||||
int cnt;
|
||||
u_char *inp, *t;
|
||||
u_char *inp;
|
||||
const u_char *t;
|
||||
size_t cnt;
|
||||
|
||||
if ((t = ctab) != NULL)
|
||||
for (inp = in.dbp - (cnt = in.dbrcnt); cnt--; ++inp)
|
||||
@@ -103,9 +104,11 @@ def_close()
|
||||
void
|
||||
block()
|
||||
{
|
||||
u_char *inp, *outp;
|
||||
const u_char *t;
|
||||
size_t cnt, maxlen;
|
||||
static int intrunc;
|
||||
int ch, cnt, maxlen;
|
||||
u_char *inp, *outp, *t;
|
||||
int ch;
|
||||
|
||||
/*
|
||||
* Record truncation can cross block boundaries. If currently in a
|
||||
@@ -114,8 +117,8 @@ block()
|
||||
* left empty.
|
||||
*/
|
||||
if (intrunc) {
|
||||
for (inp = in.db, cnt = in.dbrcnt;
|
||||
cnt && *inp++ != '\n'; --cnt);
|
||||
for (inp = in.db, cnt = in.dbrcnt; cnt && *inp++ != '\n'; --cnt)
|
||||
;
|
||||
if (!cnt) {
|
||||
in.dbcnt = 0;
|
||||
in.dbp = in.db;
|
||||
@@ -135,19 +138,19 @@ block()
|
||||
for (inp = in.dbp - in.dbcnt, outp = out.dbp; in.dbcnt;) {
|
||||
maxlen = MIN(cbsz, in.dbcnt);
|
||||
if ((t = ctab) != NULL)
|
||||
for (cnt = 0;
|
||||
cnt < maxlen && (ch = *inp++) != '\n'; ++cnt)
|
||||
for (cnt = 0; cnt < maxlen && (ch = *inp++) != '\n';
|
||||
++cnt)
|
||||
*outp++ = t[ch];
|
||||
else
|
||||
for (cnt = 0;
|
||||
cnt < maxlen && (ch = *inp++) != '\n'; ++cnt)
|
||||
for (cnt = 0; cnt < maxlen && (ch = *inp++) != '\n';
|
||||
++cnt)
|
||||
*outp++ = ch;
|
||||
/*
|
||||
* Check for short record without a newline. Reassemble the
|
||||
* input block.
|
||||
*/
|
||||
if (ch != '\n' && in.dbcnt < cbsz) {
|
||||
memmove(in.db, in.dbp - in.dbcnt, in.dbcnt);
|
||||
(void)memmove(in.db, in.dbp - in.dbcnt, in.dbcnt);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -197,9 +200,9 @@ block_close()
|
||||
*/
|
||||
if (in.dbcnt) {
|
||||
++st.trunc;
|
||||
memmove(out.dbp, in.dbp - in.dbcnt, in.dbcnt);
|
||||
(void)memset(out.dbp + in.dbcnt,
|
||||
ctab ? ctab[' '] : ' ', cbsz - in.dbcnt);
|
||||
(void)memmove(out.dbp, in.dbp - in.dbcnt, in.dbcnt);
|
||||
(void)memset(out.dbp + in.dbcnt, ctab ? ctab[' '] : ' ',
|
||||
cbsz - in.dbcnt);
|
||||
out.dbcnt += cbsz;
|
||||
}
|
||||
}
|
||||
@@ -214,8 +217,9 @@ block_close()
|
||||
void
|
||||
unblock()
|
||||
{
|
||||
int cnt;
|
||||
u_char *inp, *t;
|
||||
u_char *inp;
|
||||
const u_char *t;
|
||||
size_t cnt;
|
||||
|
||||
/* Translation and case conversion. */
|
||||
if ((t = ctab) != NULL)
|
||||
@@ -227,35 +231,36 @@ unblock()
|
||||
* spaces.
|
||||
*/
|
||||
for (inp = in.db; in.dbcnt >= cbsz; inp += cbsz, in.dbcnt -= cbsz) {
|
||||
for (t = inp + cbsz - 1; t >= inp && *t == ' '; --t);
|
||||
for (t = inp + cbsz - 1; t >= inp && *t == ' '; --t)
|
||||
;
|
||||
if (t >= inp) {
|
||||
cnt = t - inp + 1;
|
||||
memmove(out.dbp, inp, cnt);
|
||||
(void)memmove(out.dbp, inp, cnt);
|
||||
out.dbp += cnt;
|
||||
out.dbcnt += cnt;
|
||||
}
|
||||
++out.dbcnt;
|
||||
*out.dbp++ = '\n';
|
||||
if (out.dbcnt >= out.dbsz)
|
||||
if (++out.dbcnt >= out.dbsz)
|
||||
dd_out(0);
|
||||
}
|
||||
if (in.dbcnt)
|
||||
memmove(in.db, in.dbp - in.dbcnt, in.dbcnt);
|
||||
(void)memmove(in.db, in.dbp - in.dbcnt, in.dbcnt);
|
||||
in.dbp = in.db + in.dbcnt;
|
||||
}
|
||||
|
||||
void
|
||||
unblock_close()
|
||||
{
|
||||
int cnt;
|
||||
u_char *t;
|
||||
size_t cnt;
|
||||
|
||||
if (in.dbcnt) {
|
||||
warnx("%s: short input record", in.name);
|
||||
for (t = in.db + in.dbcnt - 1; t >= in.db && *t == ' '; --t);
|
||||
for (t = in.db + in.dbcnt - 1; t >= in.db && *t == ' '; --t)
|
||||
;
|
||||
if (t >= in.db) {
|
||||
cnt = t - in.db + 1;
|
||||
memmove(out.dbp, in.db, cnt);
|
||||
(void)memmove(out.dbp, in.db, cnt);
|
||||
out.dbp += cnt;
|
||||
out.dbcnt += cnt;
|
||||
}
|
||||
|
||||
+8
-15
@@ -46,10 +46,7 @@ static const char rcsid[] =
|
||||
#include <sys/types.h>
|
||||
|
||||
/*
|
||||
* There are currently eight tables:
|
||||
*
|
||||
* lower-case -> upper-case conv=upper
|
||||
* upper-case -> lower-case conv=lower
|
||||
* There are currently six tables:
|
||||
*
|
||||
* ebcdic -> ascii 32V conv=oldascii
|
||||
* ascii -> ebcdic 32V conv=oldebcdic
|
||||
@@ -72,14 +69,10 @@ static const char rcsid[] =
|
||||
* ACM, Volume 11, Number 11, November 1968, pp. 783-789.
|
||||
*/
|
||||
|
||||
/* Lower-case to upper-case */
|
||||
u_char l2u[256];
|
||||
|
||||
/* Upper-case to lower-case */
|
||||
u_char u2l[256];
|
||||
u_char casetab[256];
|
||||
|
||||
/* EBCDIC to ASCII -- 32V compatible. */
|
||||
u_char e2a_32V[] = {
|
||||
const u_char e2a_32V[] = {
|
||||
0000, 0001, 0002, 0003, 0234, 0011, 0206, 0177, /* 0000 */
|
||||
0227, 0215, 0216, 0013, 0014, 0015, 0016, 0017, /* 0010 */
|
||||
0020, 0021, 0022, 0023, 0235, 0205, 0010, 0207, /* 0020 */
|
||||
@@ -115,7 +108,7 @@ u_char e2a_32V[] = {
|
||||
};
|
||||
|
||||
/* ASCII to EBCDIC -- 32V compatible. */
|
||||
u_char a2e_32V[] = {
|
||||
const u_char a2e_32V[] = {
|
||||
0000, 0001, 0002, 0003, 0067, 0055, 0056, 0057, /* 0000 */
|
||||
0026, 0005, 0045, 0013, 0014, 0015, 0016, 0017, /* 0010 */
|
||||
0020, 0021, 0022, 0023, 0074, 0075, 0062, 0046, /* 0020 */
|
||||
@@ -151,7 +144,7 @@ u_char a2e_32V[] = {
|
||||
};
|
||||
|
||||
/* ASCII to IBM EBCDIC -- 32V compatible. */
|
||||
u_char a2ibm_32V[] = {
|
||||
const u_char a2ibm_32V[] = {
|
||||
0000, 0001, 0002, 0003, 0067, 0055, 0056, 0057, /* 0000 */
|
||||
0026, 0005, 0045, 0013, 0014, 0015, 0016, 0017, /* 0010 */
|
||||
0020, 0021, 0022, 0023, 0074, 0075, 0062, 0046, /* 0020 */
|
||||
@@ -187,7 +180,7 @@ u_char a2ibm_32V[] = {
|
||||
};
|
||||
|
||||
/* EBCDIC to ASCII -- POSIX and System V compatible. */
|
||||
u_char e2a_POSIX[] = {
|
||||
const u_char e2a_POSIX[] = {
|
||||
0000, 0001, 0002, 0003, 0234, 0011, 0206, 0177, /* 0000 */
|
||||
0227, 0215, 0216, 0013, 0014, 0015, 0016, 0017, /* 0010 */
|
||||
0020, 0021, 0022, 0023, 0235, 0205, 0010, 0207, /* 0020 */
|
||||
@@ -223,7 +216,7 @@ u_char e2a_POSIX[] = {
|
||||
};
|
||||
|
||||
/* ASCII to EBCDIC -- POSIX and System V compatible. */
|
||||
u_char a2e_POSIX[] = {
|
||||
const u_char a2e_POSIX[] = {
|
||||
0000, 0001, 0002, 0003, 0067, 0055, 0056, 0057, /* 0000 */
|
||||
0026, 0005, 0045, 0013, 0014, 0015, 0016, 0017, /* 0010 */
|
||||
0020, 0021, 0022, 0023, 0074, 0075, 0062, 0046, /* 0020 */
|
||||
@@ -259,7 +252,7 @@ u_char a2e_POSIX[] = {
|
||||
};
|
||||
|
||||
/* ASCII to IBM EBCDIC -- POSIX and System V compatible. */
|
||||
u_char a2ibm_POSIX[] = {
|
||||
const u_char a2ibm_POSIX[] = {
|
||||
0000, 0001, 0002, 0003, 0067, 0055, 0056, 0057, /* 0000 */
|
||||
0026, 0005, 0045, 0013, 0014, 0015, 0016, 0017, /* 0010 */
|
||||
0020, 0021, 0022, 0023, 0074, 0075, 0062, 0046, /* 0020 */
|
||||
|
||||
+3
-3
@@ -283,9 +283,9 @@ appended.
|
||||
.El
|
||||
.Pp
|
||||
Where sizes are specified, a decimal number of bytes is expected.
|
||||
If the number ends with a ``b'', ``k'', ``m'' or ``w'', the number
|
||||
is multiplied by 512, 1024 (1K), 1048576 (1M) or the number of bytes
|
||||
in an integer, respectively.
|
||||
If the number ends with a ``b'', ``k'', ``m'', ``g'', or ``w'', the
|
||||
number is multiplied by 512, 1024 (1K), 1048576 (1M), 1073741824 (1G)
|
||||
or the number of bytes in an integer, respectively.
|
||||
Two or more numbers may be separated by an ``x'' to indicate a product.
|
||||
.Pp
|
||||
When finished,
|
||||
|
||||
+76
-63
@@ -51,6 +51,8 @@ static const char rcsid[] =
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/device.h>
|
||||
#include <sys/disklabel.h>
|
||||
#include <sys/mtio.h>
|
||||
|
||||
#include <ctype.h>
|
||||
@@ -74,12 +76,12 @@ static void setup __P((void));
|
||||
IO in, out; /* input/output state */
|
||||
STAT st; /* statistics */
|
||||
void (*cfunc) __P((void)); /* conversion function */
|
||||
u_long cpy_cnt; /* # of blocks to copy */
|
||||
u_long pending = 0; /* pending seek if sparse */
|
||||
quad_t cpy_cnt; /* # of blocks to copy */
|
||||
off_t pending = 0; /* pending seek if sparse */
|
||||
u_int ddflags; /* conversion options */
|
||||
u_int cbsz; /* conversion block size */
|
||||
u_int files_cnt = 1; /* # of files to copy */
|
||||
u_char *ctab; /* conversion table */
|
||||
size_t cbsz; /* conversion block size */
|
||||
quad_t files_cnt = 1; /* # of files to copy */
|
||||
const u_char *ctab; /* conversion table */
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
@@ -113,7 +115,7 @@ setup()
|
||||
in.fd = STDIN_FILENO;
|
||||
} else {
|
||||
in.fd = open(in.name, O_RDONLY, 0);
|
||||
if (in.fd < 0)
|
||||
if (in.fd == -1)
|
||||
err(1, "%s", in.name);
|
||||
}
|
||||
|
||||
@@ -135,11 +137,11 @@ setup()
|
||||
* Without read we may have a problem if output also does
|
||||
* not support seeks.
|
||||
*/
|
||||
if (out.fd < 0) {
|
||||
if (out.fd == -1) {
|
||||
out.fd = open(out.name, O_WRONLY | OFLAGS, DEFFILEMODE);
|
||||
out.flags |= NOREAD;
|
||||
}
|
||||
if (out.fd < 0)
|
||||
if (out.fd == -1)
|
||||
err(1, "%s", out.name);
|
||||
}
|
||||
|
||||
@@ -149,14 +151,13 @@ setup()
|
||||
* Allocate space for the input and output buffers. If not doing
|
||||
* record oriented I/O, only need a single buffer.
|
||||
*/
|
||||
if (!(ddflags & (C_BLOCK|C_UNBLOCK))) {
|
||||
if (!(ddflags & (C_BLOCK | C_UNBLOCK))) {
|
||||
if ((in.db = malloc(out.dbsz + in.dbsz - 1)) == NULL)
|
||||
err(1, NULL);
|
||||
err(1, "input buffer");
|
||||
out.db = in.db;
|
||||
} else if ((in.db =
|
||||
malloc((u_int)(MAX(in.dbsz, cbsz) + cbsz))) == NULL ||
|
||||
(out.db = malloc((u_int)(out.dbsz + cbsz))) == NULL)
|
||||
err(1, NULL);
|
||||
} else if ((in.db = malloc(MAX(in.dbsz, cbsz) + cbsz)) == NULL ||
|
||||
(out.db = malloc(out.dbsz + cbsz)) == NULL)
|
||||
err(1, "output buffer");
|
||||
in.dbp = in.db;
|
||||
out.dbp = out.db;
|
||||
|
||||
@@ -171,50 +172,34 @@ setup()
|
||||
* kinds of output files, tapes, for example.
|
||||
*/
|
||||
if ((ddflags & (C_OF | C_SEEK | C_NOTRUNC)) == (C_OF | C_SEEK))
|
||||
(void)ftruncate(out.fd, (off_t)out.offset * out.dbsz);
|
||||
(void)ftruncate(out.fd, out.offset * out.dbsz);
|
||||
|
||||
/*
|
||||
* If converting case at the same time as another conversion, build a
|
||||
* table that does both at once. If just converting case, use the
|
||||
* built-in tables.
|
||||
*/
|
||||
if (ddflags & (C_LCASE|C_UCASE))
|
||||
if (ddflags & C_ASCII)
|
||||
if (ddflags & (C_LCASE | C_UCASE)) {
|
||||
if (ddflags & (C_ASCII | C_EBCDIC)) {
|
||||
if (ddflags & C_LCASE) {
|
||||
for (cnt = 0; cnt <= 0377; ++cnt)
|
||||
if (isupper(ctab[cnt]))
|
||||
ctab[cnt] = tolower(ctab[cnt]);
|
||||
casetab[cnt] = tolower(ctab[cnt]);
|
||||
} else {
|
||||
for (cnt = 0; cnt <= 0377; ++cnt)
|
||||
if (islower(ctab[cnt]))
|
||||
ctab[cnt] = toupper(ctab[cnt]);
|
||||
casetab[cnt] = toupper(ctab[cnt]);
|
||||
}
|
||||
else if (ddflags & C_EBCDIC)
|
||||
} else {
|
||||
if (ddflags & C_LCASE) {
|
||||
for (cnt = 0; cnt <= 0377; ++cnt)
|
||||
if (isupper(cnt))
|
||||
ctab[cnt] = ctab[tolower(cnt)];
|
||||
casetab[cnt] = tolower(cnt);
|
||||
} else {
|
||||
for (cnt = 0; cnt <= 0377; ++cnt)
|
||||
if (islower(cnt))
|
||||
ctab[cnt] = ctab[toupper(cnt)];
|
||||
}
|
||||
else {
|
||||
ctab = ddflags & C_LCASE ? u2l : l2u;
|
||||
if (ddflags & C_LCASE) {
|
||||
for (cnt = 0; cnt <= 0377; ++cnt)
|
||||
if (isupper(cnt))
|
||||
ctab[cnt] = tolower(cnt);
|
||||
else
|
||||
ctab[cnt] = cnt;
|
||||
} else {
|
||||
for (cnt = 0; cnt <= 0377; ++cnt)
|
||||
if (islower(cnt))
|
||||
ctab[cnt] = toupper(cnt);
|
||||
else
|
||||
ctab[cnt] = cnt;
|
||||
casetab[cnt] = toupper(cnt);
|
||||
}
|
||||
}
|
||||
ctab = casetab;
|
||||
}
|
||||
|
||||
(void)gettimeofday(&tv, (struct timezone *)NULL);
|
||||
st.start = tv.tv_sec + tv.tv_usec * 1e-6;
|
||||
}
|
||||
@@ -223,35 +208,59 @@ static void
|
||||
getfdtype(io)
|
||||
IO *io;
|
||||
{
|
||||
struct mtget mt;
|
||||
struct stat sb;
|
||||
struct disklabel dkl;
|
||||
struct mtget mt;
|
||||
int type;
|
||||
|
||||
if (fstat(io->fd, &sb))
|
||||
if (fstat(io->fd, &sb) == -1)
|
||||
err(1, "%s", io->name);
|
||||
if (S_ISCHR(sb.st_mode))
|
||||
io->flags |= ioctl(io->fd, MTIOCGET, &mt) ? ISCHR : ISTAPE;
|
||||
else if (lseek(io->fd, (off_t)0, SEEK_CUR) == -1 && errno == ESPIPE)
|
||||
io->flags |= ISPIPE; /* XXX fixed in 4.4BSD */
|
||||
if (S_ISCHR(sb.st_mode) || S_ISBLK(sb.st_mode)) {
|
||||
if (ioctl(io->fd, DIOCGDINFO, &dkl) == 0 ||
|
||||
/* XXX {,k}mem hack: This sucks. */
|
||||
(major(sb.st_rdev) == 2 &&
|
||||
(minor(sb.st_rdev) == 0 || minor(sb.st_rdev) == 1)))
|
||||
io->flags |= ISSEEK;
|
||||
else if (ioctl(io->fd, MTIOCGET, &mt) == 0)
|
||||
io->flags |= ISTAPE;
|
||||
if (S_ISCHR(sb.st_mode) && (io->flags & ISTAPE) == 0)
|
||||
io->flags |= ISCHR;
|
||||
return;
|
||||
}
|
||||
errno = 0;
|
||||
if (lseek(io->fd, (off_t)0, SEEK_CUR) == -1 && errno == ESPIPE)
|
||||
io->flags |= ISPIPE;
|
||||
else
|
||||
io->flags |= ISSEEK;
|
||||
}
|
||||
|
||||
static void
|
||||
dd_in()
|
||||
{
|
||||
int n;
|
||||
ssize_t n;
|
||||
|
||||
for (;;) {
|
||||
if (cpy_cnt && (st.in_full + st.in_part) >= cpy_cnt)
|
||||
switch (cpy_cnt) {
|
||||
case -1: /* count=0 was specified */
|
||||
return;
|
||||
case 0:
|
||||
break;
|
||||
default:
|
||||
if (st.in_full + st.in_part >= cpy_cnt)
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Zero the buffer first if sync; If doing block operations
|
||||
* Zero the buffer first if sync; if doing block operations,
|
||||
* use spaces.
|
||||
*/
|
||||
if (ddflags & C_SYNC)
|
||||
if (ddflags & (C_BLOCK|C_UNBLOCK))
|
||||
if (ddflags & C_SYNC) {
|
||||
if (ddflags & (C_BLOCK | C_UNBLOCK))
|
||||
memset(in.dbp, ' ', in.dbsz);
|
||||
else
|
||||
memset(in.dbp, 0, in.dbsz);
|
||||
}
|
||||
|
||||
n = read(in.fd, in.dbp, in.dbsz);
|
||||
if (n == 0) {
|
||||
@@ -260,7 +269,7 @@ dd_in()
|
||||
}
|
||||
|
||||
/* Read error. */
|
||||
if (n < 0) {
|
||||
if (n == -1) {
|
||||
/*
|
||||
* If noerror not specified, die. POSIX requires that
|
||||
* the warning message be followed by an I/O display.
|
||||
@@ -271,12 +280,12 @@ dd_in()
|
||||
summary();
|
||||
|
||||
/*
|
||||
* If it's not a tape drive or a pipe, seek past the
|
||||
* If it's a seekable file descriptor, seek past the
|
||||
* error. If your OS doesn't do the right thing for
|
||||
* raw disks this section should be modified to re-read
|
||||
* in sector size chunks.
|
||||
*/
|
||||
if (!(in.flags & (ISPIPE|ISTAPE)) &&
|
||||
if (in.flags & ISSEEK &&
|
||||
lseek(in.fd, (off_t)in.dbsz, SEEK_CUR))
|
||||
warn("%s", in.name);
|
||||
|
||||
@@ -329,7 +338,7 @@ dd_in()
|
||||
}
|
||||
|
||||
/*
|
||||
* Cleanup any remaining I/O and flush output. If necesssary, output file
|
||||
* Clean up any remaining I/O and flush output. If necessary, the output file
|
||||
* is truncated.
|
||||
*/
|
||||
static void
|
||||
@@ -342,7 +351,7 @@ dd_close()
|
||||
else if (cfunc == unblock)
|
||||
unblock_close();
|
||||
if (ddflags & C_OSYNC && out.dbcnt && out.dbcnt < out.dbsz) {
|
||||
if (ddflags & (C_BLOCK|C_UNBLOCK))
|
||||
if (ddflags & (C_BLOCK | C_UNBLOCK))
|
||||
memset(out.dbp, ' ', out.dbsz - out.dbcnt);
|
||||
else
|
||||
memset(out.dbp, 0, out.dbsz - out.dbcnt);
|
||||
@@ -356,9 +365,11 @@ void
|
||||
dd_out(force)
|
||||
int force;
|
||||
{
|
||||
static int warned;
|
||||
int cnt, n, nw, i, sparse;
|
||||
u_char *outp;
|
||||
size_t cnt, i, n;
|
||||
ssize_t nw;
|
||||
static int warned;
|
||||
int sparse;
|
||||
|
||||
/*
|
||||
* Write one or more blocks out. The common case is writing a full
|
||||
@@ -395,7 +406,8 @@ dd_out(force)
|
||||
if (pending != 0) {
|
||||
if (force)
|
||||
pending--;
|
||||
if (lseek (out.fd, pending, SEEK_CUR) == -1)
|
||||
if (lseek(out.fd, pending, SEEK_CUR) ==
|
||||
-1)
|
||||
err(2, "%s: seek error creating sparse file",
|
||||
out.name);
|
||||
if (force)
|
||||
@@ -427,13 +439,14 @@ dd_out(force)
|
||||
++st.out_part;
|
||||
if (nw == cnt)
|
||||
break;
|
||||
if (out.flags & ISTAPE)
|
||||
errx(1, "%s: short write on tape device",
|
||||
out.name);
|
||||
if (out.flags & ISCHR && !warned) {
|
||||
warned = 1;
|
||||
warnx("%s: short write on character device",
|
||||
out.name);
|
||||
}
|
||||
if (out.flags & ISTAPE)
|
||||
errx(1, "%s: short write on tape device", out.name);
|
||||
}
|
||||
if ((out.dbcnt -= n) < out.dbsz)
|
||||
break;
|
||||
@@ -441,6 +454,6 @@ dd_out(force)
|
||||
|
||||
/* Reassemble the output block. */
|
||||
if (out.dbcnt)
|
||||
memmove(out.db, out.dbp - out.dbcnt, out.dbcnt);
|
||||
(void)memmove(out.db, out.dbp - out.dbcnt, out.dbcnt);
|
||||
out.dbp = out.db + out.dbcnt;
|
||||
}
|
||||
+26
-24
@@ -40,37 +40,39 @@
|
||||
|
||||
/* Input/output stream state. */
|
||||
typedef struct {
|
||||
u_char *db; /* buffer address */
|
||||
u_char *dbp; /* current buffer I/O address */
|
||||
u_long dbcnt; /* current buffer byte count */
|
||||
int dbrcnt; /* last read byte count */
|
||||
u_long dbsz; /* buffer size */
|
||||
u_char *db; /* buffer address */
|
||||
u_char *dbp; /* current buffer I/O address */
|
||||
/* XXX ssize_t? */
|
||||
size_t dbcnt; /* current buffer byte count */
|
||||
size_t dbrcnt; /* last read byte count */
|
||||
size_t dbsz; /* buffer size */
|
||||
|
||||
#define ISCHR 0x01 /* character device (warn on short) */
|
||||
#define ISPIPE 0x02 /* pipe (not truncatable) */
|
||||
#define ISTAPE 0x04 /* tape (not seekable) */
|
||||
#define NOREAD 0x08 /* not readable */
|
||||
u_int flags;
|
||||
#define ISPIPE 0x02 /* pipe-like (not truncatable) */
|
||||
#define ISTAPE 0x04 /* tape */
|
||||
#define ISSEEK 0x08 /* valid to seek on */
|
||||
#define NOREAD 0x10 /* not readable */
|
||||
u_int flags;
|
||||
|
||||
char *name; /* name */
|
||||
int fd; /* file descriptor */
|
||||
u_long offset; /* # of blocks to skip */
|
||||
char *name; /* name */
|
||||
int fd; /* file descriptor */
|
||||
off_t offset; /* # of blocks to skip */
|
||||
|
||||
u_long f_stats; /* # of full blocks processed */
|
||||
u_long p_stats; /* # of partial blocks processed */
|
||||
u_long s_stats; /* # of odd swab blocks */
|
||||
u_long t_stats; /* # of truncations */
|
||||
u_quad_t f_stats; /* # of full blocks processed */
|
||||
u_quad_t p_stats; /* # of partial blocks processed */
|
||||
u_quad_t s_stats; /* # of odd swab blocks */
|
||||
u_quad_t t_stats; /* # of truncations */
|
||||
} IO;
|
||||
|
||||
typedef struct {
|
||||
u_long in_full; /* # of full input blocks */
|
||||
u_long in_part; /* # of partial input blocks */
|
||||
u_long out_full; /* # of full output blocks */
|
||||
u_long out_part; /* # of partial output blocks */
|
||||
u_long trunc; /* # of truncated records */
|
||||
u_long swab; /* # of odd-length swab blocks */
|
||||
u_int64_t bytes; /* # of bytes written */
|
||||
double start; /* start time of dd */
|
||||
u_quad_t in_full; /* # of full input blocks */
|
||||
u_quad_t in_part; /* # of partial input blocks */
|
||||
u_quad_t out_full; /* # of full output blocks */
|
||||
u_quad_t out_part; /* # of partial output blocks */
|
||||
u_quad_t trunc; /* # of truncated records */
|
||||
u_quad_t swab; /* # of odd-length swab blocks */
|
||||
u_quad_t bytes; /* # of bytes written */
|
||||
double start; /* start time of dd */
|
||||
} STAT;
|
||||
|
||||
/* Flags (in ddflags). */
|
||||
|
||||
+8
-6
@@ -57,10 +57,12 @@ void unblock_close __P((void));
|
||||
extern IO in, out;
|
||||
extern STAT st;
|
||||
extern void (*cfunc)();
|
||||
extern u_long cpy_cnt;
|
||||
extern u_int cbsz;
|
||||
extern quad_t cpy_cnt;
|
||||
extern size_t cbsz;
|
||||
extern u_int ddflags;
|
||||
extern u_int files_cnt;
|
||||
extern u_char *ctab;
|
||||
extern u_char a2e_32V[], a2e_POSIX[], a2ibm_32V[], a2ibm_POSIX[], e2a_32V[];
|
||||
extern u_char e2a_POSIX[], l2u[], u2l[];
|
||||
extern quad_t files_cnt;
|
||||
extern const u_char *ctab;
|
||||
extern const u_char a2e_32V[], a2e_POSIX[];
|
||||
extern const u_char e2a_32V[], e2a_POSIX[];
|
||||
extern const u_char a2ibm_32V[], a2ibm_POSIX[];
|
||||
extern u_char casetab[];
|
||||
+3
-3
@@ -66,16 +66,16 @@ summary()
|
||||
secs = 1e-6;
|
||||
/* Use snprintf(3) so that we don't reenter stdio(3). */
|
||||
(void)snprintf(buf, sizeof(buf),
|
||||
"%lu+%lu records in\n%lu+%lu records out\n",
|
||||
"%qu+%qu records in\n%qu+%qu records out\n",
|
||||
st.in_full, st.in_part, st.out_full, st.out_part);
|
||||
(void)write(STDERR_FILENO, buf, strlen(buf));
|
||||
if (st.swab) {
|
||||
(void)snprintf(buf, sizeof(buf), "%lu odd length swab %s\n",
|
||||
(void)snprintf(buf, sizeof(buf), "%qu odd length swab %s\n",
|
||||
st.swab, (st.swab == 1) ? "block" : "blocks");
|
||||
(void)write(STDERR_FILENO, buf, strlen(buf));
|
||||
}
|
||||
if (st.trunc) {
|
||||
(void)snprintf(buf, sizeof(buf), "%lu truncated %s\n",
|
||||
(void)snprintf(buf, sizeof(buf), "%qu truncated %s\n",
|
||||
st.trunc, (st.trunc == 1) ? "block" : "blocks");
|
||||
(void)write(STDERR_FILENO, buf, strlen(buf));
|
||||
}
|
||||
|
||||
+17
-9
@@ -47,6 +47,7 @@ static const char rcsid[] =
|
||||
#include <sys/mtio.h>
|
||||
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "dd.h"
|
||||
@@ -61,11 +62,16 @@ static const char rcsid[] =
|
||||
void
|
||||
pos_in()
|
||||
{
|
||||
int bcnt, cnt, nr, warned;
|
||||
off_t cnt;
|
||||
int warned;
|
||||
ssize_t nr;
|
||||
size_t bcnt;
|
||||
|
||||
/* If not a character, pipe or tape device, try to seek on it. */
|
||||
if (!(in.flags & (ISCHR|ISPIPE|ISTAPE))) {
|
||||
if (lseek(in.fd, (off_t)in.offset * in.dbsz, SEEK_CUR) == -1)
|
||||
/* If known to be seekable, try to seek on it. */
|
||||
if (in.flags & ISSEEK) {
|
||||
errno = 0;
|
||||
if (lseek(in.fd, in.offset * in.dbsz, SEEK_CUR) == -1 &&
|
||||
errno != 0)
|
||||
err(1, "%s", in.name);
|
||||
return;
|
||||
}
|
||||
@@ -116,7 +122,8 @@ void
|
||||
pos_out()
|
||||
{
|
||||
struct mtop t_op;
|
||||
int cnt, n;
|
||||
off_t cnt;
|
||||
ssize_t n;
|
||||
|
||||
/*
|
||||
* If not a tape, try seeking on the file. Seeking on a pipe is
|
||||
@@ -124,8 +131,9 @@ pos_out()
|
||||
* have specified the seek operand.
|
||||
*/
|
||||
if (!(out.flags & ISTAPE)) {
|
||||
if (lseek(out.fd,
|
||||
(off_t)out.offset * out.dbsz, SEEK_SET) == -1)
|
||||
errno = 0;
|
||||
if (lseek(out.fd, out.offset * out.dbsz, SEEK_CUR) == -1 &&
|
||||
errno != 0)
|
||||
err(1, "%s", out.name);
|
||||
return;
|
||||
}
|
||||
@@ -135,7 +143,7 @@ pos_out()
|
||||
t_op.mt_op = MTFSR;
|
||||
t_op.mt_count = out.offset;
|
||||
|
||||
if (ioctl(out.fd, MTIOCTOP, &t_op) < 0)
|
||||
if (ioctl(out.fd, MTIOCTOP, &t_op) == -1)
|
||||
err(1, "%s", out.name);
|
||||
return;
|
||||
}
|
||||
@@ -145,7 +153,7 @@ pos_out()
|
||||
if ((n = read(out.fd, out.db, out.dbsz)) > 0)
|
||||
continue;
|
||||
|
||||
if (n < 0)
|
||||
if (n == -1)
|
||||
err(1, "%s", out.name);
|
||||
|
||||
/*
|
||||
|
||||
+10
@@ -44,9 +44,11 @@
|
||||
.Sh SYNOPSIS
|
||||
.Nm mv
|
||||
.Op Fl f | Fl i
|
||||
.Op Fl v
|
||||
.Ar source target
|
||||
.Nm mv
|
||||
.Op Fl f | Fl i
|
||||
.Op Fl v
|
||||
.Ar source ... directory
|
||||
.Sh DESCRIPTION
|
||||
In its first form, the
|
||||
@@ -95,6 +97,10 @@ the move is attempted.
|
||||
option overrides any previous
|
||||
.Fl f
|
||||
options.)
|
||||
.It Fl v
|
||||
Cause
|
||||
.Nm
|
||||
to be verbose, showing files after they are moved.
|
||||
.El
|
||||
.Pp
|
||||
It is an error for either the
|
||||
@@ -130,6 +136,10 @@ utility exits 0 on success, and >0 if an error occurs.
|
||||
.Xr cp 1 ,
|
||||
.Xr rm 1 ,
|
||||
.Xr symlink 7
|
||||
.Sh COMPATIBILITY
|
||||
The
|
||||
.Fl v
|
||||
option is non-standard and its use in scripts is not recommended.
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
|
||||
+17
-7
@@ -60,11 +60,12 @@ static const char rcsid[] =
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sysexits.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "pathnames.h"
|
||||
|
||||
int fflg, iflg;
|
||||
int fflg, iflg, vflg;
|
||||
|
||||
int copy __P((char *, char *));
|
||||
int do_move __P((char *, char *));
|
||||
@@ -82,7 +83,7 @@ main(argc, argv)
|
||||
int ch;
|
||||
char path[MAXPATHLEN];
|
||||
|
||||
while ((ch = getopt(argc, argv, "fi")) != -1)
|
||||
while ((ch = getopt(argc, argv, "fiv")) != -1)
|
||||
switch (ch) {
|
||||
case 'i':
|
||||
iflg = 1;
|
||||
@@ -92,6 +93,9 @@ main(argc, argv)
|
||||
fflg = 1;
|
||||
iflg = 0;
|
||||
break;
|
||||
case 'v':
|
||||
vflg = 1;
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
}
|
||||
@@ -188,8 +192,11 @@ do_move(from, to)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!rename(from, to))
|
||||
if (!rename(from, to)) {
|
||||
if (vflg)
|
||||
printf("%s -> %s\n", from, to);
|
||||
return (0);
|
||||
}
|
||||
|
||||
if (errno == EXDEV) {
|
||||
struct statfs sfs;
|
||||
@@ -299,6 +306,8 @@ err: if (unlink(to))
|
||||
warn("%s: remove", from);
|
||||
return (1);
|
||||
}
|
||||
if (vflg)
|
||||
printf("%s -> %s\n", from, to);
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -309,7 +318,7 @@ copy(from, to)
|
||||
int pid, status;
|
||||
|
||||
if ((pid = fork()) == 0) {
|
||||
execl(_PATH_CP, "mv", "-PRp", from, to, NULL);
|
||||
execl(_PATH_CP, "mv", vflg ? "-PRpv" : "-PRp", from, to, NULL);
|
||||
warn("%s", _PATH_CP);
|
||||
_exit(1);
|
||||
}
|
||||
@@ -350,8 +359,9 @@ copy(from, to)
|
||||
void
|
||||
usage()
|
||||
{
|
||||
|
||||
(void)fprintf(stderr, "%s\n%s\n",
|
||||
"usage: mv [-f | -i] source target",
|
||||
" mv [-f | -i] source ... directory");
|
||||
exit(1);
|
||||
"usage: mv [-f | -i] [-v] source target",
|
||||
" mv [-f | -i] [-v] source ... directory");
|
||||
exit(EX_USAGE);
|
||||
}
|
||||
+10
-2
@@ -43,7 +43,7 @@
|
||||
.Nd remove directory entries
|
||||
.Sh SYNOPSIS
|
||||
.Nm rm
|
||||
.Op Fl dfiPRrW
|
||||
.Op Fl dfiPRrvW
|
||||
.Ar file ...
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
@@ -99,6 +99,8 @@ that directory is skipped.
|
||||
.It Fl r
|
||||
Equivalent to
|
||||
.Fl R .
|
||||
.It Fl v
|
||||
Be verbose when deleting files, showing them as they are removed.
|
||||
.It Fl W
|
||||
Attempt to undelete the named files.
|
||||
Currently, this option can only be used to recover
|
||||
@@ -109,7 +111,10 @@ The
|
||||
.Nm
|
||||
utility removes symbolic links, not the files referenced by the links.
|
||||
.Pp
|
||||
It is an error to attempt to remove the files ``.'' and ``..''.
|
||||
It is an error to attempt to remove the files
|
||||
.Dq \&.
|
||||
or
|
||||
.Dq .. .
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
@@ -161,6 +166,9 @@ utility differs from historical implementations in that the
|
||||
.Fl f
|
||||
option only masks attempts to remove non-existent files instead of
|
||||
masking a large variety of errors.
|
||||
The
|
||||
.Fl v
|
||||
option is non-standard and its use in scripts is not recommended.
|
||||
.Pp
|
||||
Also, historical
|
||||
.Bx
|
||||
|
||||
+47
-15
@@ -48,6 +48,8 @@ static const char rcsid[] =
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/mount.h>
|
||||
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
@@ -56,11 +58,12 @@ static const char rcsid[] =
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sysexits.h>
|
||||
#include <unistd.h>
|
||||
|
||||
extern char *flags_to_string __P((u_long, char *));
|
||||
|
||||
int dflag, eval, fflag, iflag, Pflag, Wflag, stdin_ok;
|
||||
int dflag, eval, fflag, iflag, Pflag, vflag, Wflag, stdin_ok;
|
||||
uid_t uid;
|
||||
|
||||
int check __P((char *, char *, struct stat *));
|
||||
@@ -85,7 +88,7 @@ main(argc, argv)
|
||||
int ch, rflag;
|
||||
|
||||
Pflag = rflag = 0;
|
||||
while ((ch = getopt(argc, argv, "dfiPRrW")) != -1)
|
||||
while ((ch = getopt(argc, argv, "dfiPRrvW")) != -1)
|
||||
switch(ch) {
|
||||
case 'd':
|
||||
dflag = 1;
|
||||
@@ -105,6 +108,9 @@ main(argc, argv)
|
||||
case 'r': /* Compatibility. */
|
||||
rflag = 1;
|
||||
break;
|
||||
case 'v':
|
||||
vflag = 1;
|
||||
break;
|
||||
case 'W':
|
||||
Wflag = 1;
|
||||
break;
|
||||
@@ -219,7 +225,7 @@ rm_tree(argv)
|
||||
!(p->fts_statp->st_flags & (SF_APPEND|SF_IMMUTABLE)))
|
||||
rval = chflags(p->fts_accpath,
|
||||
p->fts_statp->st_flags &= ~(UF_APPEND|UF_IMMUTABLE));
|
||||
if (!rval) {
|
||||
if (rval == 0) {
|
||||
/*
|
||||
* If we can't read or search the directory, may still be
|
||||
* able to remove it. Don't print out the un{read,search}able
|
||||
@@ -228,21 +234,35 @@ rm_tree(argv)
|
||||
switch (p->fts_info) {
|
||||
case FTS_DP:
|
||||
case FTS_DNR:
|
||||
if (!rmdir(p->fts_accpath) || (fflag && errno == ENOENT))
|
||||
rval = rmdir(p->fts_accpath);
|
||||
if (rval == 0 || (fflag && errno == ENOENT)) {
|
||||
if (rval == 0 && vflag)
|
||||
(void)printf("%s\n",
|
||||
p->fts_accpath);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
|
||||
case FTS_W:
|
||||
if (!undelete(p->fts_accpath) ||
|
||||
(fflag && errno == ENOENT))
|
||||
rval = undelete(p->fts_accpath);
|
||||
if (rval == 0 && (fflag && errno == ENOENT)) {
|
||||
if (vflag)
|
||||
(void)printf("%s\n",
|
||||
p->fts_accpath);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if (Pflag)
|
||||
rm_overwrite(p->fts_accpath, NULL);
|
||||
if (!unlink(p->fts_accpath) || (fflag && errno == ENOENT))
|
||||
rval = unlink(p->fts_accpath);
|
||||
if (rval == 0 || (fflag && errno == ENOENT)) {
|
||||
if (rval == 0 && vflag)
|
||||
(void)printf("%s\n",
|
||||
p->fts_accpath);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
err:
|
||||
@@ -295,7 +315,7 @@ rm_file(argv)
|
||||
(sb.st_flags & (UF_APPEND|UF_IMMUTABLE)) &&
|
||||
!(sb.st_flags & (SF_APPEND|SF_IMMUTABLE)))
|
||||
rval = chflags(f, sb.st_flags & ~(UF_APPEND|UF_IMMUTABLE));
|
||||
if (!rval) {
|
||||
if (rval == 0) {
|
||||
if (S_ISWHT(sb.st_mode))
|
||||
rval = undelete(f);
|
||||
else if (S_ISDIR(sb.st_mode))
|
||||
@@ -310,6 +330,8 @@ rm_file(argv)
|
||||
warn("%s", f);
|
||||
eval = 1;
|
||||
}
|
||||
if (vflag && rval == 0)
|
||||
(void)printf("%s\n", f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -330,9 +352,10 @@ rm_overwrite(file, sbp)
|
||||
struct stat *sbp;
|
||||
{
|
||||
struct stat sb;
|
||||
struct statfs fsb;
|
||||
off_t len;
|
||||
int fd, wlen;
|
||||
char buf[8 * 1024];
|
||||
int bsize, fd, wlen;
|
||||
char *buf = NULL;
|
||||
|
||||
fd = -1;
|
||||
if (sbp == NULL) {
|
||||
@@ -344,11 +367,16 @@ rm_overwrite(file, sbp)
|
||||
return;
|
||||
if ((fd = open(file, O_WRONLY, 0)) == -1)
|
||||
goto err;
|
||||
if (fstatfs(fd, &fsb) == -1)
|
||||
goto err;
|
||||
bsize = MAX(fsb.f_iosize, 1024);
|
||||
if ((buf = malloc(bsize)) == NULL)
|
||||
err(1, "malloc");
|
||||
|
||||
#define PASS(byte) { \
|
||||
memset(buf, byte, sizeof(buf)); \
|
||||
memset(buf, byte, bsize); \
|
||||
for (len = sbp->st_size; len > 0; len -= wlen) { \
|
||||
wlen = len < sizeof(buf) ? len : sizeof(buf); \
|
||||
wlen = len < bsize ? len : bsize; \
|
||||
if (write(fd, buf, wlen) != wlen) \
|
||||
goto err; \
|
||||
} \
|
||||
@@ -360,10 +388,14 @@ rm_overwrite(file, sbp)
|
||||
if (fsync(fd) || lseek(fd, (off_t)0, SEEK_SET))
|
||||
goto err;
|
||||
PASS(0xff);
|
||||
if (!fsync(fd) && !close(fd))
|
||||
if (!fsync(fd) && !close(fd)) {
|
||||
free(buf);
|
||||
return;
|
||||
}
|
||||
|
||||
err: eval = 1;
|
||||
if (buf)
|
||||
free(buf);
|
||||
warn("%s", file);
|
||||
}
|
||||
|
||||
@@ -440,6 +472,6 @@ void
|
||||
usage()
|
||||
{
|
||||
|
||||
(void)fprintf(stderr, "usage: rm [-f | -i] [-dPRrW] file ...\n");
|
||||
exit(1);
|
||||
(void)fprintf(stderr, "usage: rm [-f | -i] [-dPRrvW] file ...\n");
|
||||
exit(EX_USAGE);
|
||||
}
|
||||
@@ -10,6 +10,10 @@ GENSRCS= builtins.c init.c nodes.c syntax.c
|
||||
GENHDRS= builtins.h nodes.h syntax.h token.h y.tab.h
|
||||
SRCS= ${SHSRCS} ${GENSRCS} ${GENHDRS} y.tab.h
|
||||
|
||||
# MLINKS for Shell built in commands for which there are no userland
|
||||
# utilities of the same name are handled with the associated manpage,
|
||||
# builtin.1 in share/man/man1/.
|
||||
|
||||
DPADD+= ${LIBL} ${LIBEDIT} ${LIBTERMCAP}
|
||||
LDADD+= -ll -ledit -ltermcap
|
||||
|
||||
|
||||
+10
-2
@@ -275,7 +275,14 @@ evaltree(n, flags)
|
||||
out:
|
||||
if (pendingsigs)
|
||||
dotrap();
|
||||
if ((flags & EV_EXIT) || (eflag && exitstatus && !(flags & EV_TESTED)))
|
||||
/*
|
||||
* XXX - Like "!(n->type == NSEMI)", more types will probably
|
||||
* need to be excluded from this test. It's probably better
|
||||
* to set or unset EV_TESTED in the loop above than to bloat
|
||||
* the conditional here.
|
||||
*/
|
||||
if ((flags & EV_EXIT) || (eflag && exitstatus
|
||||
&& !(flags & EV_TESTED) && !(n->type == NSEMI)))
|
||||
exitshell(exitstatus);
|
||||
}
|
||||
|
||||
@@ -492,7 +499,8 @@ evalpipe(n)
|
||||
close(prevfd);
|
||||
}
|
||||
if (pip[1] >= 0) {
|
||||
close(pip[0]);
|
||||
if (!(prevfd >= 0 && pip[0] == 0))
|
||||
close(pip[0]);
|
||||
if (pip[1] != 1) {
|
||||
close(1);
|
||||
copyfd(pip[1], 1);
|
||||
|
||||
+1036
-571
File diff suppressed because it is too large.
Load diff
+21
-14
@@ -42,7 +42,7 @@
|
||||
.Nm sleep
|
||||
.Nd suspend execution for an interval of time
|
||||
.Sh SYNOPSIS
|
||||
.Nm sleep
|
||||
.Nm
|
||||
.Ar seconds
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
@@ -50,25 +50,34 @@ The
|
||||
command
|
||||
suspends execution for a minimum of
|
||||
.Ar seconds .
|
||||
.Nm Sleep
|
||||
is used to schedule the execution of other commands (see
|
||||
.Sx EXAMPLES
|
||||
below).
|
||||
.Pp
|
||||
If the
|
||||
.Nm
|
||||
command
|
||||
receives a SIGALRM signal, it terminates normally with a zero exit status,
|
||||
for any other signal it takes the standard action.
|
||||
command receives a signal, it takes the standard action.
|
||||
.Sh IMPLEMENTATION NOTES
|
||||
The
|
||||
.Dv SIGALRM
|
||||
signal is not handled specially by this implementation.
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
command will accept and honor a non-integer number of specified seconds
|
||||
.Po
|
||||
with a
|
||||
.Ql \&.
|
||||
character as a decimal point
|
||||
.Pc .
|
||||
.Bf Sy
|
||||
This is a non-portable extension, and its use will nearly guarantee that
|
||||
a shell script will not execute properly on another system.
|
||||
.Ef
|
||||
.Sh DIAGNOSTICS
|
||||
The
|
||||
.Nm
|
||||
utility exits with one of the following values:
|
||||
.Bl -tag -width flag
|
||||
.It Li \&0
|
||||
On successful completion, or if the signal
|
||||
.Dv SIGALRM
|
||||
was received.
|
||||
On successful completion.
|
||||
.It Li \&>\&0
|
||||
An error occurred.
|
||||
.El
|
||||
@@ -111,9 +120,7 @@ when the file is found, then another portion processing
|
||||
is done courteously by sleeping for 70 seconds in between each
|
||||
awk job.
|
||||
.Sh SEE ALSO
|
||||
.Xr at 1 ,
|
||||
.Xr setitimer 2 ,
|
||||
.Xr alarm 3 ,
|
||||
.Xr nanosleep 2 ,
|
||||
.Xr sleep 3
|
||||
.Sh STANDARDS
|
||||
The
|
||||
|
||||
+56
-4
@@ -45,8 +45,11 @@ static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <ctype.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
void usage __P((void));
|
||||
@@ -56,22 +59,71 @@ main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
int ch, secs;
|
||||
struct timespec time_to_sleep;
|
||||
long l;
|
||||
int ch, neg;
|
||||
char *p;
|
||||
|
||||
while ((ch = getopt(argc, argv, "")) != -1)
|
||||
switch(ch) {
|
||||
case '?':
|
||||
default:
|
||||
usage();
|
||||
/* NOTREACHED */
|
||||
}
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
if (argc != 1)
|
||||
if (argc != 1) {
|
||||
usage();
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
p = argv[0];
|
||||
|
||||
/* Skip over leading whitespaces. */
|
||||
while (isspace((unsigned char)*p))
|
||||
++p;
|
||||
|
||||
/* Check for optional `+' or `-' sign. */
|
||||
neg = 0;
|
||||
if (*p == '-') {
|
||||
neg = 1;
|
||||
++p;
|
||||
}
|
||||
else if (*p == '+')
|
||||
++p;
|
||||
|
||||
/* Calculate seconds. */
|
||||
if (isdigit((unsigned char)*p)) {
|
||||
l = strtol(p, &p, 10);
|
||||
if (l > INT_MAX) {
|
||||
/*
|
||||
* Avoid overflow when `seconds' is huge. This assumes
|
||||
* that the maximum value for a time_t is >= INT_MAX.
|
||||
*/
|
||||
l = INT_MAX;
|
||||
}
|
||||
} else
|
||||
l = 0;
|
||||
time_to_sleep.tv_sec = (time_t)l;
|
||||
|
||||
/* Calculate nanoseconds. */
|
||||
time_to_sleep.tv_nsec = 0;
|
||||
|
||||
if (*p == '.') { /* Decimal point. */
|
||||
l = 100000000L;
|
||||
do {
|
||||
if (isdigit((unsigned char)*++p))
|
||||
time_to_sleep.tv_nsec += (*p - '0') * l;
|
||||
else
|
||||
break;
|
||||
} while (l /= 10);
|
||||
}
|
||||
|
||||
if (!neg && (time_to_sleep.tv_sec > 0 || time_to_sleep.tv_nsec > 0))
|
||||
(void)nanosleep(&time_to_sleep, (struct timespec *)NULL);
|
||||
|
||||
if ((secs = atoi(*argv)) > 0)
|
||||
(void)sleep(secs);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
# $FreeBSD$
|
||||
|
||||
PROG= test
|
||||
SRCS= test.c operators.c
|
||||
LINKS= ${BINDIR}/test ${BINDIR}/[
|
||||
MLINKS= test.1 '[.1'
|
||||
|
||||
|
||||
+72
-17
@@ -39,14 +39,17 @@
|
||||
.Dt TEST 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm test
|
||||
.Nm test ,
|
||||
.Nm \&[
|
||||
.Nd condition evaluation utility
|
||||
.Sh SYNOPSIS
|
||||
.Nm test
|
||||
.Ar expression
|
||||
.Nm [
|
||||
.Ar expression Cm ]
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
.Nm test
|
||||
utility evaluates the expression and, if it evaluates
|
||||
to true, returns a zero (true) exit status; otherwise
|
||||
it returns 1 (false).
|
||||
@@ -54,11 +57,11 @@ If there is no expression, test also
|
||||
returns 1 (false).
|
||||
.Pp
|
||||
All operators and flags are separate arguments to the
|
||||
.Nm
|
||||
.Nm test
|
||||
utility.
|
||||
.Pp
|
||||
The following primaries are used to construct expression:
|
||||
.Bl -tag -width indent
|
||||
.Bl -tag -width Ar
|
||||
.It Fl b Ar file
|
||||
True if
|
||||
.Ar file
|
||||
@@ -90,6 +93,14 @@ is set.
|
||||
True if
|
||||
.Ar file
|
||||
exists and is a symbolic link.
|
||||
This operator is retained for compatibility with previous versions of
|
||||
this program. Do not rely on its existence; use
|
||||
.Fl L
|
||||
instead.
|
||||
.It Fl k Ar file
|
||||
True if
|
||||
.Ar file
|
||||
exists and its sticky bit is set.
|
||||
.It Fl n Ar string
|
||||
True if the length of
|
||||
.Ar string
|
||||
@@ -99,25 +110,20 @@ True if
|
||||
.Ar file
|
||||
is a named pipe
|
||||
.Po Tn FIFO Pc .
|
||||
.It Fl S Ar file
|
||||
True if
|
||||
.Ar file
|
||||
is a socket.
|
||||
.It Fl r Ar file
|
||||
True if
|
||||
.Ar file
|
||||
.Ar file
|
||||
exists and is readable.
|
||||
.It Fl s Ar file
|
||||
True if
|
||||
.Ar file
|
||||
exists and has a size greater
|
||||
than zero.
|
||||
.It Fl t Ar [file_descriptor]
|
||||
.It Fl t Op Ar file_descriptor
|
||||
True if the file whose file descriptor number
|
||||
is
|
||||
.Ar file_descriptor
|
||||
(default 1) is open and is
|
||||
associated with a terminal.
|
||||
is open and is associated with a terminal.
|
||||
.It Fl u Ar file
|
||||
True if
|
||||
.Ar file
|
||||
@@ -146,6 +152,38 @@ can be searched.
|
||||
True if the length of
|
||||
.Ar string
|
||||
is zero.
|
||||
.It Fl L Ar file
|
||||
True if
|
||||
.Ar file
|
||||
exists and is a symbolic link.
|
||||
.It Fl O Ar file
|
||||
True if
|
||||
.Ar file
|
||||
exists and its owner matches the effective user id of this process.
|
||||
.It Fl G Ar file
|
||||
True if
|
||||
.Ar file
|
||||
exists and its group matches the effective group id of this process.
|
||||
.It Fl S Ar file
|
||||
True if
|
||||
.Ar file
|
||||
exists and is a socket.
|
||||
.It Ar file1 Fl nt Ar file2
|
||||
True if
|
||||
.Ar file1
|
||||
exists and is newer than
|
||||
.Ar file2 .
|
||||
.It Ar file1 Fl ot Ar file2
|
||||
True if
|
||||
.Ar file1
|
||||
exists and is older than
|
||||
.Ar file2 .
|
||||
.It Ar file1 Fl ef Ar file2
|
||||
True if
|
||||
.Ar file1
|
||||
and
|
||||
.Ar file2
|
||||
exist and refer to the same file.
|
||||
.It Ar string
|
||||
True if
|
||||
.Ar string
|
||||
@@ -163,6 +201,23 @@ True if the strings
|
||||
and
|
||||
.Ar \&s\&2
|
||||
are not identical.
|
||||
.It Ar \&s\&1 Cm \&< Ar \&s\&2
|
||||
True if string
|
||||
.Ar \&s\&1
|
||||
comes before
|
||||
.Ar \&s\&2
|
||||
based on the ASCII value of their characters.
|
||||
.It Ar \&s\&1 Cm \&> Ar \&s\&2
|
||||
True if string
|
||||
.Ar \&s\&1
|
||||
comes after
|
||||
.Ar \&s\&2
|
||||
based on the ASCII value of their characters.
|
||||
.It Ar \&s\&1
|
||||
True if
|
||||
.Ar \&s\&1
|
||||
is not the null
|
||||
string.
|
||||
.It Ar \&n\&1 Fl \&eq Ar \&n\&2
|
||||
True if the integers
|
||||
.Ar \&n\&1
|
||||
@@ -232,7 +287,7 @@ operator has higher precedence than the
|
||||
operator.
|
||||
.Sh GRAMMAR AMBIGUITY
|
||||
The
|
||||
.Nm
|
||||
.Nm test
|
||||
grammar is inherently ambiguous. In order to assure a degree of consistency,
|
||||
the cases described in the
|
||||
.St -p1003.2 ,
|
||||
@@ -242,7 +297,7 @@ standards document. All other cases are subject to the ambiguity in the
|
||||
command semantics.
|
||||
.Sh RETURN VALUES
|
||||
The
|
||||
.Nm
|
||||
.Nm test
|
||||
utility exits with one of the following values:
|
||||
.Bl -tag -width Ds
|
||||
.It 0
|
||||
@@ -258,7 +313,7 @@ An error occurred.
|
||||
.Xr sh 1
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
function is expected to be
|
||||
.Nm test
|
||||
utility implements a superset of the
|
||||
.St -p1003.2
|
||||
compatible.
|
||||
specification.
|
||||
+398
-518
@@ -1,593 +1,473 @@
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993, 1994
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
/* $NetBSD: test.c,v 1.21 1999/04/05 09:48:38 kleink Exp $ */
|
||||
|
||||
/*
|
||||
* test(1); version 7-like -- author Erik Baalbergen
|
||||
* modified by Eric Gisin to be used as built-in.
|
||||
* modified by Arnold Robbins to add SVR3 compatibility
|
||||
* (-x -c -b -p -u -g -k) plus Korn's -L -nt -ot -ef and new -S (socket).
|
||||
* modified by J.T. Conklin for NetBSD.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Kenneth Almquist.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* This program is in the Public Domain.
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char const copyright[] =
|
||||
"@(#) Copyright (c) 1992, 1993, 1994\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)test.c 8.3 (Berkeley) 4/2/94";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "operators.h"
|
||||
/* test(1) accepts the following grammar:
|
||||
oexpr ::= aexpr | aexpr "-o" oexpr ;
|
||||
aexpr ::= nexpr | nexpr "-a" aexpr ;
|
||||
nexpr ::= primary | "!" primary
|
||||
primary ::= unary-operator operand
|
||||
| operand binary-operator operand
|
||||
| operand
|
||||
| "(" oexpr ")"
|
||||
;
|
||||
unary-operator ::= "-r"|"-w"|"-x"|"-f"|"-d"|"-c"|"-b"|"-p"|
|
||||
"-u"|"-g"|"-k"|"-s"|"-t"|"-z"|"-n"|"-o"|"-O"|"-G"|"-L"|"-S";
|
||||
|
||||
#define STACKSIZE 12
|
||||
#define NESTINCR 16
|
||||
binary-operator ::= "="|"!="|"-eq"|"-ne"|"-ge"|"-gt"|"-le"|"-lt"|
|
||||
"-nt"|"-ot"|"-ef";
|
||||
operand ::= <any legal UNIX file name>
|
||||
*/
|
||||
|
||||
/* data types */
|
||||
#define STRING 0
|
||||
#define INTEGER 1
|
||||
#define BOOLEAN 2
|
||||
|
||||
#define IS_BANG(s) (s[0] == '!' && s[1] == '\0')
|
||||
|
||||
/*
|
||||
* This structure hold a value. The type keyword specifies the type of
|
||||
* the value, and the union u holds the value. The value of a boolean
|
||||
* is stored in u.num (1 = TRUE, 0 = FALSE).
|
||||
*/
|
||||
struct value {
|
||||
int type;
|
||||
union {
|
||||
char *string;
|
||||
long num;
|
||||
} u;
|
||||
enum token {
|
||||
EOI,
|
||||
FILRD,
|
||||
FILWR,
|
||||
FILEX,
|
||||
FILEXIST,
|
||||
FILREG,
|
||||
FILDIR,
|
||||
FILCDEV,
|
||||
FILBDEV,
|
||||
FILFIFO,
|
||||
FILSOCK,
|
||||
FILSYM,
|
||||
FILGZ,
|
||||
FILTT,
|
||||
FILSUID,
|
||||
FILSGID,
|
||||
FILSTCK,
|
||||
FILNT,
|
||||
FILOT,
|
||||
FILEQ,
|
||||
FILUID,
|
||||
FILGID,
|
||||
STREZ,
|
||||
STRNZ,
|
||||
STREQ,
|
||||
STRNE,
|
||||
STRLT,
|
||||
STRGT,
|
||||
INTEQ,
|
||||
INTNE,
|
||||
INTGE,
|
||||
INTGT,
|
||||
INTLE,
|
||||
INTLT,
|
||||
UNOT,
|
||||
BAND,
|
||||
BOR,
|
||||
LPAREN,
|
||||
RPAREN,
|
||||
OPERAND
|
||||
};
|
||||
|
||||
struct operator {
|
||||
short op; /* Which operator. */
|
||||
short pri; /* Priority of operator. */
|
||||
enum token_types {
|
||||
UNOP,
|
||||
BINOP,
|
||||
BUNOP,
|
||||
BBINOP,
|
||||
PAREN
|
||||
};
|
||||
|
||||
struct filestat {
|
||||
char *name; /* Name of file. */
|
||||
int rcode; /* Return code from stat. */
|
||||
struct stat stat; /* Status info on file. */
|
||||
struct t_op {
|
||||
const char *op_text;
|
||||
short op_num, op_type;
|
||||
} const ops [] = {
|
||||
{"-r", FILRD, UNOP},
|
||||
{"-w", FILWR, UNOP},
|
||||
{"-x", FILEX, UNOP},
|
||||
{"-e", FILEXIST,UNOP},
|
||||
{"-f", FILREG, UNOP},
|
||||
{"-d", FILDIR, UNOP},
|
||||
{"-c", FILCDEV,UNOP},
|
||||
{"-b", FILBDEV,UNOP},
|
||||
{"-p", FILFIFO,UNOP},
|
||||
{"-u", FILSUID,UNOP},
|
||||
{"-g", FILSGID,UNOP},
|
||||
{"-k", FILSTCK,UNOP},
|
||||
{"-s", FILGZ, UNOP},
|
||||
{"-t", FILTT, UNOP},
|
||||
{"-z", STREZ, UNOP},
|
||||
{"-n", STRNZ, UNOP},
|
||||
{"-h", FILSYM, UNOP}, /* for backwards compat */
|
||||
{"-O", FILUID, UNOP},
|
||||
{"-G", FILGID, UNOP},
|
||||
{"-L", FILSYM, UNOP},
|
||||
{"-S", FILSOCK,UNOP},
|
||||
{"=", STREQ, BINOP},
|
||||
{"!=", STRNE, BINOP},
|
||||
{"<", STRLT, BINOP},
|
||||
{">", STRGT, BINOP},
|
||||
{"-eq", INTEQ, BINOP},
|
||||
{"-ne", INTNE, BINOP},
|
||||
{"-ge", INTGE, BINOP},
|
||||
{"-gt", INTGT, BINOP},
|
||||
{"-le", INTLE, BINOP},
|
||||
{"-lt", INTLT, BINOP},
|
||||
{"-nt", FILNT, BINOP},
|
||||
{"-ot", FILOT, BINOP},
|
||||
{"-ef", FILEQ, BINOP},
|
||||
{"!", UNOT, BUNOP},
|
||||
{"-a", BAND, BBINOP},
|
||||
{"-o", BOR, BBINOP},
|
||||
{"(", LPAREN, PAREN},
|
||||
{")", RPAREN, PAREN},
|
||||
{0, 0, 0}
|
||||
};
|
||||
|
||||
static int expr_is_false __P((struct value *));
|
||||
static void expr_operator __P((int, struct value *, struct filestat *));
|
||||
static void get_int __P((char *, long *));
|
||||
static int lookup_op __P((char *, const char *const *));
|
||||
static void overflow __P((void));
|
||||
static int posix_binary_op __P((char **));
|
||||
static int posix_unary_op __P((char **));
|
||||
static void syntax __P((void));
|
||||
struct t_op const *t_wp_op;
|
||||
char **t_wp;
|
||||
|
||||
static void syntax __P((const char *, const char *));
|
||||
static enum token t_lex __P((char *));
|
||||
static int oexpr __P((enum token));
|
||||
static int aexpr __P((enum token));
|
||||
static int nexpr __P((enum token));
|
||||
static int primary __P((enum token));
|
||||
static int binop __P((void));
|
||||
static int filstat __P((char *, enum token));
|
||||
static int isoperand __P((void));
|
||||
static int getn __P((const char *));
|
||||
static int newerf __P((const char *, const char *));
|
||||
static int olderf __P((const char *, const char *));
|
||||
static int equalf __P((const char *, const char *));
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
char **argv;
|
||||
{
|
||||
struct operator opstack[STACKSIZE];
|
||||
struct operator *opsp;
|
||||
struct value valstack[STACKSIZE + 1];
|
||||
struct value *valsp;
|
||||
struct filestat fs;
|
||||
char c, **ap, *opname, *p;
|
||||
int binary, nest, op = 0, pri, ret_val, skipping;
|
||||
int res;
|
||||
|
||||
if ((p = argv[0]) == NULL)
|
||||
errx(2, "test: argc is zero");
|
||||
|
||||
if (*p != '\0' && p[strlen(p) - 1] == '[') {
|
||||
if (strcmp(argv[0], "[") == 0) {
|
||||
if (strcmp(argv[--argc], "]"))
|
||||
errx(2, "missing ]");
|
||||
argv[argc] = NULL;
|
||||
}
|
||||
ap = argv + 1;
|
||||
fs.name = NULL;
|
||||
|
||||
/*
|
||||
* Test(1) implements an inherently ambiguous grammar. In order to
|
||||
* assure some degree of consistency, we special case the POSIX 1003.2
|
||||
* requirements to assure correct evaluation for POSIX scripts. The
|
||||
* following special cases comply with POSIX P1003.2/D11.2 Section
|
||||
* 4.62.4.
|
||||
*/
|
||||
switch(argc - 1) {
|
||||
case 0: /* % test */
|
||||
return (1);
|
||||
break;
|
||||
case 1: /* % test arg */
|
||||
return (argv[1] == NULL || *argv[1] == '\0') ? 1 : 0;
|
||||
break;
|
||||
case 2: /* % test op arg */
|
||||
opname = argv[1];
|
||||
if (IS_BANG(opname))
|
||||
return (*argv[2] == '\0') ? 0 : 1;
|
||||
else {
|
||||
ret_val = posix_unary_op(&argv[1]);
|
||||
if (ret_val >= 0)
|
||||
return (ret_val);
|
||||
}
|
||||
break;
|
||||
case 3: /* % test arg1 op arg2 */
|
||||
if (IS_BANG(argv[1])) {
|
||||
ret_val = posix_unary_op(&argv[1]);
|
||||
if (ret_val >= 0)
|
||||
return (!ret_val);
|
||||
} else if (lookup_op(argv[2], andor_op) < 0) {
|
||||
ret_val = posix_binary_op(&argv[1]);
|
||||
if (ret_val >= 0)
|
||||
return (ret_val);
|
||||
}
|
||||
break;
|
||||
case 4: /* % test ! arg1 op arg2 */
|
||||
if (IS_BANG(argv[1]) && lookup_op(argv[3], andor_op) < 0 ) {
|
||||
ret_val = posix_binary_op(&argv[2]);
|
||||
if (ret_val >= 0)
|
||||
return (!ret_val);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
/* XXX work around the absence of an eaccess(2) syscall */
|
||||
(void)setgid(getegid());
|
||||
(void)setuid(geteuid());
|
||||
|
||||
/*
|
||||
* We use operator precedence parsing, evaluating the expression as
|
||||
* we parse it. Parentheses are handled by bumping up the priority
|
||||
* of operators using the variable "nest." We use the variable
|
||||
* "skipping" to turn off evaluation temporarily for the short
|
||||
* circuit boolean operators. (It is important do the short circuit
|
||||
* evaluation because under NFS a stat operation can take infinitely
|
||||
* long.)
|
||||
*/
|
||||
opsp = opstack + STACKSIZE;
|
||||
valsp = valstack;
|
||||
nest = skipping = 0;
|
||||
if (*ap == NULL) {
|
||||
valstack[0].type = BOOLEAN;
|
||||
valstack[0].u.num = 0;
|
||||
goto done;
|
||||
}
|
||||
for (;;) {
|
||||
opname = *ap++;
|
||||
if (opname == NULL)
|
||||
syntax();
|
||||
if (opname[0] == '(' && opname[1] == '\0') {
|
||||
nest += NESTINCR;
|
||||
continue;
|
||||
} else if (*ap && (op = lookup_op(opname, unary_op)) >= 0) {
|
||||
if (opsp == &opstack[0])
|
||||
overflow();
|
||||
--opsp;
|
||||
opsp->op = op;
|
||||
opsp->pri = op_priority[op] + nest;
|
||||
continue;
|
||||
} else {
|
||||
valsp->type = STRING;
|
||||
valsp->u.string = opname;
|
||||
valsp++;
|
||||
}
|
||||
for (;;) {
|
||||
opname = *ap++;
|
||||
if (opname == NULL) {
|
||||
if (nest != 0)
|
||||
syntax();
|
||||
pri = 0;
|
||||
break;
|
||||
}
|
||||
if (opname[0] != ')' || opname[1] != '\0') {
|
||||
if ((op = lookup_op(opname, binary_op)) < 0)
|
||||
syntax();
|
||||
op += FIRST_BINARY_OP;
|
||||
pri = op_priority[op] + nest;
|
||||
break;
|
||||
}
|
||||
if ((nest -= NESTINCR) < 0)
|
||||
syntax();
|
||||
}
|
||||
while (opsp < &opstack[STACKSIZE] && opsp->pri >= pri) {
|
||||
binary = opsp->op;
|
||||
for (;;) {
|
||||
valsp--;
|
||||
c = op_argflag[opsp->op];
|
||||
if (c == OP_INT) {
|
||||
if (valsp->type == STRING)
|
||||
get_int(valsp->u.string,
|
||||
&valsp->u.num);
|
||||
valsp->type = INTEGER;
|
||||
} else if (c >= OP_STRING) {
|
||||
/* OP_STRING or OP_FILE */
|
||||
if (valsp->type == INTEGER) {
|
||||
if ((p = malloc(32)) == NULL)
|
||||
err(2, NULL);
|
||||
#ifdef SHELL
|
||||
fmtstr(p, 32, "%d",
|
||||
valsp->u.num);
|
||||
#else
|
||||
(void)sprintf(p,
|
||||
"%ld", valsp->u.num);
|
||||
#endif
|
||||
valsp->u.string = p;
|
||||
} else if (valsp->type == BOOLEAN) {
|
||||
if (valsp->u.num)
|
||||
valsp->u.string =
|
||||
"true";
|
||||
else
|
||||
valsp->u.string = "";
|
||||
}
|
||||
valsp->type = STRING;
|
||||
if (c == OP_FILE && (fs.name == NULL ||
|
||||
strcmp(fs.name, valsp->u.string))) {
|
||||
fs.name = valsp->u.string;
|
||||
fs.rcode =
|
||||
stat(valsp->u.string,
|
||||
&fs.stat);
|
||||
}
|
||||
}
|
||||
if (binary < FIRST_BINARY_OP)
|
||||
break;
|
||||
binary = 0;
|
||||
}
|
||||
if (!skipping)
|
||||
expr_operator(opsp->op, valsp, &fs);
|
||||
else if (opsp->op == AND1 || opsp->op == OR1)
|
||||
skipping--;
|
||||
valsp++; /* push value */
|
||||
opsp++; /* pop operator */
|
||||
}
|
||||
if (opname == NULL)
|
||||
break;
|
||||
if (opsp == &opstack[0])
|
||||
overflow();
|
||||
if (op == AND1 || op == AND2) {
|
||||
op = AND1;
|
||||
if (skipping || expr_is_false(valsp - 1))
|
||||
skipping++;
|
||||
}
|
||||
if (op == OR1 || op == OR2) {
|
||||
op = OR1;
|
||||
if (skipping || !expr_is_false(valsp - 1))
|
||||
skipping++;
|
||||
}
|
||||
opsp--;
|
||||
opsp->op = op;
|
||||
opsp->pri = pri;
|
||||
}
|
||||
done: return (expr_is_false(&valstack[0]));
|
||||
t_wp = &argv[1];
|
||||
res = !oexpr(t_lex(*t_wp));
|
||||
|
||||
if (*t_wp != NULL && *++t_wp != NULL)
|
||||
syntax(*t_wp, "unexpected operator");
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static void
|
||||
syntax(op, msg)
|
||||
const char *op;
|
||||
const char *msg;
|
||||
{
|
||||
|
||||
if (op && *op)
|
||||
errx(2, "%s: %s", op, msg);
|
||||
else
|
||||
errx(2, "%s", msg);
|
||||
}
|
||||
|
||||
static int
|
||||
expr_is_false(val)
|
||||
struct value *val;
|
||||
oexpr(n)
|
||||
enum token n;
|
||||
{
|
||||
int res;
|
||||
|
||||
if (val->type == STRING) {
|
||||
if (val->u.string[0] == '\0')
|
||||
return (1);
|
||||
} else { /* INTEGER or BOOLEAN */
|
||||
if (val->u.num == 0)
|
||||
return (1);
|
||||
}
|
||||
return (0);
|
||||
res = aexpr(n);
|
||||
if (t_lex(*++t_wp) == BOR)
|
||||
return oexpr(t_lex(*++t_wp)) || res;
|
||||
t_wp--;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Execute an operator. Op is the operator. Sp is the stack pointer;
|
||||
* sp[0] refers to the first operand, sp[1] refers to the second operand
|
||||
* (if any), and the result is placed in sp[0]. The operands are converted
|
||||
* to the type expected by the operator before expr_operator is called.
|
||||
* Fs is a pointer to a structure which holds the value of the last call
|
||||
* to stat, to avoid repeated stat calls on the same file.
|
||||
*/
|
||||
static void
|
||||
expr_operator(op, sp, fs)
|
||||
int op;
|
||||
struct value *sp;
|
||||
struct filestat *fs;
|
||||
static int
|
||||
aexpr(n)
|
||||
enum token n;
|
||||
{
|
||||
int i;
|
||||
int res;
|
||||
|
||||
switch (op) {
|
||||
case NOT:
|
||||
sp->u.num = expr_is_false(sp);
|
||||
sp->type = BOOLEAN;
|
||||
break;
|
||||
case ISEXIST:
|
||||
exist:
|
||||
if (fs == NULL || fs->rcode == -1)
|
||||
goto false;
|
||||
else
|
||||
goto true;
|
||||
case ISREAD:
|
||||
if (geteuid() == 0)
|
||||
goto exist;
|
||||
i = S_IROTH;
|
||||
goto permission;
|
||||
case ISWRITE:
|
||||
if (geteuid() != 0)
|
||||
i = S_IWOTH;
|
||||
else {
|
||||
i = S_IWOTH|S_IWGRP|S_IWUSR;
|
||||
goto filebit;
|
||||
res = nexpr(n);
|
||||
if (t_lex(*++t_wp) == BAND)
|
||||
return aexpr(t_lex(*++t_wp)) && res;
|
||||
t_wp--;
|
||||
return res;
|
||||
}
|
||||
|
||||
static int
|
||||
nexpr(n)
|
||||
enum token n; /* token */
|
||||
{
|
||||
if (n == UNOT)
|
||||
return !nexpr(t_lex(*++t_wp));
|
||||
return primary(n);
|
||||
}
|
||||
|
||||
static int
|
||||
primary(n)
|
||||
enum token n;
|
||||
{
|
||||
enum token nn;
|
||||
int res;
|
||||
|
||||
if (n == EOI)
|
||||
return 0; /* missing expression */
|
||||
if (n == LPAREN) {
|
||||
if ((nn = t_lex(*++t_wp)) == RPAREN)
|
||||
return 0; /* missing expression */
|
||||
res = oexpr(nn);
|
||||
if (t_lex(*++t_wp) != RPAREN)
|
||||
syntax(NULL, "closing paren expected");
|
||||
return res;
|
||||
}
|
||||
if (t_wp_op && t_wp_op->op_type == UNOP) {
|
||||
/* unary expression */
|
||||
if (*++t_wp == NULL)
|
||||
syntax(t_wp_op->op_text, "argument expected");
|
||||
switch (n) {
|
||||
case STREZ:
|
||||
return strlen(*t_wp) == 0;
|
||||
case STRNZ:
|
||||
return strlen(*t_wp) != 0;
|
||||
case FILTT:
|
||||
return isatty(getn(*t_wp));
|
||||
default:
|
||||
return filstat(*t_wp, n);
|
||||
}
|
||||
goto permission;
|
||||
case ISEXEC:
|
||||
if (geteuid() != 0) {
|
||||
i = S_IXOTH;
|
||||
permission: if (fs->stat.st_uid == geteuid())
|
||||
i <<= 6;
|
||||
else {
|
||||
gid_t grlist[NGROUPS];
|
||||
int ngroups, j;
|
||||
}
|
||||
|
||||
ngroups = getgroups(NGROUPS, grlist);
|
||||
for (j = 0; j < ngroups; j++)
|
||||
if (fs->stat.st_gid == grlist[j]) {
|
||||
i <<= 3;
|
||||
goto filebit;
|
||||
}
|
||||
}
|
||||
} else
|
||||
i = S_IXOTH|S_IXGRP|S_IXUSR;
|
||||
goto filebit; /* true if (stat.st_mode & i) != 0 */
|
||||
case ISFILE:
|
||||
i = S_IFREG;
|
||||
goto filetype;
|
||||
case ISDIR:
|
||||
i = S_IFDIR;
|
||||
goto filetype;
|
||||
case ISCHAR:
|
||||
i = S_IFCHR;
|
||||
goto filetype;
|
||||
case ISBLOCK:
|
||||
i = S_IFBLK;
|
||||
goto filetype;
|
||||
case ISSYMLINK:
|
||||
i = S_IFLNK;
|
||||
fs->rcode = lstat(sp->u.string, &fs->stat);
|
||||
goto filetype;
|
||||
case ISFIFO:
|
||||
i = S_IFIFO;
|
||||
goto filetype;
|
||||
case ISSOCK:
|
||||
i = S_IFSOCK;
|
||||
goto filetype;
|
||||
filetype: if ((fs->stat.st_mode & S_IFMT) == i && fs->rcode >= 0)
|
||||
true: sp->u.num = 1;
|
||||
else
|
||||
false: sp->u.num = 0;
|
||||
sp->type = BOOLEAN;
|
||||
break;
|
||||
case ISSETUID:
|
||||
i = S_ISUID;
|
||||
goto filebit;
|
||||
case ISSETGID:
|
||||
i = S_ISGID;
|
||||
goto filebit;
|
||||
case ISSTICKY:
|
||||
i = S_ISVTX;
|
||||
filebit: if (fs->stat.st_mode & i && fs->rcode >= 0)
|
||||
goto true;
|
||||
goto false;
|
||||
case ISSIZE:
|
||||
sp->u.num = fs->rcode >= 0 ? fs->stat.st_size : 0L;
|
||||
sp->type = INTEGER;
|
||||
break;
|
||||
case ISTTY:
|
||||
sp->u.num = isatty(sp->u.num);
|
||||
sp->type = BOOLEAN;
|
||||
break;
|
||||
case NULSTR:
|
||||
if (sp->u.string[0] == '\0')
|
||||
goto true;
|
||||
goto false;
|
||||
case STRLEN:
|
||||
sp->u.num = strlen(sp->u.string);
|
||||
sp->type = INTEGER;
|
||||
break;
|
||||
case OR1:
|
||||
case AND1:
|
||||
/*
|
||||
* These operators are mostly handled by the parser. If we
|
||||
* get here it means that both operands were evaluated, so
|
||||
* the value is the value of the second operand.
|
||||
*/
|
||||
*sp = *(sp + 1);
|
||||
break;
|
||||
if (t_lex(t_wp[1]), t_wp_op && t_wp_op->op_type == BINOP) {
|
||||
return binop();
|
||||
}
|
||||
|
||||
return strlen(*t_wp) > 0;
|
||||
}
|
||||
|
||||
static int
|
||||
binop()
|
||||
{
|
||||
const char *opnd1, *opnd2;
|
||||
struct t_op const *op;
|
||||
|
||||
opnd1 = *t_wp;
|
||||
(void) t_lex(*++t_wp);
|
||||
op = t_wp_op;
|
||||
|
||||
if ((opnd2 = *++t_wp) == NULL)
|
||||
syntax(op->op_text, "argument expected");
|
||||
|
||||
switch (op->op_num) {
|
||||
case STREQ:
|
||||
return strcmp(opnd1, opnd2) == 0;
|
||||
case STRNE:
|
||||
i = 0;
|
||||
if (!strcmp(sp->u.string, (sp + 1)->u.string))
|
||||
i++;
|
||||
if (op == STRNE)
|
||||
i = 1 - i;
|
||||
sp->u.num = i;
|
||||
sp->type = BOOLEAN;
|
||||
break;
|
||||
case EQ:
|
||||
if (sp->u.num == (sp + 1)->u.num)
|
||||
goto true;
|
||||
goto false;
|
||||
case NE:
|
||||
if (sp->u.num != (sp + 1)->u.num)
|
||||
goto true;
|
||||
goto false;
|
||||
case GT:
|
||||
if (sp->u.num > (sp + 1)->u.num)
|
||||
goto true;
|
||||
goto false;
|
||||
case LT:
|
||||
if (sp->u.num < (sp + 1)->u.num)
|
||||
goto true;
|
||||
goto false;
|
||||
case LE:
|
||||
if (sp->u.num <= (sp + 1)->u.num)
|
||||
goto true;
|
||||
goto false;
|
||||
case GE:
|
||||
if (sp->u.num >= (sp + 1)->u.num)
|
||||
goto true;
|
||||
goto false;
|
||||
|
||||
return strcmp(opnd1, opnd2) != 0;
|
||||
case STRLT:
|
||||
return strcmp(opnd1, opnd2) < 0;
|
||||
case STRGT:
|
||||
return strcmp(opnd1, opnd2) > 0;
|
||||
case INTEQ:
|
||||
return getn(opnd1) == getn(opnd2);
|
||||
case INTNE:
|
||||
return getn(opnd1) != getn(opnd2);
|
||||
case INTGE:
|
||||
return getn(opnd1) >= getn(opnd2);
|
||||
case INTGT:
|
||||
return getn(opnd1) > getn(opnd2);
|
||||
case INTLE:
|
||||
return getn(opnd1) <= getn(opnd2);
|
||||
case INTLT:
|
||||
return getn(opnd1) < getn(opnd2);
|
||||
case FILNT:
|
||||
return newerf (opnd1, opnd2);
|
||||
case FILOT:
|
||||
return olderf (opnd1, opnd2);
|
||||
case FILEQ:
|
||||
return equalf (opnd1, opnd2);
|
||||
default:
|
||||
abort();
|
||||
/* NOTREACHED */
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
lookup_op(name, table)
|
||||
char *name;
|
||||
const char *const * table;
|
||||
filstat(nm, mode)
|
||||
char *nm;
|
||||
enum token mode;
|
||||
{
|
||||
const char *const * tp;
|
||||
const char *p;
|
||||
char c;
|
||||
struct stat s;
|
||||
|
||||
c = name[1];
|
||||
for (tp = table; (p = *tp) != NULL; tp++)
|
||||
if (p[1] == c && !strcmp(p, name))
|
||||
return (tp - table);
|
||||
return (-1);
|
||||
}
|
||||
if (mode == FILSYM ? lstat(nm, &s) : stat(nm, &s))
|
||||
return 0;
|
||||
|
||||
static int
|
||||
posix_unary_op(argv)
|
||||
char **argv;
|
||||
{
|
||||
struct filestat fs;
|
||||
struct value valp;
|
||||
int op, c;
|
||||
char *opname;
|
||||
|
||||
opname = *argv;
|
||||
if ((op = lookup_op(opname, unary_op)) < 0)
|
||||
return (-1);
|
||||
c = op_argflag[op];
|
||||
opname = argv[1];
|
||||
valp.u.string = opname;
|
||||
if (c == OP_FILE) {
|
||||
fs.name = opname;
|
||||
fs.rcode = stat(opname, &fs.stat);
|
||||
} else if (c != OP_STRING)
|
||||
return (-1);
|
||||
|
||||
expr_operator(op, &valp, &fs);
|
||||
return (valp.u.num == 0);
|
||||
}
|
||||
|
||||
static int
|
||||
posix_binary_op(argv)
|
||||
char **argv;
|
||||
{
|
||||
struct value v[2];
|
||||
int op, c;
|
||||
char *opname;
|
||||
|
||||
opname = argv[1];
|
||||
if ((op = lookup_op(opname, binary_op)) < 0)
|
||||
return (-1);
|
||||
op += FIRST_BINARY_OP;
|
||||
c = op_argflag[op];
|
||||
|
||||
if (c == OP_INT) {
|
||||
get_int(argv[0], &v[0].u.num);
|
||||
get_int(argv[2], &v[1].u.num);
|
||||
} else {
|
||||
v[0].u.string = argv[0];
|
||||
v[1].u.string = argv[2];
|
||||
switch (mode) {
|
||||
case FILRD:
|
||||
return access(nm, R_OK) == 0;
|
||||
case FILWR:
|
||||
return access(nm, W_OK) == 0;
|
||||
case FILEX:
|
||||
/* XXX work around access(2) false positives for superuser */
|
||||
if (access(nm, X_OK) != 0)
|
||||
return 0;
|
||||
if (S_ISDIR(s.st_mode) || getuid() != 0)
|
||||
return 1;
|
||||
return (s.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) != 0;
|
||||
case FILEXIST:
|
||||
return access(nm, F_OK) == 0;
|
||||
case FILREG:
|
||||
return S_ISREG(s.st_mode);
|
||||
case FILDIR:
|
||||
return S_ISDIR(s.st_mode);
|
||||
case FILCDEV:
|
||||
return S_ISCHR(s.st_mode);
|
||||
case FILBDEV:
|
||||
return S_ISBLK(s.st_mode);
|
||||
case FILFIFO:
|
||||
return S_ISFIFO(s.st_mode);
|
||||
case FILSOCK:
|
||||
return S_ISSOCK(s.st_mode);
|
||||
case FILSYM:
|
||||
return S_ISLNK(s.st_mode);
|
||||
case FILSUID:
|
||||
return (s.st_mode & S_ISUID) != 0;
|
||||
case FILSGID:
|
||||
return (s.st_mode & S_ISGID) != 0;
|
||||
case FILSTCK:
|
||||
return (s.st_mode & S_ISVTX) != 0;
|
||||
case FILGZ:
|
||||
return s.st_size > (off_t)0;
|
||||
case FILUID:
|
||||
return s.st_uid == geteuid();
|
||||
case FILGID:
|
||||
return s.st_gid == getegid();
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
expr_operator(op, v, NULL);
|
||||
return (v[0].u.num == 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Integer type checking.
|
||||
*/
|
||||
static void
|
||||
get_int(v, lp)
|
||||
char *v;
|
||||
long *lp;
|
||||
static enum token
|
||||
t_lex(s)
|
||||
char *s;
|
||||
{
|
||||
long val;
|
||||
char *ep;
|
||||
struct t_op const *op = ops;
|
||||
|
||||
for (; *v && isspace(*v); ++v);
|
||||
|
||||
if (!*v) {
|
||||
*lp = 0;
|
||||
return;
|
||||
if (s == 0) {
|
||||
t_wp_op = NULL;
|
||||
return EOI;
|
||||
}
|
||||
|
||||
if (isdigit(*v) || ((*v == '-' || *v == '+') && isdigit(*(v+1)))) {
|
||||
errno = 0;
|
||||
val = strtol(v, &ep, 10);
|
||||
if (*ep != '\0')
|
||||
errx(2, "%s: trailing non-numeric characters", v);
|
||||
if (errno == ERANGE) {
|
||||
if (val == LONG_MIN)
|
||||
errx(2, "%s: underflow", v);
|
||||
if (val == LONG_MAX)
|
||||
errx(2, "%s: overflow", v);
|
||||
while (op->op_text) {
|
||||
if (strcmp(s, op->op_text) == 0) {
|
||||
if ((op->op_type == UNOP && isoperand()) ||
|
||||
(op->op_num == LPAREN && *(t_wp+1) == 0))
|
||||
break;
|
||||
t_wp_op = op;
|
||||
return op->op_num;
|
||||
}
|
||||
*lp = val;
|
||||
return;
|
||||
op++;
|
||||
}
|
||||
errx(2, "%s: expected integer", v);
|
||||
t_wp_op = NULL;
|
||||
return OPERAND;
|
||||
}
|
||||
|
||||
static void
|
||||
syntax()
|
||||
static int
|
||||
isoperand()
|
||||
{
|
||||
struct t_op const *op = ops;
|
||||
char *s;
|
||||
char *t;
|
||||
|
||||
errx(2, "syntax error");
|
||||
if ((s = *(t_wp+1)) == 0)
|
||||
return 1;
|
||||
if ((t = *(t_wp+2)) == 0)
|
||||
return 0;
|
||||
while (op->op_text) {
|
||||
if (strcmp(s, op->op_text) == 0)
|
||||
return op->op_type == BINOP &&
|
||||
(t[0] != ')' || t[1] != '\0');
|
||||
op++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
overflow()
|
||||
/* atoi with error detection */
|
||||
static int
|
||||
getn(s)
|
||||
const char *s;
|
||||
{
|
||||
char *p;
|
||||
long r;
|
||||
|
||||
errx(2, "expression is too complex");
|
||||
errno = 0;
|
||||
r = strtol(s, &p, 10);
|
||||
|
||||
if (errno != 0)
|
||||
errx(2, "%s: out of range", s);
|
||||
|
||||
while (isspace((unsigned char)*p))
|
||||
p++;
|
||||
|
||||
if (*p)
|
||||
errx(2, "%s: bad number", s);
|
||||
|
||||
return (int) r;
|
||||
}
|
||||
|
||||
static int
|
||||
newerf (f1, f2)
|
||||
const char *f1, *f2;
|
||||
{
|
||||
struct stat b1, b2;
|
||||
|
||||
return (stat (f1, &b1) == 0 &&
|
||||
stat (f2, &b2) == 0 &&
|
||||
b1.st_mtime > b2.st_mtime);
|
||||
}
|
||||
|
||||
static int
|
||||
olderf (f1, f2)
|
||||
const char *f1, *f2;
|
||||
{
|
||||
struct stat b1, b2;
|
||||
|
||||
return (stat (f1, &b1) == 0 &&
|
||||
stat (f2, &b2) == 0 &&
|
||||
b1.st_mtime < b2.st_mtime);
|
||||
}
|
||||
|
||||
static int
|
||||
equalf (f1, f2)
|
||||
const char *f1, *f2;
|
||||
{
|
||||
struct stat b1, b2;
|
||||
|
||||
return (stat (f1, &b1) == 0 &&
|
||||
stat (f2, &b2) == 0 &&
|
||||
b1.st_dev == b2.st_dev &&
|
||||
b1.st_ino == b2.st_ino);
|
||||
}
|
||||
@@ -32,6 +32,10 @@ for hesiod zone files. Always use /etc/amd.conf if exists.
|
||||
|
||||
August 8, 1998: add detection support for NFS V.3 for NetBSD 1.3F.
|
||||
|
||||
February 1, 1998: fixes for NetBSD to better detect its features.
|
||||
|
||||
September 4, 1999: assorted fixes for NetBSD 1.4+.
|
||||
|
||||
* Hannes Reinecke <[email protected]>
|
||||
|
||||
Back in 1995, contributed code for linux. A new parser for file system
|
||||
@@ -112,6 +116,15 @@ February 24, 1998: lots of patches for ultrix 4.3 port.
|
||||
|
||||
February 28, 1998: lots of documentation fixes!
|
||||
|
||||
January 8, 1999: texi fixes, and more Ultrix 4.3 fixes, among others.
|
||||
|
||||
January 11, 1999: hesiod_isup function. Fix format errors in dlog/plog.
|
||||
Remove obsolete or unnecessary files/macros. Don't report disabled file
|
||||
systems. More misc fixes.
|
||||
|
||||
February 3, 1998: don't start autofs listener unless autofs maps were in
|
||||
use.
|
||||
|
||||
* Jason Thorpe <[email protected]>
|
||||
|
||||
August 25, 1997: make amd work when talking to NIS+ servers in NIS
|
||||
@@ -154,6 +167,8 @@ November 5, 1997: NFS v.3 support for AIX 4.2.1, which does *not* include
|
||||
headers for this. Bill had to guess at the right structures, field names,
|
||||
sizes, alignment, etc.
|
||||
|
||||
January 15, 1999: small ldap bug fixes.
|
||||
|
||||
* Stefan Vogel <[email protected]>
|
||||
|
||||
November 14, 1997: typo in the subscription instructions to amd-dev.
|
||||
@@ -202,6 +217,8 @@ April 20, 1998: allow arbitrary number of interfaces in wire listing.
|
||||
September 4, 1998: bug fix to avoid overrunning hostname buffer, and minor
|
||||
amd.conf man page typo correction.
|
||||
|
||||
September 22, 1999: use more secure vsnprintf in real_plog().
|
||||
|
||||
* Danny Rathjens <[email protected]>
|
||||
|
||||
October 29, 1998: swap arguments to kill(2) in amd.c.
|
||||
@@ -215,3 +232,45 @@ of a looked up entry before unmounting it.
|
||||
* Douglas K. Rand" <[email protected]>
|
||||
|
||||
December 3, 1998: case insensitive host name match for nfsl.
|
||||
|
||||
* David Wolfskill <[email protected]>
|
||||
January 28, 1999: don't turn on/off noconn option if it was already in that
|
||||
state.
|
||||
|
||||
* Jeffrey C Honig <[email protected]>
|
||||
March 14, 1999: clean up more autogenerated files upon "make distclean".
|
||||
|
||||
March 15, 1999: avoid overly verbose NIS warning even on systems that don't
|
||||
run NIS. On BSD systems, wire.c uses getifaddrs(), sysctl(), IRS routines,
|
||||
and more fixes. Numerous IP packet security fixes.
|
||||
|
||||
March 16, 1999: documentation typos. new cdfs options. ufs structure
|
||||
detection for bsdi4.
|
||||
|
||||
September 17, 1999: fixes to expn.
|
||||
|
||||
* Paul Balyoz <[email protected]>
|
||||
March 26, 1999: ensure lostaltmail displays Y2K compliant dates.
|
||||
|
||||
* Jon Peatfield <[email protected]>
|
||||
March 30, 1999: turn off incomplete NFS V.3 support in HPUX 10.20.
|
||||
|
||||
September 22, 1999: safe reloading of maps without first clearing old
|
||||
copies, and using cached copies if map failed to reload.
|
||||
|
||||
* Peter Breitenlohner <[email protected]>
|
||||
July 24, 1999: patch for linux 2.2.x to work with older libc5 systems, and
|
||||
nis_isup mis-logic fixes.
|
||||
|
||||
* Dale Talcott <[email protected]>
|
||||
July 26, 1999: added NFS3 support for AIX mounting.
|
||||
|
||||
* Christophe Kalt <[email protected]>
|
||||
July 14, 1999: add netgrpd() syntax function which uses FQHN.
|
||||
|
||||
* Andrew J. Korty <[email protected]>
|
||||
September 5, 1999: pawd works for type:=nfsl.
|
||||
|
||||
* Nick Williams <[email protected]>
|
||||
September 1, 1999: bug fix for incorrect symlinks when two locations are
|
||||
requested simultaneously.
|
||||
+42
-6
@@ -5,7 +5,7 @@
|
||||
|
||||
(1) mips-sgi-irix*
|
||||
|
||||
[1A] known to have flakey NFS V.3 and TCP. Amd tends to hang or spin
|
||||
[1A] known to have flaky NFS V.3 and TCP. Amd tends to hang or spin
|
||||
infinitely after a few hours or days of use. Users must install recommended
|
||||
patches from vendor. Patches help, but not all the time. Otherwise avoid
|
||||
using NFS V.3 and TCP on these systems, by setting
|
||||
@@ -14,9 +14,12 @@ using NFS V.3 and TCP on these systems, by setting
|
||||
|
||||
[1B] yp_all() leaks a file descriptor. Eventually amd runs out of file
|
||||
descriptors and hangs. Am-utils circumvents this by using its own version
|
||||
of yp_all which uses udp and iterats over NIS maps. The latter isn't as
|
||||
of yp_all which uses udp and iterates over NIS maps. The latter isn't as
|
||||
reliable as yp_all() which uses TCP, but it is better than hanging.
|
||||
|
||||
(I have some reports that older version of hpux-9, with older libc, also
|
||||
leak file descriptors.)
|
||||
|
||||
|
||||
(2) alpha-unknown-linux-gnu (RedHat Linux 4.2)
|
||||
|
||||
@@ -36,12 +39,35 @@ main()
|
||||
exit(0);
|
||||
}
|
||||
|
||||
It is possible that sufficiently newer version of libc for RH4.2 fix this
|
||||
problem.
|
||||
|
||||
|
||||
(3) mips-dec-ultrix4.3
|
||||
|
||||
Rainer Orth <[email protected]> reports
|
||||
|
||||
[3A] At least the gcc 2.7.0 fixincludes-mangled <sys/utsname.h> needs a
|
||||
[3A] One needs the Kernel Config Files (UDTBIN430) subset installed to
|
||||
compile am-utils, otherwise essential header files (net/if.h, net/route.h,
|
||||
rpcsvc/mount.h, rpcsvc/yp_prot.h, rpcsvc/ypclnt.h, sys/proc.h) are
|
||||
missing.
|
||||
|
||||
[3B] It's probably impossible to build am-utils with DEC C on Ultrix V4.3.
|
||||
This compiler is pseudo-ANSI only. Maybe the new ANSI C compiler in V4.3A
|
||||
and beyond will do. I successfully used gcc 2.8.1.
|
||||
|
||||
[3C] You need to build against a recent libhesiod (I used 3.0.2) and
|
||||
libresolv/lib44bsd (I used BIND 4.9.5-P1). The resolver routines in
|
||||
libc seem to cause random memory corruption. It is necessary to specify
|
||||
LIBS=-l44bsd. lib44bsd is a helper library of libresolv used to supply
|
||||
functions like strdup which are missing on the host system. This isn't
|
||||
currently autoconfiscated.
|
||||
|
||||
[3D] You need to configure with CONFIG_SHELL=/bin/sh5 /bin/sh5 buildall;
|
||||
/bin/sh cannot handle the shell functions used in buildall and is both
|
||||
buggy and slow.
|
||||
|
||||
[3E] At least the gcc 2.7.0 fixincludes-mangled <sys/utsname.h> needs a
|
||||
forward declaration of struct utsname to avoid lots of gcc warnings:
|
||||
|
||||
RCS file: RCS/utsname.h,v
|
||||
@@ -58,9 +84,6 @@ diff -u -r1.1 utsname.h
|
||||
#endif
|
||||
#define __SYS_NMLN 32
|
||||
|
||||
[3B] It autoconfigures and compiles cleanly, but currently hangs after a
|
||||
couple of hours without leaving any traces in the syslog output.
|
||||
|
||||
|
||||
(4) powerpc-ibm-aix4.2.1.0
|
||||
|
||||
@@ -90,3 +113,16 @@ but it is not yet in the glibc-2.0.7-19 RPM.
|
||||
A bug in libc results in an amq binary that doesn't work; amq -v dumps core
|
||||
in xdr_string. There is no known fix (source code or vendor patch) at this
|
||||
time. (Please let amd-dev know if you know of a fix.)
|
||||
|
||||
|
||||
(7) *-aix4.3.2.0
|
||||
|
||||
The plock() function appears to fail with ENOMEM (Not Enough Space). When
|
||||
it fails, it consumes a lot of memory. This appears to be an AIX bug. I
|
||||
think plock returns an error code, but it partially succeeds to lock some
|
||||
pages, thus increasing memory consumption. When partial failures occur, it
|
||||
is possible that AIX fails to unlock those pages it did lock. Solution:
|
||||
turn off usage of plock on AIX. Put plock=no in your amd.conf file (which
|
||||
is the default if you do nothing).
|
||||
|
||||
Erez.
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 1997-1998 Erez Zadok
|
||||
Copyright (c) 1997-1999 Erez Zadok
|
||||
Copyright (c) 1989 Jan-Simon Pendry
|
||||
Copyright (c) 1989 Imperial College of Science, Technology & Medicine
|
||||
Copyright (c) 1989 The Regents of the University of California.
|
||||
|
||||
+2811
-9
File diff suppressed because it is too large.
Load diff
@@ -10,6 +10,7 @@ SYSTEM AUTOCONF COMPILE RUN SHLIB
|
||||
alpha-dec-osf2.1 ezk ezk ezk !ezk
|
||||
alpha-dec-osf4.0 ezk ezk dsr[3] ezk
|
||||
alphaev5-unknown-linux-gnu ezk ezk finkel ezk
|
||||
alphaev5-unknown-linux-gnu-rh5.2 ezk ezk ezk ezk
|
||||
hppa1.0-hp-hpux11.00 ezk ezk ezk
|
||||
hppa1.1-hp-hpux10.10 ezk ezk ezk ezk
|
||||
hppa1.1-hp-hpux10.20 ezk ezk ezk ezk
|
||||
@@ -21,6 +22,7 @@ i386-pc-bsdi2.1 ezk ezk ezk !ezk
|
||||
i386-pc-bsdi3.0 ezk ezk ezk !ezk
|
||||
i386-pc-bsdi3.1 ezk ezk ezk !ezk
|
||||
i386-pc-bsdi4.0 ezk ezk ezk ezk
|
||||
i386-pc-bsdi4.0.1 ezk ezk ezk ezk
|
||||
i386-pc-solaris2.5.1 ezk ezk ezk ezk
|
||||
i386-pc-solaris2.6 ezk ezk ezk ezk
|
||||
i386-pc-solaris2.7 ezk ezk ezk ezk
|
||||
@@ -30,21 +32,36 @@ i386-unknown-freebsd2.2.6 ezk ezk ezk ezk
|
||||
i386-unknown-freebsd2.2.7 ezk ezk ezk ezk
|
||||
i386-unknown-freebsd2.2.8 ezk ezk ezk ezk
|
||||
i386-unknown-freebsd3.0 ezk ezk ezk ezk
|
||||
i386-unknown-freebsdelf3.0 ezk ezk ezk ezk
|
||||
i386-unknown-freebsdelf3.1 ezk ezk ezk ezk
|
||||
i386-unknown-freebsdelf3.2 ezk ezk ezk ezk
|
||||
i386-unknown-freebsdelf3.3 ezk ezk ezk ezk
|
||||
i386-unknown-freebsdelf4.0 ezk ezk ezk ezk
|
||||
i386-unknown-netbsd1.2.1 ezk ezk ezk ezk
|
||||
i386-unknown-netbsd1.3 ezk ezk ezk ezk
|
||||
i386-unknown-netbsd1.3.1 ezk ezk ezk ezk
|
||||
i386-unknown-netbsd1.3.2 ezk ezk ezk ezk
|
||||
i386-unknown-netbsd1.3.3 ezk ezk ezk ezk
|
||||
i386-unknown-netbsd1.4 ezk ezk ezk ezk
|
||||
i386-unknown-openbsd2.1 ezk ezk ezk ezk
|
||||
i386-unknown-openbsd2.2 ezk ezk ezk ezk
|
||||
i386-unknown-openbsd2.3 ezk ezk ezk ezk
|
||||
i386-unknown-openbsd2.4 ezk ezk ezk ezk
|
||||
i386-unknown-openbsd2.5 ezk ezk ezk ezk
|
||||
i486-ncr-sysv4.3.03 ezk ezk ezk
|
||||
i486-pc-linux-gnu-rh6.0 ezk ezk ezk ezk
|
||||
i486-pc-linux-gnulibc1 ezk ezk ezk ezk
|
||||
i486-pc-linux-gnulibc1-rh4.2 ezk ezk ezk ezk
|
||||
i486-pc-linux-gnuoldld ezk ezk ezk ezk
|
||||
i586-pc-linux-gnu ezk ezk ezk ezk
|
||||
i586-pc-linux-gnu-rh5.2 ezk ezk ezk ezk
|
||||
i586-pc-linux-gnu-rh6.0 ezk ezk ezk ezk
|
||||
i586-pc-linux-gnu-rh6.1 ezk ezk ezk ezk
|
||||
i586-pc-linux-gnulibc1 ezk ezk ezk ezk
|
||||
i586-pc-linux-gnulibc1-rh4.2 ezk ezk ezk ezk
|
||||
i686-pc-linux-gnu ezk ezk ezk ezk
|
||||
i686-pc-linux-gnu-rh5.2 ezk ezk ezk ezk
|
||||
i686-pc-linux-gnu-rh6.0 ezk ezk ezk ezk
|
||||
i686-pc-linux-gnulibc ezk ezk ezk ezk
|
||||
i686-pc-linux-gnulibc1 ezk ezk ezk ezk
|
||||
m68k-hp-hpux9.00 ezk[4] ezk[4] nrh/ezk
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Begin3
|
||||
Title: am-utils
|
||||
Version: 6.0
|
||||
Entered-date: 01JAN99
|
||||
Version: 6.0.1
|
||||
Entered-date: 08SEP99
|
||||
Description: BSD Automounter Utilities
|
||||
Replaces the old amd-upl102. Offers NFS V3 support, many
|
||||
new features, and numerous ports. The home page for
|
||||
@@ -10,9 +10,9 @@ Keywords: amd amq hlfsd fsinfo wire-test fixmount mk-amd-map automount
|
||||
Author: [email protected] (Erez Zadok)
|
||||
Maintained-by: [email protected] (Erez Zadok)
|
||||
Primary-site: shekel.mcl.cs.columbia.edu /pub/am-utils
|
||||
1.6MB am-utils-6.0.tar.gz
|
||||
1.6MB am-utils.tar.gz
|
||||
1.6MB am-utils-snapshot.tar.gz
|
||||
1.3MB am-utils-6.0.1.tar.gz
|
||||
1.3MB am-utils.tar.gz
|
||||
1.3MB am-utils-snapshot.tar.gz
|
||||
Alternate-site: http://www.cs.columbia.edu/~ezk/am-utils/mirrors.html
|
||||
Original-site: ftp.cs.columbia.edu /pub/amd
|
||||
Platforms: all modern Unix systems
|
||||
|
||||
+8
-4
@@ -12,11 +12,12 @@ U.S.A:
|
||||
ftp://shekel.mcl.cs.columbia.edu/pub/am-utils
|
||||
Maintainer: [email protected]
|
||||
Minnesota:
|
||||
ftp://ftp.cs.umn.edu/pub/AMD
|
||||
ftp://ftp.cs.umn.edu/pub/am-utils
|
||||
Maintainer: [email protected]
|
||||
Virginia (Newport News):
|
||||
ftp://www.ferginc.com/pub/unix/am-utils
|
||||
ftp://ftp.ferginc.com/pub/unix/am-utils
|
||||
Maintainer: [email protected]
|
||||
Avoid for now: empty directory
|
||||
Ohio (Kent State University):
|
||||
ftp://info.mcs.kent.edu/pub/am-utils
|
||||
Maintainer: [email protected]
|
||||
@@ -25,11 +26,14 @@ Europe:
|
||||
Germany:
|
||||
ftp://ftp.fu-berlin.de/pub/unix/network/am-utils
|
||||
Maintainer: [email protected]
|
||||
Germany:
|
||||
ftp://ftp.tu-darmstadt.de/pub/networking/filesystems/am-utils/
|
||||
Maintainer: [email protected]
|
||||
Sweden:
|
||||
ftp://ftp.sunet.se/pub/unix/admin/am-utils
|
||||
Maintainer: [email protected]
|
||||
Sweden:
|
||||
ftp://ftp.matematik.su.se/pub/mirrors/shekel.mcl.cs.columbia.edu/pub/am-utils
|
||||
Sweden (Stockholm University, Math Depat):
|
||||
ftp://mirror.matematik.su.se/pub/am-utils
|
||||
Maintainer: [email protected]
|
||||
UK:
|
||||
ftp://sunsite.org.uk/packages/am-utils
|
||||
|
||||
@@ -1,3 +1,89 @@
|
||||
# -*- text -*-
|
||||
|
||||
*** Notes specific to am-utils version 6.0.2:
|
||||
|
||||
- safe map reloads: when a map needs to be reloaded, it is reloaded into a
|
||||
temporary copy first. Only if the reload was completely successful, Amd
|
||||
discards the old map and uses the new one. Otherwise Amd continues to use
|
||||
the old maps. This should help a lot with transient NIS problems.
|
||||
|
||||
- amq -f now also forces a (safe) map reload, but only if the timestamp on
|
||||
the maps was updated.
|
||||
|
||||
- two new selector variables: ${vendor} and ${full_os}, which are the same
|
||||
as the output seen in "amd -v".
|
||||
|
||||
- documentation fixes and updates
|
||||
|
||||
- updated or minor new ports:
|
||||
i386-unknown-freebsdelf3.3
|
||||
|
||||
- support 'ignore' flags (automntfs) in bsdi-4.1
|
||||
|
||||
- bugs fixed:
|
||||
expn.pl uses correct sockaddr_in() not, pack()
|
||||
make sure configure --enable-*args take an argument
|
||||
don't busy-loop trying to rebind to ldap servers
|
||||
use vsnprintf, not vsprintf (security)
|
||||
|
||||
*** Notes specific to am-utils version 6.0.1:
|
||||
|
||||
- updated or minor new ports:
|
||||
i386-pc-bsdi4.0.1
|
||||
i386-unknown-freebsdelf3.0
|
||||
i386-unknown-freebsdelf3.1
|
||||
i386-unknown-freebsdelf3.2
|
||||
i386-unknown-freebsdelf4.0
|
||||
i386-unknown-netbsd1.4
|
||||
i386-unknown-openbsd2.5
|
||||
powerpc-unknown-linux-gnu
|
||||
|
||||
- automount2amd added, a new script to convert Sun automount maps to Amd maps
|
||||
|
||||
- new map function netgrpd(ARG), same as netgrp() but matches FQHN
|
||||
|
||||
- 'ignore' is a generic mount option
|
||||
|
||||
- hesiod info service isup() function to check if service is up
|
||||
|
||||
- more Y2K fixes (see README.y2k for the full story)
|
||||
|
||||
- using alloca.c on systems that don't have it (hpux9 with /bin/cc)
|
||||
|
||||
- configure script reduced in size by using M4/sh loops instead of repeated
|
||||
entries
|
||||
|
||||
- documentation updates
|
||||
|
||||
- too many bugs fixed to list here:
|
||||
'addopts' option works with 'remopts' as well as 'opts'
|
||||
AIX can perform NFS V.3 mounts explicitly
|
||||
NIS is_up fixed, especially for NIS+ running in compatibility mode
|
||||
amd -v incorrectly listing file systems that don't really work
|
||||
amd's own mounts use reserved ports if possible
|
||||
browsable directories works for Linux 2.3 (NFS cookies)
|
||||
bsd44 systems check for isofs flags
|
||||
bsd44 systems check for new options: norrio, gens, and extatt
|
||||
buildall works better on Ultrix's /bin/sh
|
||||
compile and build on Linux kernels 2.2 and newer
|
||||
compile and build on RedHat Linux 6.0 (glibc 2.1)
|
||||
compile and build on Solaris 7 (with or without vendor LDAP)
|
||||
completely eliminate all of amd's amq -M code, when not enabled
|
||||
correctly interpret failure code of unmount of type:=program
|
||||
don't create autofs listener service unless used
|
||||
don't list or process amq's -M option unless feature was turned on
|
||||
don't turn on/off noconn option if it was already in that state
|
||||
ldap info service: don't strcmp null strings
|
||||
lostaltmail correctly sets struct sockaddr_in
|
||||
make sure Linux systems have configured kernel headers
|
||||
test for bsize/namlen fields in nfs_args (linux mount versions 2/3)
|
||||
turn off broken NFS V.3 support for HPUX
|
||||
use getifaddrs() on bsd44 systems makes wire.c more reliable
|
||||
use matching NFS rsize/wsize on Linux 2.0 and 2.[123] kernels.
|
||||
verify that RPC requests come from reserved, privileged local ports
|
||||
warn when Linux kernel headers mismatch with running kernel
|
||||
pawd works for type:=nfsl too
|
||||
|
||||
*** Notes specific to am-utils version 6.0:
|
||||
|
||||
- updated or minor new ports:
|
||||
|
||||
@@ -12,6 +12,17 @@ the ctime(3) call.
|
||||
However, on Friday, September 18th 1998, Matthew Crosby <[email protected]>
|
||||
reported that they evaluated 6.0a16 and found it to be compliant.
|
||||
|
||||
On March 26, 1999, Paul Balyoz <[email protected]> submitted a
|
||||
patch to lostaltmail which makes it print Y2K compliant dates. He used a
|
||||
code scanner and manually "eyeballed" the code and could not find any more
|
||||
problems. Paul's patch is included in am-utils-6.0.1s7 and newer versions.
|
||||
Paul also said that other 2-digit years used in am-utils are "harmless."
|
||||
|
||||
|
||||
NOTE: NONE OF THE PERSONS MENTIONED HERE, AUTHOR INCLUDED, ARE WILLING TO
|
||||
CERTIFY AM-UTILS AS Y2K COMPLIANT. USE AT YOUR OWN RISK.
|
||||
|
||||
---
|
||||
Erez Zadok.
|
||||
Maintainer, am-utils package and AMD-DEV list.
|
||||
Email: [email protected]
|
||||
|
||||
+27
-10
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1989 Jan-Simon Pendry
|
||||
* Copyright (c) 1989 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1989 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: am_ops.c,v 1.2 1998/12/27 06:24:45 ezk Exp $
|
||||
* $Id: am_ops.c,v 1.4 1999/03/13 17:03:26 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -164,7 +164,7 @@ ops_showamfstypes(char *buf)
|
||||
if (ap[1])
|
||||
strcat(buf, ", ");
|
||||
l += strlen((*ap)->fs_type) + 2;
|
||||
if (l > 60) {
|
||||
if (l > 62) {
|
||||
l = 0;
|
||||
strcat(buf, "\n ");
|
||||
}
|
||||
@@ -413,15 +413,32 @@ ops_match(am_opts *fo, char *key, char *g_key, char *path, char *keym, char *map
|
||||
|
||||
/*
|
||||
* If addopts option was used, then append it to the
|
||||
* current options.
|
||||
* current options and remote mount options.
|
||||
*/
|
||||
if (fo->opt_addopts) {
|
||||
char *mergedstr;
|
||||
mergedstr = merge_opts(fo->opt_opts, fo->opt_addopts);
|
||||
plog(XLOG_USER, "merge opts \"%s\" add \"%s\" => \"%s\"",
|
||||
fo->opt_opts, fo->opt_addopts, mergedstr);
|
||||
XFREE(fo->opt_opts);
|
||||
fo->opt_opts = mergedstr;
|
||||
if (STREQ(fo->opt_opts, fo->opt_remopts)) {
|
||||
/* optimize things for the common case where opts==remopts */
|
||||
char *mergedstr;
|
||||
mergedstr = merge_opts(fo->opt_opts, fo->opt_addopts);
|
||||
plog(XLOG_USER, "merge rem/opts \"%s\" add \"%s\" => \"%s\"",
|
||||
fo->opt_opts, fo->opt_addopts, mergedstr);
|
||||
XFREE(fo->opt_opts);
|
||||
XFREE(fo->opt_remopts);
|
||||
fo->opt_opts = mergedstr;
|
||||
fo->opt_remopts = strdup(mergedstr);
|
||||
} else {
|
||||
char *mergedstr, *remmergedstr;
|
||||
mergedstr = merge_opts(fo->opt_opts, fo->opt_addopts);
|
||||
plog(XLOG_USER, "merge opts \"%s\" add \"%s\" => \"%s\"",
|
||||
fo->opt_opts, fo->opt_addopts, mergedstr);
|
||||
XFREE(fo->opt_opts);
|
||||
fo->opt_opts = mergedstr;
|
||||
remmergedstr = merge_opts(fo->opt_remopts, fo->opt_addopts);
|
||||
plog(XLOG_USER, "merge remopts \"%s\" add \"%s\" => \"%s\"",
|
||||
fo->opt_remopts, fo->opt_addopts, remmergedstr);
|
||||
XFREE(fo->opt_remopts);
|
||||
fo->opt_remopts = remmergedstr;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+17
-8
@@ -1,5 +1,5 @@
|
||||
.\"
|
||||
.\" Copyright (c) 1997-1998 Erez Zadok
|
||||
.\" Copyright (c) 1997-1999 Erez Zadok
|
||||
.\" Copyright (c) 1989 Jan-Simon Pendry
|
||||
.\" Copyright (c) 1989 Imperial College of Science, Technology & Medicine
|
||||
.\" Copyright (c) 1989 The Regents of the University of California.
|
||||
@@ -38,7 +38,8 @@
|
||||
.\"
|
||||
.\" %W% (Berkeley) %G%
|
||||
.\"
|
||||
.\" $Id: amd.8,v 1.2 1998/09/05 05:52:24 obrien Exp $
|
||||
.\" $Id: amd.8,v 1.3 1999/09/30 21:01:29 ezk Exp $
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd April 19, 1994
|
||||
.Dt AMD 8
|
||||
@@ -59,7 +60,7 @@
|
||||
.Ek
|
||||
.Op Fl l Ar logfile
|
||||
.Op Fl o Ar op_sys_ver
|
||||
.Op Fl t Ar interval.interval
|
||||
.Op Fl t Ar timeout.retransmit
|
||||
.Bk -words
|
||||
.Op Fl w Ar interval
|
||||
.Ek
|
||||
@@ -174,13 +175,21 @@ been auto-mounted,
|
||||
.Nm amd
|
||||
.Em inherits
|
||||
it.
|
||||
.It Fl t Ar interval.interval
|
||||
Specify the
|
||||
.It Fl t Ar timeout.retransmit
|
||||
Specify the NFS timeout
|
||||
.Ar interval ,
|
||||
in tenths of a second, between
|
||||
.Tn NFS/RPC/UDP
|
||||
retries. The default is 0.8 seconds. The second values alters the retransmit
|
||||
counter. Useful defaults are supplied if either or both values are missing.
|
||||
.Tn NFS/RPC
|
||||
retries (for UDP only). The default
|
||||
is 0.8 seconds. The second value alters the restransmit counter, which
|
||||
defaults to 11 retransmissions. Both of these values are used by the kernel
|
||||
to communicate with amd. Useful defaults are supplied if either or both
|
||||
values are missing.
|
||||
.Pp
|
||||
Amd relies on the kernel RPC retransmit mechanism to trigger mount retries.
|
||||
The values of these parameters change the overall retry interval. Too long
|
||||
an interval gives poor interactive response; too short an interval causes
|
||||
excessive retries.
|
||||
.It Fl v
|
||||
Version. Displays version and configuration information on standard error.
|
||||
.It Fl w Ar interval
|
||||
|
||||
+21
-15
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1989 Jan-Simon Pendry
|
||||
* Copyright (c) 1989 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1989 The Regents of the University of California.
|
||||
@@ -38,7 +38,8 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: amd.c,v 1.3 1998/11/14 03:13:19 obrien Exp $
|
||||
* $Id: amd.c,v 1.6 1999/09/30 21:01:29 ezk Exp $
|
||||
* $FreeBSD$
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -55,13 +56,7 @@
|
||||
struct amu_global_options gopt; /* where global options are stored */
|
||||
|
||||
char pid_fsname[16 + MAXHOSTNAMELEN]; /* "kiska.southseas.nz:(pid%d)" */
|
||||
#if 0
|
||||
char *progname; /* "amd" */
|
||||
#endif
|
||||
char *hostdomain = "unknown.domain";
|
||||
#if 0
|
||||
char hostname[MAXHOSTNAMELEN + 1] = "localhost"; /* Hostname */
|
||||
#endif
|
||||
char hostd[2 * MAXHOSTNAMELEN + 1]; /* Host+domain */
|
||||
char *endian = ARCH_ENDIAN; /* Big or Little endian */
|
||||
char *cpu = HOST_CPU; /* CPU type */
|
||||
@@ -73,11 +68,6 @@ int orig_umask = 022;
|
||||
int select_intr_valid;
|
||||
|
||||
jmp_buf select_intr;
|
||||
#if 0
|
||||
pid_t mypid; /* Current process id */
|
||||
serv_state amd_state;
|
||||
int foreground = 1; /* This is the top-level server */
|
||||
#endif
|
||||
struct amd_stats amd_stats; /* Server statistics */
|
||||
struct in_addr myipaddr; /* (An) IP address of this host */
|
||||
time_t do_mapc_reload = 0; /* mapc_reload() call required? */
|
||||
@@ -259,6 +249,12 @@ init_global_options(void)
|
||||
/* OS version */
|
||||
gopt.op_sys_ver = HOST_OS_VERSION;
|
||||
|
||||
/* full OS name and version */
|
||||
gopt.op_sys_full = HOST_OS;
|
||||
|
||||
/* OS version */
|
||||
gopt.op_sys_vendor = HOST_VENDOR;
|
||||
|
||||
/* pid file */
|
||||
gopt.pid_file = "/dev/stdout";
|
||||
|
||||
@@ -490,7 +486,7 @@ main(int argc, char *argv[])
|
||||
* can mount the automounter.
|
||||
*/
|
||||
amu_get_myaddress(&myipaddr);
|
||||
plog(XLOG_INFO, "My ip addr is 0x%x", htonl(myipaddr.s_addr));
|
||||
plog(XLOG_INFO, "My ip addr is %s", inet_ntoa(myipaddr));
|
||||
|
||||
/* avoid hanging on other NFS servers if started elsewhere */
|
||||
if (chdir("/") < 0)
|
||||
@@ -500,7 +496,7 @@ main(int argc, char *argv[])
|
||||
* Now check we are root.
|
||||
*/
|
||||
if (geteuid() != 0) {
|
||||
plog(XLOG_FATAL, "Must be root to mount filesystems (euid = %d)", geteuid());
|
||||
plog(XLOG_FATAL, "Must be root to mount filesystems (euid = %ld)", (long) geteuid());
|
||||
going_down(1);
|
||||
}
|
||||
|
||||
@@ -509,6 +505,16 @@ main(int argc, char *argv[])
|
||||
*/
|
||||
#ifdef HAVE_PLOCK
|
||||
if (gopt.flags & CFM_PROCESS_LOCK) {
|
||||
# ifdef _AIX
|
||||
/*
|
||||
* On AIX you must lower the stack size using ulimit() before calling
|
||||
* plock. Otherwise plock will reserve a lot of memory space based on
|
||||
* your maximum stack size limit. Since it is not easily possible to
|
||||
* tell what should the limit be, I print a warning before calling
|
||||
* plock(). See the manual pages for ulimit(1,3,4) on your AIX system.
|
||||
*/
|
||||
plog(XLOG_WARNING, "AIX: may need to lower stack size using ulimit(3) before calling plock");
|
||||
# endif /* _AIX */
|
||||
if (plock(PROCLOCK) != 0) {
|
||||
plog(XLOG_WARNING, "Couldn't lock process text and data segment in memory: %m");
|
||||
} else {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: amd.h,v 1.1.1.1 1998/11/05 02:04:51 ezk Exp $
|
||||
* $Id: amd.h,v 1.4 1999/09/30 21:01:29 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -106,8 +106,10 @@ struct amu_global_options {
|
||||
char *cluster; /* cluster name */
|
||||
char *karch; /* kernel architecture */
|
||||
char *logfile; /* amd log file */
|
||||
char *op_sys; /* operating system name */
|
||||
char *op_sys_ver; /* OS version */
|
||||
char *op_sys; /* operating system name ${os} */
|
||||
char *op_sys_ver; /* OS version ${osver} */
|
||||
char *op_sys_full; /* full OS name ${full_os} */
|
||||
char *op_sys_vendor; /* name of OS vendor ${vendor} */
|
||||
char *pid_file; /* PID file */
|
||||
char *sub_domain; /* local domain */
|
||||
char *map_options; /* global map options */
|
||||
@@ -163,6 +165,7 @@ struct mnt_map {
|
||||
short flags; /* Allocation flags */
|
||||
short alloc; /* Allocation mode */
|
||||
time_t modify; /* Modify time of map */
|
||||
u_int reloads; /* Number of times map was reloaded */
|
||||
char *map_name; /* Name of this map */
|
||||
char *wildcard; /* Wildcard value */
|
||||
reload_fn *reload; /* Function to be used for reloads */
|
||||
@@ -280,6 +283,7 @@ extern bool_t xdr_mountres3(XDR *xdrs, mountres3 *objp);
|
||||
#ifdef HAVE_FS_AUTOFS
|
||||
extern SVCXPRT *autofsxprt;
|
||||
extern u_short autofs_port;
|
||||
extern int amd_use_autofs;
|
||||
|
||||
extern int autofs_mount(am_node *mp);
|
||||
extern int autofs_umount(am_node *mp);
|
||||
|
||||
+87
-78
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: amfs_auto.c,v 1.1.1.1 1998/11/05 02:04:46 ezk Exp $
|
||||
* $Id: amfs_auto.c,v 1.5 1999/09/30 21:01:29 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -60,12 +60,13 @@
|
||||
/* DEVELOPERS: turn this on for special debugging of readdir code */
|
||||
#undef DEBUG_READDIR
|
||||
|
||||
#define DOT_DOT_COOKIE (u_int) 1
|
||||
|
||||
/****************************************************************************
|
||||
*** STRUCTURES ***
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*** FORWARD DEFINITIONS ***
|
||||
****************************************************************************/
|
||||
@@ -448,59 +449,59 @@ try_mount(voidp mvp)
|
||||
* Pick a file system to try mounting and
|
||||
* do that in the background if necessary
|
||||
*
|
||||
For each location:
|
||||
if it is new -defaults then
|
||||
extract and process
|
||||
continue;
|
||||
fi
|
||||
if it is a cut then
|
||||
if a location has been tried then
|
||||
break;
|
||||
fi
|
||||
continue;
|
||||
fi
|
||||
parse mount location
|
||||
discard previous mount location if required
|
||||
find matching mounted filesystem
|
||||
if not applicable then
|
||||
this_error = No such file or directory
|
||||
continue
|
||||
fi
|
||||
if the filesystem failed to be mounted then
|
||||
this_error = error from filesystem
|
||||
elif the filesystem is mounting or unmounting then
|
||||
this_error = -1
|
||||
elif the fileserver is down then
|
||||
this_error = -1
|
||||
elif the filesystem is already mounted
|
||||
this_error = 0
|
||||
break
|
||||
fi
|
||||
if no error on this mount then
|
||||
this_error = initialize mount point
|
||||
fi
|
||||
if no error on this mount and mount is delayed then
|
||||
this_error = -1
|
||||
fi
|
||||
if this_error < 0 then
|
||||
retry = true
|
||||
fi
|
||||
if no error on this mount then
|
||||
make mount point if required
|
||||
fi
|
||||
if no error on this mount then
|
||||
if mount in background then
|
||||
run mount in background
|
||||
return -1
|
||||
else
|
||||
this_error = mount in foreground
|
||||
fi
|
||||
fi
|
||||
if an error occurred on this mount then
|
||||
update stats
|
||||
save error in mount point
|
||||
fi
|
||||
endfor
|
||||
For each location:
|
||||
if it is new -defaults then
|
||||
extract and process
|
||||
continue;
|
||||
fi
|
||||
if it is a cut then
|
||||
if a location has been tried then
|
||||
break;
|
||||
fi
|
||||
continue;
|
||||
fi
|
||||
parse mount location
|
||||
discard previous mount location if required
|
||||
find matching mounted filesystem
|
||||
if not applicable then
|
||||
this_error = No such file or directory
|
||||
continue
|
||||
fi
|
||||
if the filesystem failed to be mounted then
|
||||
this_error = error from filesystem
|
||||
elif the filesystem is mounting or unmounting then
|
||||
this_error = -1
|
||||
elif the fileserver is down then
|
||||
this_error = -1
|
||||
elif the filesystem is already mounted
|
||||
this_error = 0
|
||||
break
|
||||
fi
|
||||
if no error on this mount then
|
||||
this_error = initialize mount point
|
||||
fi
|
||||
if no error on this mount and mount is delayed then
|
||||
this_error = -1
|
||||
fi
|
||||
if this_error < 0 then
|
||||
retry = true
|
||||
fi
|
||||
if no error on this mount then
|
||||
make mount point if required
|
||||
fi
|
||||
if no error on this mount then
|
||||
if mount in background then
|
||||
run mount in background
|
||||
return -1
|
||||
else
|
||||
this_error = mount in foreground
|
||||
fi
|
||||
fi
|
||||
if an error occurred on this mount then
|
||||
update stats
|
||||
save error in mount point
|
||||
fi
|
||||
endfor
|
||||
*/
|
||||
static int
|
||||
amfs_auto_bgmount(struct continuation * cp, int mpe)
|
||||
@@ -609,8 +610,8 @@ amfs_auto_bgmount(struct continuation * cp, int mpe)
|
||||
* Don't try logging the string from mf, since it may be bad!
|
||||
*/
|
||||
if (cp->fs_opts.opt_fs != mf->mf_fo->opt_fs)
|
||||
plog(XLOG_ERROR, "use %s instead of 0x%x",
|
||||
cp->fs_opts.opt_fs, mf->mf_fo->opt_fs);
|
||||
plog(XLOG_ERROR, "use %s instead of 0x%lx",
|
||||
cp->fs_opts.opt_fs, (unsigned long) mf->mf_fo->opt_fs);
|
||||
|
||||
mp->am_link = str3cat((char *) 0,
|
||||
cp->fs_opts.opt_fs, "/", link_dir);
|
||||
@@ -695,7 +696,7 @@ amfs_auto_bgmount(struct continuation * cp, int mpe)
|
||||
int i = atoi(mf->mf_fo->opt_delay);
|
||||
if (i > 0 && clocktime() < (cp->start + i)) {
|
||||
#ifdef DEBUG
|
||||
dlog("Mount of %s delayed by %ds", mf->mf_mount, i - clocktime() + cp->start);
|
||||
dlog("Mount of %s delayed by %lds", mf->mf_mount, (long) (i - clocktime() + cp->start));
|
||||
#endif /* DEBUG */
|
||||
this_error = -1;
|
||||
}
|
||||
@@ -705,6 +706,10 @@ amfs_auto_bgmount(struct continuation * cp, int mpe)
|
||||
if (!mf_retry)
|
||||
mf_retry = dup_mntfs(mf);
|
||||
cp->retry = TRUE;
|
||||
#ifdef DEBUG
|
||||
dlog("will retry ...\n");
|
||||
#endif /* DEBUG */
|
||||
break;
|
||||
}
|
||||
|
||||
if (!this_error) {
|
||||
@@ -764,8 +769,9 @@ amfs_auto_bgmount(struct continuation * cp, int mpe)
|
||||
* Rewind the location vector and
|
||||
* reset the default options.
|
||||
*/
|
||||
cp->ivec = cp->xivec;
|
||||
cp->def_opts = strealloc(cp->def_opts, cp->auto_opts);
|
||||
#ifdef DEBUG
|
||||
dlog("(skipping rewind)\n");
|
||||
#endif /* DEBUG */
|
||||
/*
|
||||
* Arrange that amfs_auto_bgmount is called
|
||||
* after anything else happens.
|
||||
@@ -992,7 +998,7 @@ amfs_auto_lookuppn(am_node *mp, char *fname, int *error_return, int op)
|
||||
if (error) {
|
||||
#ifdef DEBUG
|
||||
errno = error; /* XXX */
|
||||
dlog("Returning error: %m", error);
|
||||
dlog("Returning error: %m");
|
||||
#endif /* DEBUG */
|
||||
XFREE(fname);
|
||||
ereturn(error);
|
||||
@@ -1321,7 +1327,7 @@ amfs_auto_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, i
|
||||
* fairly unbelievable) then tough.
|
||||
*/
|
||||
#ifdef DEBUG
|
||||
dlog("default search");
|
||||
dlog("amfs_auto_readdir: default search");
|
||||
#endif /* DEBUG */
|
||||
/*
|
||||
* Check for enough room. This is extremely approximate but is more
|
||||
@@ -1350,8 +1356,7 @@ amfs_auto_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, i
|
||||
ep[1].ne_fileid = mp->am_gen;
|
||||
ep[1].ne_name = "..";
|
||||
ep[1].ne_nextentry = 0;
|
||||
*(u_int *) ep[1].ne_cookie =
|
||||
xp ? xp->am_gen : ~(u_int) 0;
|
||||
*(u_int *) ep[1].ne_cookie = (xp ? xp->am_gen : DOT_DOT_COOKIE);
|
||||
|
||||
if (!xp)
|
||||
dp->dl_eof = TRUE; /* by default assume readdir done */
|
||||
@@ -1359,12 +1364,12 @@ amfs_auto_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, i
|
||||
return 0;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
dlog("real child");
|
||||
dlog("amfs_auto_readdir: real child");
|
||||
#endif /* DEBUG */
|
||||
|
||||
if (gen == ~(u_int) 0) {
|
||||
if (gen == DOT_DOT_COOKIE) {
|
||||
#ifdef DEBUG
|
||||
dlog("End of readdir in %s", mp->am_path);
|
||||
dlog("amfs_auto_readdir: End of readdir in %s", mp->am_path);
|
||||
#endif /* DEBUG */
|
||||
dp->dl_eof = TRUE;
|
||||
dp->dl_entries = 0;
|
||||
@@ -1379,6 +1384,7 @@ amfs_auto_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, i
|
||||
if (xp) {
|
||||
int nbytes = count / 2; /* conservative */
|
||||
int todo = MAX_READDIR_ENTRIES;
|
||||
|
||||
dp->dl_entries = ep;
|
||||
do {
|
||||
am_node *xp_next = next_nonerror_node(xp->am_osib);
|
||||
@@ -1386,7 +1392,7 @@ amfs_auto_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, i
|
||||
if (xp_next) {
|
||||
*(u_int *) ep->ne_cookie = xp_next->am_gen;
|
||||
} else {
|
||||
*(u_int *) ep->ne_cookie = ~(u_int) 0;
|
||||
*(u_int *) ep->ne_cookie = DOT_DOT_COOKIE;
|
||||
dp->dl_eof = TRUE;
|
||||
}
|
||||
|
||||
@@ -1444,7 +1450,7 @@ amfs_auto_readdir_browsable(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsen
|
||||
* fairly unbelievable) then tough.
|
||||
*/
|
||||
#ifdef DEBUG
|
||||
dlog("default search");
|
||||
dlog("amfs_auto_readdir_browsable: default search");
|
||||
#endif /* DEBUG */
|
||||
/*
|
||||
* Check for enough room. This is extremely approximate but is more
|
||||
@@ -1484,7 +1490,7 @@ amfs_auto_readdir_browsable(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsen
|
||||
ep[1].ne_fileid = mp->am_gen;
|
||||
ep[1].ne_name = "..";
|
||||
ep[1].ne_nextentry = 0;
|
||||
*(u_int *) ep[1].ne_cookie = ~(u_int) 0;
|
||||
*(u_int *) ep[1].ne_cookie = DOT_DOT_COOKIE;
|
||||
|
||||
/*
|
||||
* If map is browsable, call a function make_entry_chain() to construct
|
||||
@@ -1496,8 +1502,7 @@ amfs_auto_readdir_browsable(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsen
|
||||
if (!te)
|
||||
return 0;
|
||||
#ifdef DEBUG_READDIR
|
||||
j = 0;
|
||||
for (ne=te; ne; ne=ne->ne_nextentry)
|
||||
for (j=0,ne=te; ne; ne=ne->ne_nextentry)
|
||||
plog(XLOG_INFO, "gen1 key %4d \"%s\"", j++, ne->ne_name);
|
||||
#endif /* DEBUG_READDIR */
|
||||
|
||||
@@ -1518,19 +1523,23 @@ amfs_auto_readdir_browsable(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsen
|
||||
}
|
||||
ep[1].ne_nextentry = te; /* append this chunk of "te" chain */
|
||||
#ifdef DEBUG_READDIR
|
||||
for (ne=te; ne; ne=ne->ne_nextentry)
|
||||
for (j=0,ne=te; ne; ne=ne->ne_nextentry)
|
||||
plog(XLOG_INFO, "gen2 key %4d \"%s\"", j++, ne->ne_name);
|
||||
for (j=0,ne=ep; ne; ne=ne->ne_nextentry)
|
||||
plog(XLOG_INFO, "gen2+ key %4d \"%s\" fi=%d ck=%d",
|
||||
j++, ne->ne_name, ne->ne_fileid, *(u_int *)ne->ne_cookie);
|
||||
plog(XLOG_INFO, "EOF is %d", dp->dl_eof);
|
||||
#endif /* DEBUG_READDIR */
|
||||
return 0;
|
||||
} /* end of "if (gen == 0)" statement */
|
||||
|
||||
#ifdef DEBUG
|
||||
dlog("real child");
|
||||
dlog("amfs_auto_readdir_browsable: real child");
|
||||
#endif /* DEBUG */
|
||||
|
||||
if (gen == ~(u_int) 0) {
|
||||
if (gen == DOT_DOT_COOKIE) {
|
||||
#ifdef DEBUG
|
||||
dlog("End of readdir in %s", mp->am_path);
|
||||
dlog("amfs_auto_readdir_browsable: End of readdir in %s", mp->am_path);
|
||||
#endif /* DEBUG */
|
||||
dp->dl_eof = TRUE;
|
||||
dp->dl_entries = 0;
|
||||
@@ -1572,7 +1581,7 @@ amfs_auto_readdir_browsable(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsen
|
||||
dp->dl_entries = ep;
|
||||
#ifdef DEBUG_READDIR
|
||||
plog(XLOG_INFO, "dl_entries=0x%x, te_next=0x%x, dl_eof=%d",
|
||||
dp->dl_entries, te_next, dp->dl_eof);
|
||||
(int) dp->dl_entries, (int) te_next, dp->dl_eof);
|
||||
for (ne=te; ne; ne=ne->ne_nextentry)
|
||||
plog(XLOG_INFO, "gen3 key %4d \"%s\"", j++, ne->ne_name);
|
||||
#endif /* DEBUG_READDIR */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: amfs_direct.c,v 1.1.1.1 1998/11/05 02:04:46 ezk Exp $
|
||||
* $Id: amfs_direct.c,v 1.2 1999/01/10 21:53:41 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1989 Jan-Simon Pendry
|
||||
* Copyright (c) 1989 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1989 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: amfs_error.c,v 1.1.1.1 1998/11/05 02:04:46 ezk Exp $
|
||||
* $Id: amfs_error.c,v 1.2 1999/01/10 21:53:41 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: amfs_host.c,v 1.1.1.1 1998/11/05 02:04:46 ezk Exp $
|
||||
* $Id: amfs_host.c,v 1.3 1999/01/13 23:30:57 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -224,7 +224,7 @@ fetch_fhandle(CLIENT * client, char *dir, am_nfs_handle_t *fhp, u_long nfs_versi
|
||||
* get the filehandle. Use NFS version specific call.
|
||||
*/
|
||||
|
||||
plog(XLOG_INFO, "fetch_fhandle: NFS version %d", nfs_version);
|
||||
plog(XLOG_INFO, "fetch_fhandle: NFS version %d", (int) nfs_version);
|
||||
#ifdef HAVE_FS_NFS3
|
||||
if (nfs_version == NFS_VERSION3) {
|
||||
memset((char *) &fhp->v3, 0, sizeof(fhp->v3));
|
||||
@@ -335,7 +335,7 @@ amfs_host_fmount(mntfs *mf)
|
||||
*/
|
||||
host = mf->mf_server->fs_host;
|
||||
sin = *mf->mf_server->fs_ip;
|
||||
plog(XLOG_INFO, "amfs_host_fmount: NFS version %d", mf->mf_server->fs_version);
|
||||
plog(XLOG_INFO, "amfs_host_fmount: NFS version %d", (int) mf->mf_server->fs_version);
|
||||
#ifdef HAVE_FS_NFS3
|
||||
if (mf->mf_server->fs_version == NFS_VERSION3)
|
||||
mnt_version = MOUNTVERS3;
|
||||
@@ -630,7 +630,7 @@ amfs_host_umounted(am_node *mp)
|
||||
*/
|
||||
host = mf->mf_server->fs_host;
|
||||
sin = *mf->mf_server->fs_ip;
|
||||
plog(XLOG_INFO, "amfs_host_umounted: NFS version %d", mf->mf_server->fs_version);
|
||||
plog(XLOG_INFO, "amfs_host_umounted: NFS version %d", (int) mf->mf_server->fs_version);
|
||||
#ifdef HAVE_FS_NFS3
|
||||
if (mf->mf_server->fs_version == NFS_VERSION3)
|
||||
mnt_version = MOUNTVERS3;
|
||||
@@ -674,7 +674,7 @@ amfs_host_umounted(am_node *mp)
|
||||
if (clnt_stat != RPC_SUCCESS && clnt_stat != RPC_SYSTEMERROR) {
|
||||
/* RPC_SYSTEMERROR seems to be returned for no good reason ... */
|
||||
const char *msg = clnt_sperrno(clnt_stat);
|
||||
plog(XLOG_ERROR, "unmount all from %s rpc failed: %s", host, msg, clnt_stat);
|
||||
plog(XLOG_ERROR, "unmount all from %s rpc failed: %s", host, msg);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1989 Jan-Simon Pendry
|
||||
* Copyright (c) 1989 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1989 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: amfs_inherit.c,v 1.1.1.1 1998/11/05 02:04:47 ezk Exp $
|
||||
* $Id: amfs_inherit.c,v 1.2 1999/01/10 21:53:41 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: amfs_link.c,v 1.1.1.1 1998/11/05 02:04:47 ezk Exp $
|
||||
* $Id: amfs_link.c,v 1.2 1999/01/10 21:53:42 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: amfs_linkx.c,v 1.1.1.1 1998/11/05 02:04:47 ezk Exp $
|
||||
* $Id: amfs_linkx.c,v 1.2 1999/01/10 21:53:42 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: amfs_nfsl.c,v 1.2 1998/12/27 06:24:45 ezk Exp $
|
||||
* $Id: amfs_nfsl.c,v 1.3 1999/01/10 21:53:42 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: amfs_nfsx.c,v 1.1.1.1 1998/11/05 02:04:47 ezk Exp $
|
||||
* $Id: amfs_nfsx.c,v 1.2 1999/01/10 21:53:42 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1989 Jan-Simon Pendry
|
||||
* Copyright (c) 1989 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1989 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: amfs_program.c,v 1.1.1.1 1998/11/05 02:04:47 ezk Exp $
|
||||
* $Id: amfs_program.c,v 1.5 1999/09/30 21:01:30 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -89,7 +89,7 @@ amfs_program_match(am_opts *fo)
|
||||
char *prog;
|
||||
|
||||
if (!fo->opt_mount || !fo->opt_unmount) {
|
||||
plog(XLOG_USER, "program: no mount/unmount specified");
|
||||
plog(XLOG_ERROR, "program: both mount and unmount must be specified");
|
||||
return 0;
|
||||
}
|
||||
prog = strchr(fo->opt_mount, ' ');
|
||||
@@ -131,6 +131,8 @@ amfs_program_exec(char *info)
|
||||
* Put stdout to stderr
|
||||
*/
|
||||
(void) fclose(stdout);
|
||||
if (!logfp)
|
||||
logfp = stderr; /* initialize before possible first use */
|
||||
(void) dup(fileno(logfp));
|
||||
if (fileno(logfp) != fileno(stderr)) {
|
||||
(void) fclose(stderr);
|
||||
@@ -145,7 +147,7 @@ amfs_program_exec(char *info)
|
||||
char **cp = xivec;
|
||||
plog(XLOG_DEBUG, "executing (un)mount command...");
|
||||
while (*cp) {
|
||||
plog(XLOG_DEBUG, "arg[%d] = '%s'", cp - xivec, *cp);
|
||||
plog(XLOG_DEBUG, "arg[%ld] = '%s'", (long) (cp - xivec), *cp);
|
||||
cp++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: amfs_root.c,v 1.1.1.1 1998/11/05 02:04:47 ezk Exp $
|
||||
* $Id: amfs_root.c,v 1.2 1999/01/10 21:53:43 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: amfs_toplvl.c,v 1.2 1998/12/27 06:24:45 ezk Exp $
|
||||
* $Id: amfs_toplvl.c,v 1.5 1999/02/04 07:24:14 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -177,9 +177,11 @@ mount_amfs_toplvl(char *dir, char *opts)
|
||||
#endif /* HOSTNAMESZ */
|
||||
|
||||
/*
|
||||
* Finally we can compute the mount genflags set above.
|
||||
* Finally we can compute the mount genflags set above,
|
||||
* and add any automounter specific flags.
|
||||
*/
|
||||
genflags = compute_mount_flags(&mnt);
|
||||
genflags |= compute_automounter_mount_flags(&mnt);
|
||||
|
||||
/* setup the many fields and flags within nfs_args */
|
||||
memmove(&anh.v2.fhs_fh, fhp, sizeof(*fhp));
|
||||
@@ -225,8 +227,10 @@ mount_amfs_toplvl(char *dir, char *opts)
|
||||
|
||||
/* This is it! Here we try to mount amd on its mount points */
|
||||
#ifdef DEBUG
|
||||
amuDebug(D_TRACE)
|
||||
amuDebug(D_TRACE) {
|
||||
print_nfs_args(&nfs_args, 0);
|
||||
plog(XLOG_DEBUG, "Generic mount flags 0x%x", genflags);
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
error = mount_fs(&mnt, genflags, (caddr_t) &nfs_args, retry, type,
|
||||
0, NULL, mnttab_file_name);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: amfs_union.c,v 1.1.1.1 1998/11/05 02:04:47 ezk Exp $
|
||||
* $Id: amfs_union.c,v 1.2 1999/01/10 21:53:43 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,8 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: amq_subr.c,v 1.3 1999/01/13 20:03:54 obrien Exp $
|
||||
* $Id: amq_subr.c,v 1.5 1999/08/24 21:31:06 ezk Exp $
|
||||
* $FreeBSD$
|
||||
*
|
||||
*/
|
||||
/*
|
||||
@@ -187,7 +188,7 @@ ok_security(struct svc_req *rqstp)
|
||||
return(0); /* assume security is therefore not OK */
|
||||
}
|
||||
|
||||
if (ntohs(sin->sin_port) >= 1024 ||
|
||||
if (ntohs(sin->sin_port) >= IPPORT_RESERVED ||
|
||||
!(sin->sin_addr.s_addr == htonl(0x7f000001) ||
|
||||
sin->sin_addr.s_addr == myipaddr.s_addr)) {
|
||||
char dq[20];
|
||||
@@ -253,21 +254,7 @@ amqproc_mount_1_svc(voidp argp, struct svc_req *rqstp)
|
||||
return 0;
|
||||
return &rc;
|
||||
}
|
||||
|
||||
#else /* not ENABLE_AMQ_MOUNT */
|
||||
|
||||
int *
|
||||
amqproc_mount_1_svc(voidp argp, struct svc_req *rqstp)
|
||||
{
|
||||
static int rc;
|
||||
char *s = *(amq_string *) argp;
|
||||
|
||||
plog(XLOG_ERROR, "amq requested mount of %s, but code is disabled", s);
|
||||
|
||||
rc = EINVAL;
|
||||
return &rc;
|
||||
}
|
||||
#endif /* not ENABLE_AMQ_MOUNT */
|
||||
#endif /* ENABLE_AMQ_MOUNT */
|
||||
|
||||
|
||||
amq_string *
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: amq_svc.c,v 1.1.1.2 1999/01/13 19:20:54 obrien Exp $
|
||||
* $Id: amq_svc.c,v 1.3 1999/08/24 21:31:06 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: autil.c,v 1.2 1998/12/27 06:24:46 ezk Exp $
|
||||
* $Id: autil.c,v 1.3 1999/01/10 21:53:44 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1989 Jan-Simon Pendry
|
||||
* Copyright (c) 1989 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1989 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: clock.c,v 1.1.1.1 1998/11/05 02:04:47 ezk Exp $
|
||||
* $Id: clock.c,v 1.3 1999/01/13 23:30:58 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -190,7 +190,8 @@ reschedule_timeouts(time_t now, time_t then)
|
||||
if (cp->c_time >= now && cp->c_time <= then) {
|
||||
plog(XLOG_WARNING, "job %d rescheduled to run immediately", cp->c_id);
|
||||
#ifdef DEBUG
|
||||
dlog("rescheduling job %d back %d seconds", cp->c_id, cp->c_time - now);
|
||||
dlog("rescheduling job %d back %ld seconds",
|
||||
cp->c_id, (long) (cp->c_time - now));
|
||||
#endif /* DEBUG */
|
||||
next_softclock = cp->c_time = now;
|
||||
}
|
||||
|
||||
+24
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: conf.c,v 1.2 1998/12/27 06:24:46 ezk Exp $
|
||||
* $Id: conf.c,v 1.5 1999/09/30 21:01:30 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -82,6 +82,7 @@ static int gopt_cache_duration(const char *val);
|
||||
static int gopt_cluster(const char *val);
|
||||
static int gopt_debug_options(const char *val);
|
||||
static int gopt_dismount_interval(const char *val);
|
||||
static int gopt_full_os(const char *val);
|
||||
static int gopt_fully_qualified_hosts(const char *val);
|
||||
static int gopt_hesiod_base(const char *val);
|
||||
static int gopt_karch(const char *val);
|
||||
@@ -111,6 +112,7 @@ static int gopt_search_path(const char *val);
|
||||
static int gopt_selectors_on_default(const char *val);
|
||||
static int gopt_show_statfs_entries(const char *val);
|
||||
static int gopt_unmount_on_exit(const char *val);
|
||||
static int gopt_vendor(const char *val);
|
||||
static int process_global_option(const char *key, const char *val);
|
||||
static int process_regular_map(cf_map_t *cfm);
|
||||
static int process_regular_option(const char *section, const char *key, const char *val, cf_map_t *cfm);
|
||||
@@ -137,6 +139,7 @@ static struct _func_map glob_functable[] = {
|
||||
{"debug_options", gopt_debug_options},
|
||||
{"dismount_interval", gopt_dismount_interval},
|
||||
{"fully_qualified_hosts", gopt_fully_qualified_hosts},
|
||||
{"full_os", gopt_full_os},
|
||||
{"hesiod_base", gopt_hesiod_base},
|
||||
{"karch", gopt_karch},
|
||||
{"ldap_base", gopt_ldap_base},
|
||||
@@ -165,6 +168,7 @@ static struct _func_map glob_functable[] = {
|
||||
{"selectors_on_default", gopt_selectors_on_default},
|
||||
{"show_statfs_entries", gopt_show_statfs_entries},
|
||||
{"unmount_on_exit", gopt_unmount_on_exit},
|
||||
{"vendor", gopt_vendor},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
@@ -389,6 +393,14 @@ gopt_dismount_interval(const char *val)
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
gopt_full_os(const char *val)
|
||||
{
|
||||
gopt.op_sys_full = strdup((char *)val);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
gopt_fully_qualified_hosts(const char *val)
|
||||
{
|
||||
@@ -550,6 +562,7 @@ gopt_mount_type(const char *val)
|
||||
if (STREQ(val, "autofs")) {
|
||||
#ifdef HAVE_FS_AUTOFS
|
||||
gopt.flags |= CFM_MOUNT_TYPE_AUTOFS;
|
||||
amd_use_autofs++;
|
||||
return 0;
|
||||
#else /* not HAVE_FS_AUTOFS */
|
||||
fprintf(stderr, "conf: no autofs support available\n");
|
||||
@@ -766,6 +779,14 @@ gopt_unmount_on_exit(const char *val)
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
gopt_vendor(const char *val)
|
||||
{
|
||||
gopt.op_sys_vendor = strdup((char *)val);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Collect one entry for a regular map
|
||||
*/
|
||||
@@ -867,6 +888,7 @@ ropt_mount_type(const char *val, cf_map_t *cfm)
|
||||
if (STREQ(val, "autofs")) {
|
||||
#ifdef HAVE_FS_AUTOFS
|
||||
cfm->cfm_flags |= CFM_MOUNT_TYPE_AUTOFS;
|
||||
amd_use_autofs++;
|
||||
return 0;
|
||||
#else /* not HAVE_FS_AUTOFS */
|
||||
fprintf(stderr, "conf: no autofs support available\n");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1989 Jan-Simon Pendry
|
||||
* Copyright (c) 1989 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1989 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: conf_parse.y,v 1.1.1.1 1998/11/05 02:04:51 ezk Exp $
|
||||
* $Id: conf_parse.y,v 1.3 1999/04/16 14:20:59 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -49,6 +49,22 @@
|
||||
#include <am_defs.h>
|
||||
#include <amd.h>
|
||||
|
||||
/* AIX requires this to be the first thing in the file. */
|
||||
#ifndef __GNUC__
|
||||
# if HAVE_ALLOCA_H
|
||||
# include <alloca.h>
|
||||
# else /* not HAVE_ALLOCA_H */
|
||||
# ifdef _AIX
|
||||
#pragma alloca
|
||||
# else /* not _AIX */
|
||||
# ifndef alloca
|
||||
/* predefined by HP cc +Olibcalls */
|
||||
voidp alloca();
|
||||
# endif /* not alloca */
|
||||
# endif /* not _AIX */
|
||||
# endif /* not HAVE_ALLOCA_H */
|
||||
#endif /* not __GNUC__ */
|
||||
|
||||
extern char *yytext;
|
||||
extern int yylineno;
|
||||
extern int yylex(void);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
%{
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1989 Jan-Simon Pendry
|
||||
* Copyright (c) 1989 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1989 The Regents of the University of California.
|
||||
@@ -39,7 +39,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: conf_tok.l,v 1.1.1.1 1998/11/05 02:04:51 ezk Exp $
|
||||
* $Id: conf_tok.l,v 1.2 1999/01/10 21:53:45 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,8 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: get_args.c,v 1.2 1998/09/05 06:06:00 obrien Exp $
|
||||
* $Id: get_args.c,v 1.4 1999/09/30 21:01:31 ezk Exp $
|
||||
* $FreeBSD$
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -85,7 +86,7 @@ get_version_string(void)
|
||||
|
||||
vers = xmalloc(2048 + wire_buf_len);
|
||||
sprintf(vers, "%s\n%s\n%s\n%s\n",
|
||||
"Copyright (c) 1997-1998 Erez Zadok",
|
||||
"Copyright (c) 1997-1999 Erez Zadok",
|
||||
"Copyright (c) 1990 Jan-Simon Pendry",
|
||||
"Copyright (c) 1990 Imperial College of Science, Technology & Medicine",
|
||||
"Copyright (c) 1990 The Regents of the University of California.");
|
||||
@@ -99,7 +100,7 @@ get_version_string(void)
|
||||
cpu, endian, gopt.arch, gopt.karch);
|
||||
strcat(vers, tmpbuf);
|
||||
sprintf(tmpbuf, "full_os=%s, os=%s, osver=%s, vendor=%s.\n",
|
||||
HOST_OS, gopt.op_sys, gopt.op_sys_ver, HOST_VENDOR);
|
||||
gopt.op_sys_full, gopt.op_sys, gopt.op_sys_ver, gopt.op_sys_vendor);
|
||||
strcat(vers, tmpbuf);
|
||||
|
||||
strcat(vers, "Map support for: ");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: info_file.c,v 1.1.1.1 1998/11/05 02:04:49 ezk Exp $
|
||||
* $Id: info_file.c,v 1.2 1999/01/10 21:53:45 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1989 Jan-Simon Pendry
|
||||
* Copyright (c) 1989 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1989 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: info_hesiod.c,v 1.1.1.1 1998/11/05 02:04:49 ezk Exp $
|
||||
* $Id: info_hesiod.c,v 1.5 1999/02/04 07:24:15 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -58,10 +58,15 @@
|
||||
#ifdef HAVE_HESIOD_INIT
|
||||
/* bsdi3 does not define this extern in any header file */
|
||||
extern char **hesiod_resolve(void *context, const char *name, const char *type);
|
||||
|
||||
extern int hesiod_init(void **context);
|
||||
static voidp hesiod_context;
|
||||
#endif /* HAVE_HESIOD_INIT */
|
||||
|
||||
/* forward declarations */
|
||||
int amu_hesiod_init(mnt_map *m, char *map, time_t *tp);
|
||||
int hesiod_search(mnt_map *m, char *map, char *key, char **pval, time_t *tp);
|
||||
int hesiod_isup(mnt_map *m, char *map);
|
||||
|
||||
/*
|
||||
* No easy way to probe the server - check the map name begins with "hesiod."
|
||||
* Note: this name includes 'amu_' so as to not conflict with libhesiod's
|
||||
@@ -98,7 +103,8 @@ hesiod_search(mnt_map *m, char *map, char *key, char **pval, time_t *tp)
|
||||
#endif /* not HAVE_HESIOD_INIT */
|
||||
|
||||
#ifdef DEBUG
|
||||
dlog("hesiod_search(m=%x, map=%s, key=%s, pval=%x tp=%x)", m, map, key, pval, tp);
|
||||
dlog("hesiod_search(m=%lx, map=%s, key=%s, pval=%lx tp=%lx)",
|
||||
(unsigned long) m, map, key, (unsigned long) pval, (unsigned long) tp);
|
||||
#endif /* DEBUG */
|
||||
|
||||
sprintf(hes_key, "%s.%s", key, map + HES_PREFLEN);
|
||||
@@ -161,3 +167,34 @@ hesiod_search(mnt_map *m, char *map, char *key, char **pval, time_t *tp)
|
||||
return error;
|
||||
#endif /* not HAVE_HESIOD_INIT */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Check if Hesiod is up, so we can determine if to clear the map or not.
|
||||
* Test it by querying for /defaults.
|
||||
* Returns: 0 if Hesiod is down, 1 if it is up.
|
||||
*/
|
||||
int
|
||||
hesiod_isup(mnt_map *m, char *map)
|
||||
{
|
||||
int error;
|
||||
char *val;
|
||||
time_t mtime;
|
||||
static int last_status = 1; /* assume up by default */
|
||||
|
||||
error = hesiod_search(m, map, "/defaults", &val, &mtime);
|
||||
#ifdef DEBUG
|
||||
dlog("hesiod_isup(%s): %s", map, strerror(error));
|
||||
#endif /* DEBUG */
|
||||
if (error != 0 && error != ENOENT) {
|
||||
plog(XLOG_ERROR,
|
||||
"hesiod_isup: error getting `/defaults' entry in map %s: %m", map);
|
||||
last_status = 0;
|
||||
return 0; /* Hesiod is down */
|
||||
}
|
||||
if (last_status == 0) { /* if was down before */
|
||||
plog(XLOG_INFO, "hesiod_isup: Hesiod came back up for map %s", map);
|
||||
last_status = 1;
|
||||
}
|
||||
return 1; /* Hesiod is up */
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1989 Jan-Simon Pendry
|
||||
* Copyright (c) 1989 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1989 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: info_ldap.c,v 1.1.1.1 1998/11/05 02:04:49 ezk Exp $
|
||||
* $Id: info_ldap.c,v 1.6 1999/09/30 21:01:31 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -182,7 +182,12 @@ amu_ldap_init(mnt_map *m, char *map, time_t *ts)
|
||||
ALD *aldh;
|
||||
CR *creds;
|
||||
|
||||
if (!STREQ(gopt.map_type, AMD_LDAP_TYPE)) {
|
||||
/*
|
||||
* XXX: by checking that map_type must be defined, aren't we
|
||||
* excluding the possibility of automatic searches through all
|
||||
* map types?
|
||||
*/
|
||||
if (!gopt.map_type || !STREQ(gopt.map_type, AMD_LDAP_TYPE)) {
|
||||
return (ENOENT);
|
||||
}
|
||||
#ifdef DEBUG
|
||||
@@ -219,7 +224,7 @@ amu_ldap_init(mnt_map *m, char *map, time_t *ts)
|
||||
if (get_ldap_timestamp(aldh->ldap, map, ts))
|
||||
return (ENOENT);
|
||||
#ifdef DEBUG
|
||||
dlog("Got timestamp for map %s: %d\n", map, *ts);
|
||||
dlog("Got timestamp for map %s: %ld\n", map, *ts);
|
||||
#endif /* DEBUG */
|
||||
|
||||
return (0);
|
||||
@@ -233,6 +238,7 @@ amu_ldap_rebind(ALD *a)
|
||||
HE *h;
|
||||
CR *c = a->credentials;
|
||||
time_t now = clocktime();
|
||||
int try;
|
||||
|
||||
if (a->ldap != NULL) {
|
||||
if ((a->timestamp - now) > AMD_LDAP_TTL) {
|
||||
@@ -245,7 +251,7 @@ amu_ldap_rebind(ALD *a)
|
||||
return (0);
|
||||
}
|
||||
|
||||
while (TRUE) {
|
||||
for (try=0; try<10; try++) { /* XXX: try up to 10 times (makes sense?) */
|
||||
for (h = a->hostent; h != NULL; h = h->next) {
|
||||
if ((ld = ldap_open(h->host, h->port)) == NULL) {
|
||||
plog(XLOG_WARNING, "Unable to ldap_open to %s:%d\n", h->host, h->port);
|
||||
@@ -277,7 +283,7 @@ get_ldap_timestamp(LDAP * ld, char *map, time_t *ts)
|
||||
struct timeval tv;
|
||||
char **vals, *end;
|
||||
char filter[MAXPATHLEN];
|
||||
int i, err, nentries = 0;
|
||||
int i, err = 0, nentries = 0;
|
||||
LDAPMessage *res, *entry;
|
||||
|
||||
tv.tv_sec = 3;
|
||||
@@ -299,7 +305,9 @@ get_ldap_timestamp(LDAP * ld, char *map, time_t *ts)
|
||||
&res);
|
||||
if (err == LDAP_SUCCESS)
|
||||
break;
|
||||
#ifdef DEBUG
|
||||
dlog("Timestamp search timed out, trying again...\n");
|
||||
#endif /* DEBUG */
|
||||
}
|
||||
|
||||
if (err != LDAP_SUCCESS) {
|
||||
@@ -339,7 +347,7 @@ get_ldap_timestamp(LDAP * ld, char *map, time_t *ts)
|
||||
err = ENOENT;
|
||||
}
|
||||
if (!*ts > 0) {
|
||||
plog(XLOG_USER, "Nonpositive timestamp %d for map %s\n",
|
||||
plog(XLOG_USER, "Nonpositive timestamp %ld for map %s\n",
|
||||
*ts, map);
|
||||
err = ENOENT;
|
||||
}
|
||||
@@ -353,7 +361,7 @@ get_ldap_timestamp(LDAP * ld, char *map, time_t *ts)
|
||||
ldap_msgfree(res);
|
||||
ldap_msgfree(entry);
|
||||
#ifdef DEBUG
|
||||
dlog("The timestamp for %s is %d (err=%d)\n", map, *ts, err);
|
||||
dlog("The timestamp for %s is %ld (err=%d)\n", map, *ts, err);
|
||||
#endif /* DEBUG */
|
||||
return (err);
|
||||
}
|
||||
@@ -364,7 +372,7 @@ amu_ldap_search(mnt_map *m, char *map, char *key, char **pval, time_t *ts)
|
||||
{
|
||||
char **vals, filter[MAXPATHLEN];
|
||||
struct timeval tv;
|
||||
int i, err, nvals = 0, nentries = 0;
|
||||
int i, err = 0, nvals = 0, nentries = 0;
|
||||
LDAPMessage *entry, *res;
|
||||
ALD *a = (ALD *) (m->map_data);
|
||||
|
||||
@@ -452,7 +460,9 @@ amu_ldap_mtime(mnt_map *m, char *map, time_t *ts)
|
||||
ALD *aldh = (ALD *) (m->map_data);
|
||||
|
||||
if (aldh == NULL) {
|
||||
#ifdef DEBUG
|
||||
dlog("LDAP panic: unable to find map data\n");
|
||||
#endif /* DEBUG */
|
||||
return (ENOENT);
|
||||
}
|
||||
if (amu_ldap_rebind(aldh)) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1989 Jan-Simon Pendry
|
||||
* Copyright (c) 1989 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1989 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: info_ndbm.c,v 1.1.1.1 1998/11/05 02:04:49 ezk Exp $
|
||||
* $Id: info_ndbm.c,v 1.2 1999/01/10 21:53:46 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
+64
-15
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1989 Jan-Simon Pendry
|
||||
* Copyright (c) 1989 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1989 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: info_nis.c,v 1.1.1.1 1998/11/05 02:04:49 ezk Exp $
|
||||
* $Id: info_nis.c,v 1.5 1999/08/22 05:12:51 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -55,8 +55,12 @@
|
||||
|
||||
/*
|
||||
* NIS+ servers in NIS compat mode don't have yp_order()
|
||||
*
|
||||
* has_yp_order = 1 NIS server
|
||||
* = 0 NIS+ server
|
||||
* = -1 server is down
|
||||
*/
|
||||
static int has_yp_order = FALSE;
|
||||
static int has_yp_order = -1;
|
||||
|
||||
/* forward declarations */
|
||||
int nis_reload(mnt_map *m, char *map, void (*fn) (mnt_map *, char *, char *));
|
||||
@@ -103,7 +107,9 @@ determine_nis_domain(void)
|
||||
}
|
||||
if (!*default_domain) {
|
||||
nis_not_running = 1;
|
||||
#ifdef DEBUG
|
||||
plog(XLOG_WARNING, "NIS domain name is not set. NIS ignored.");
|
||||
#endif /* DEBUG */
|
||||
return ENOENT;
|
||||
}
|
||||
gopt.nis_domain = strdup(default_domain);
|
||||
@@ -193,25 +199,52 @@ nis_isup(mnt_map *m, char *map)
|
||||
{
|
||||
YP_ORDER_OUTORDER_TYPE order;
|
||||
int error;
|
||||
char *master;
|
||||
static int last_status = 1; /* assume up by default */
|
||||
|
||||
if (has_yp_order) {
|
||||
switch (has_yp_order) {
|
||||
case 1:
|
||||
/*
|
||||
* NIS server with yp_order
|
||||
*/
|
||||
error = yp_order(gopt.nis_domain, map, &order);
|
||||
if (error != 0) {
|
||||
plog(XLOG_ERROR,
|
||||
"nis_isup: error getting the order of map of %s: %s",
|
||||
"nis_isup: error getting the order of map %s: %s",
|
||||
map, yperr_string(ypprot_err(error)));
|
||||
last_status = 0;
|
||||
return 0; /* NIS is down */
|
||||
}
|
||||
break;
|
||||
|
||||
case 0:
|
||||
/*
|
||||
* NIS+ server without yp_order
|
||||
*/
|
||||
error = yp_master(gopt.nis_domain, map, &master);
|
||||
if (error != 0) {
|
||||
plog(XLOG_ERROR,
|
||||
"nis_isup: error getting the master of map %s: %s",
|
||||
map, yperr_string(ypprot_err(error)));
|
||||
last_status = 0;
|
||||
return 0; /* NIS+ is down */
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/*
|
||||
* server was down
|
||||
*/
|
||||
last_status = 0;
|
||||
}
|
||||
if (last_status == 0) { /* if was down before */
|
||||
|
||||
if (last_status == 0) { /* reinitialize if was down before */
|
||||
time_t dummy;
|
||||
plog(XLOG_INFO, "nis_isup: NIS came back up for map %s", map);
|
||||
/* XXX: do we really need to reinitialize nis? */
|
||||
error = nis_init(m, map, &dummy);
|
||||
if (!error)
|
||||
last_status = 1;
|
||||
if (error)
|
||||
return 0; /* still down */
|
||||
plog(XLOG_INFO, "nis_isup: NIS came back up for map %s", map);
|
||||
last_status = 1;
|
||||
}
|
||||
return 1; /* NIS is up */
|
||||
}
|
||||
@@ -237,8 +270,10 @@ nis_search(mnt_map *m, char *map, char *key, char **val, time_t *tp)
|
||||
}
|
||||
|
||||
|
||||
if (has_yp_order) {
|
||||
switch (has_yp_order) {
|
||||
case 1:
|
||||
/*
|
||||
* NIS server with yp_order
|
||||
* Check if map has changed
|
||||
*/
|
||||
if (yp_order(gopt.nis_domain, map, &order))
|
||||
@@ -247,7 +282,9 @@ nis_search(mnt_map *m, char *map, char *key, char **val, time_t *tp)
|
||||
*tp = (time_t) order;
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
|
||||
case 0:
|
||||
/*
|
||||
* NIS+ server without yp_order
|
||||
* Check if timeout has expired to invalidate the cache
|
||||
@@ -257,6 +294,15 @@ nis_search(mnt_map *m, char *map, char *key, char **val, time_t *tp)
|
||||
*tp = (time_t)order;
|
||||
return(-1);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/*
|
||||
* server was down
|
||||
*/
|
||||
if (nis_isup(m, map))
|
||||
return -1;
|
||||
return EIO;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -301,15 +347,16 @@ nis_init(mnt_map *m, char *map, time_t *tp)
|
||||
yp_order_result = yp_order(gopt.nis_domain, map, &order);
|
||||
switch (yp_order_result) {
|
||||
case 0:
|
||||
has_yp_order = TRUE;
|
||||
/* NIS server found */
|
||||
has_yp_order = 1;
|
||||
*tp = (time_t) order;
|
||||
#ifdef DEBUG
|
||||
dlog("NIS master for %s@%s has order %d", map, gopt.nis_domain, order);
|
||||
dlog("NIS master for %s@%s has order %lu", map, gopt.nis_domain, (unsigned long) order);
|
||||
#endif /* DEBUG */
|
||||
break;
|
||||
case YPERR_YPERR:
|
||||
/* NIS+ server found ! */
|
||||
has_yp_order = FALSE;
|
||||
has_yp_order = 0;
|
||||
/* try yp_master() instead */
|
||||
if (yp_master(gopt.nis_domain, map, &master)) {
|
||||
return ENOENT;
|
||||
@@ -322,6 +369,8 @@ nis_init(mnt_map *m, char *map, time_t *tp)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
/* server is down */
|
||||
has_yp_order = -1;
|
||||
return ENOENT;
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1989 Jan-Simon Pendry
|
||||
* Copyright (c) 1989 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1989 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: info_nisplus.c,v 1.1.1.1 1998/11/05 02:04:49 ezk Exp $
|
||||
* $Id: info_nisplus.c,v 1.2 1999/01/10 21:53:46 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: info_passwd.c,v 1.1.1.1 1998/11/05 02:04:49 ezk Exp $
|
||||
* $Id: info_passwd.c,v 1.2 1999/01/10 21:53:46 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: info_union.c,v 1.1.1.1 1998/11/05 02:04:50 ezk Exp $
|
||||
* $Id: info_union.c,v 1.2 1999/01/10 21:53:47 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: map.c,v 1.2 1998/12/27 06:24:47 ezk Exp $
|
||||
* $Id: map.c,v 1.5 1999/08/22 05:12:51 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -615,7 +615,7 @@ root_fh(char *dir)
|
||||
long pid = getppid();
|
||||
((struct am_fh *) &nfh)->fhh_pid = pid;
|
||||
#ifdef DEBUG
|
||||
dlog("root_fh substitutes pid %d", pid);
|
||||
dlog("root_fh substitutes pid %ld", (long) pid);
|
||||
#endif /* DEBUG */
|
||||
}
|
||||
return &nfh;
|
||||
@@ -913,7 +913,7 @@ free_map_if_success(int rc, int term, voidp closure)
|
||||
#endif /* DEBUG */
|
||||
amd_stats.d_uerr++;
|
||||
} else if (rc) {
|
||||
if (rc == EBUSY) {
|
||||
if (mf->mf_ops == &amfs_program_ops || rc == EBUSY) {
|
||||
plog(XLOG_STATS, "\"%s\" on %s still active", mp->am_path, mf->mf_mount);
|
||||
} else {
|
||||
errno = rc; /* XXX */
|
||||
@@ -1093,7 +1093,7 @@ timeout_mp(voidp v)
|
||||
if ((int) amd_state >= (int) Finishing)
|
||||
t = now + 1;
|
||||
#ifdef DEBUG
|
||||
dlog("Next mount timeout in %ds", t - now);
|
||||
dlog("Next mount timeout in %lds", (long) (t - now));
|
||||
#endif /* DEBUG */
|
||||
|
||||
timeout_mp_id = timeout(t - now, timeout_mp, 0);
|
||||
|
||||
+68
-22
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1989 Jan-Simon Pendry
|
||||
* Copyright (c) 1989 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1989 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: mapc.c,v 1.1.1.1 1998/11/05 02:04:48 ezk Exp $
|
||||
* $Id: mapc.c,v 1.5 1999/09/30 21:01:31 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -139,6 +139,7 @@ qelem map_list_head = {&map_list_head, &map_list_head};
|
||||
static const char *get_full_path(const char *map, const char *path, const char *type);
|
||||
static int mapc_meta_search(mnt_map *, char *, char **, int);
|
||||
static void mapc_sync(mnt_map *);
|
||||
static void mapc_clear(mnt_map *);
|
||||
|
||||
/* ROOT MAP */
|
||||
static int root_init(mnt_map *, char *, time_t *);
|
||||
@@ -158,6 +159,7 @@ extern int passwd_search(mnt_map *, char *, char *, char **, time_t *);
|
||||
/* HESIOD MAPS */
|
||||
#ifdef HAVE_MAP_HESIOD
|
||||
extern int amu_hesiod_init(mnt_map *, char *map, time_t *tp);
|
||||
extern int hesiod_isup(mnt_map *, char *);
|
||||
extern int hesiod_search(mnt_map *, char *, char *, char **, time_t *);
|
||||
#endif /* HAVE_MAP_HESIOD */
|
||||
|
||||
@@ -236,7 +238,7 @@ static map_type maptypes[] =
|
||||
"hesiod",
|
||||
amu_hesiod_init,
|
||||
error_reload,
|
||||
NULL, /* isup function */
|
||||
hesiod_isup, /* is Hesiod up or not? */
|
||||
hesiod_search,
|
||||
error_mtime,
|
||||
MAPC_ALL
|
||||
@@ -487,19 +489,65 @@ mapc_find_wildcard(mnt_map *m)
|
||||
|
||||
|
||||
/*
|
||||
* Do a map reload
|
||||
* Do a map reload.
|
||||
* Attempt to reload without losing current data by switching the hashes
|
||||
* round.
|
||||
*/
|
||||
static int
|
||||
static void
|
||||
mapc_reload_map(mnt_map *m)
|
||||
{
|
||||
int error;
|
||||
kv *maphash[NKVHASH], *tmphash[NKVHASH];
|
||||
|
||||
/*
|
||||
* skip reloading maps that have not been modified, unless
|
||||
* amq -f was used (do_mapc_reload is 0)
|
||||
*/
|
||||
if (m->reloads != 0 && do_mapc_reload != 0) {
|
||||
time_t t;
|
||||
error = (*m->mtime) (m, m->map_name, &t);
|
||||
if (!error) {
|
||||
if (t <= m->modify) {
|
||||
plog(XLOG_INFO, "reload of map %s is not needed (in sync)", m->map_name);
|
||||
#ifdef DEBUG
|
||||
dlog("map %s last load time is %d, last modify time is %d",
|
||||
m->map_name, (int) m->modify, (int) t);
|
||||
#endif /* DEBUG */
|
||||
return;
|
||||
} else {
|
||||
/* reload of the map is needed, update map reload time */
|
||||
m->modify = t;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* copy the old hash and zero the map */
|
||||
memcpy((voidp) maphash, (voidp) m->kvhash, sizeof(m->kvhash));
|
||||
memset((voidp) m->kvhash, 0, sizeof(m->kvhash));
|
||||
|
||||
#ifdef DEBUG
|
||||
dlog("calling map reload on %s", m->map_name);
|
||||
#endif /* DEBUG */
|
||||
error = (*m->reload) (m, m->map_name, mapc_add_kv);
|
||||
if (error)
|
||||
return error;
|
||||
if (error) {
|
||||
if (m->reloads == 0)
|
||||
plog(XLOG_FATAL, "first time load of map %s failed!", m->map_name);
|
||||
else
|
||||
plog(XLOG_ERROR, "reload of map %s failed - using old values",
|
||||
m->map_name);
|
||||
mapc_clear(m);
|
||||
memcpy((voidp) m->kvhash, (voidp) maphash, sizeof(m->kvhash));
|
||||
} else {
|
||||
if (m->reloads++ == 0)
|
||||
plog(XLOG_INFO, "first time load of map %s succeeded", m->map_name);
|
||||
else
|
||||
plog(XLOG_INFO, "reload #%d of map %s succeeded",
|
||||
m->reloads, m->map_name);
|
||||
memcpy((voidp) tmphash, (voidp) m->kvhash, sizeof(m->kvhash));
|
||||
memcpy((voidp) m->kvhash, (voidp) maphash, sizeof(m->kvhash));
|
||||
mapc_clear(m);
|
||||
memcpy((voidp) m->kvhash, (voidp) tmphash, sizeof(m->kvhash));
|
||||
}
|
||||
m->wildcard = 0;
|
||||
|
||||
#ifdef DEBUG
|
||||
@@ -508,8 +556,6 @@ mapc_reload_map(mnt_map *m)
|
||||
error = mapc_search(m, wildcard, &m->wildcard);
|
||||
if (error)
|
||||
m->wildcard = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -620,6 +666,7 @@ mapc_create(char *map, char *opt, const char *type)
|
||||
m->map_name = strdup(map);
|
||||
m->refc = 1;
|
||||
m->wildcard = 0;
|
||||
m->reloads = 0;
|
||||
|
||||
/*
|
||||
* synchronize cache with reality
|
||||
@@ -880,16 +927,16 @@ mapc_sync(mnt_map *m)
|
||||
}
|
||||
}
|
||||
|
||||
mapc_clear(m);
|
||||
|
||||
if (m->alloc >= MAPC_ALL)
|
||||
if (mapc_reload_map(m))
|
||||
m->alloc = MAPC_INC;
|
||||
/*
|
||||
* Attempt to find the wildcard entry
|
||||
*/
|
||||
if (m->alloc < MAPC_ALL)
|
||||
if (m->alloc >= MAPC_ALL) {
|
||||
/* mapc_reload_map() always works */
|
||||
mapc_reload_map(m);
|
||||
} else {
|
||||
mapc_clear(m);
|
||||
/*
|
||||
* Attempt to find the wildcard entry
|
||||
*/
|
||||
mapc_find_wildcard(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1051,7 +1098,7 @@ key_already_in_chain(char *keyname, const nfsentry *chain)
|
||||
nfsentry *
|
||||
make_entry_chain(am_node *mp, const nfsentry *current_chain, int fully_browsable)
|
||||
{
|
||||
static u_int last_cookie = ~(u_int) 0 - 1;
|
||||
static u_int last_cookie = (u_int) 2; /* monotonically increasing */
|
||||
static nfsentry chain[MAX_CHAIN];
|
||||
static int max_entries = MAX_CHAIN;
|
||||
char *key;
|
||||
@@ -1123,10 +1170,9 @@ make_entry_chain(am_node *mp, const nfsentry *current_chain, int fully_browsable
|
||||
}
|
||||
|
||||
/* we have space. put entry in next cell */
|
||||
--last_cookie;
|
||||
++last_cookie;
|
||||
chain[num_entries].ne_fileid = (u_int) last_cookie;
|
||||
*(u_int *) chain[num_entries].ne_cookie =
|
||||
(u_int) last_cookie;
|
||||
*(u_int *) chain[num_entries].ne_cookie = (u_int) last_cookie;
|
||||
chain[num_entries].ne_name = key;
|
||||
if (num_entries < max_entries - 1) { /* link to next one */
|
||||
chain[num_entries].ne_nextentry = &chain[num_entries + 1];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: mntfs.c,v 1.1.1.1 1998/11/05 02:04:48 ezk Exp $
|
||||
* $Id: mntfs.c,v 1.2 1999/01/10 21:53:47 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1989 Jan-Simon Pendry
|
||||
* Copyright (c) 1989 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1989 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: nfs_prot_svc.c,v 1.1.1.1 1998/11/05 02:04:48 ezk Exp $
|
||||
* $Id: nfs_prot_svc.c,v 1.4 1999/08/22 21:12:30 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -98,6 +98,27 @@ nfs_program_2(struct svc_req *rqstp, SVCXPRT *transp)
|
||||
char *result;
|
||||
xdrproc_t xdr_argument, xdr_result;
|
||||
nfssvcproc_t local;
|
||||
struct sockaddr_in *sinp;
|
||||
char dq[20], dq2[28];
|
||||
|
||||
sinp = amu_svc_getcaller(rqstp->rq_xprt);
|
||||
#ifdef MNT2_NFS_OPT_RESVPORT
|
||||
/* Verify that the request comes from a reserved port */
|
||||
if (ntohs(sinp->sin_port) >= IPPORT_RESERVED) {
|
||||
plog(XLOG_WARNING, "ignoring request from %s:%u, port not reserved",
|
||||
inet_dquad(dq, sinp->sin_addr.s_addr),
|
||||
ntohs(sinp->sin_port));
|
||||
return;
|
||||
}
|
||||
#endif /* MNT2_NFS_OPT_RESVPORT */
|
||||
/* if the address does not match, ignore the request */
|
||||
if (sinp->sin_addr.s_addr && sinp->sin_addr.s_addr != myipaddr.s_addr) {
|
||||
plog(XLOG_WARNING, "ignoring request from %s:%u, expected %s",
|
||||
inet_dquad(dq, sinp->sin_addr.s_addr),
|
||||
ntohs(sinp->sin_port),
|
||||
inet_dquad(dq2, myipaddr.s_addr));
|
||||
return;
|
||||
}
|
||||
|
||||
nfs_program_2_transp = NULL;
|
||||
|
||||
@@ -228,7 +249,7 @@ nfs_program_2(struct svc_req *rqstp, SVCXPRT *transp)
|
||||
(SVC_IN_ARG_TYPE) &argument)) {
|
||||
plog(XLOG_ERROR,
|
||||
"NFS xdr decode failed for %d %d %d",
|
||||
rqstp->rq_prog, rqstp->rq_vers, rqstp->rq_proc);
|
||||
(int) rqstp->rq_prog, (int) rqstp->rq_vers, (int) rqstp->rq_proc);
|
||||
svcerr_decode(transp);
|
||||
return;
|
||||
}
|
||||
|
||||
+19
-15
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: nfs_start.c,v 1.1.1.1 1998/11/05 02:04:48 ezk Exp $
|
||||
* $Id: nfs_start.c,v 1.4 1999/02/04 07:24:16 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -58,6 +58,7 @@ u_short nfs_port;
|
||||
#ifdef HAVE_FS_AUTOFS
|
||||
SVCXPRT *autofsxprt = NULL;
|
||||
u_short autofs_port = 0;
|
||||
int amd_use_autofs = 0;
|
||||
#endif /* HAVE_FS_AUTOFS */
|
||||
|
||||
#ifndef HAVE_SIGACTION
|
||||
@@ -86,12 +87,12 @@ checkup(void)
|
||||
}
|
||||
if (max_mem < next_mem) {
|
||||
#ifdef HAVE_GETPAGESIZE
|
||||
dlog("%#x bytes of memory allocated; total is %#x (%ld pages)",
|
||||
next_mem - max_mem, next_mem,
|
||||
dlog("%#lx bytes of memory allocated; total is %#lx (%ld pages)",
|
||||
(long) (next_mem - max_mem), (unsigned long) next_mem,
|
||||
((long) next_mem + getpagesize() - 1) / getpagesize());
|
||||
#else /* not HAVE_GETPAGESIZE */
|
||||
dlog("%#x bytes of memory allocated; total is %#x",
|
||||
next_mem - max_mem, next_mem);
|
||||
dlog("%#lx bytes of memory allocated; total is %#lx",
|
||||
(long) (next_mem - max_mem), (unsigned long) next_mem);
|
||||
#endif /* not HAVE_GETPAGESIZE */
|
||||
max_mem = next_mem;
|
||||
|
||||
@@ -265,7 +266,7 @@ run_rpc(void)
|
||||
tvv.tv_sec = SELECT_MAXWAIT;
|
||||
#ifdef DEBUG
|
||||
if (tvv.tv_sec) {
|
||||
dlog("Select waits for %ds", tvv.tv_sec);
|
||||
dlog("Select waits for %ds", (int) tvv.tv_sec);
|
||||
} else {
|
||||
dlog("Select waits for Godot");
|
||||
}
|
||||
@@ -374,14 +375,17 @@ mount_automounter(int ppid)
|
||||
return ret;
|
||||
|
||||
#ifdef HAVE_FS_AUTOFS
|
||||
/*
|
||||
* Create the autofs service for amd.
|
||||
*/
|
||||
plog(XLOG_INFO, "creating autofs service listener");
|
||||
ret = create_autofs_service(&soAUTOFS, &autofs_port, &autofsxprt, autofs_program_1);
|
||||
/* if autofs service fails it is OK if using a test amd */
|
||||
if (ret != 0 && gopt.portmap_program == AMQ_PROGRAM)
|
||||
return ret;
|
||||
if (amd_use_autofs) {
|
||||
/*
|
||||
* Create the autofs service for amd, but only if autofs maps
|
||||
* were defined (so amd doesn't clash with automountd.)
|
||||
*/
|
||||
plog(XLOG_INFO, "creating autofs service listener");
|
||||
ret = create_autofs_service(&soAUTOFS, &autofs_port, &autofsxprt, autofs_program_1);
|
||||
/* if autofs service fails it is OK if using a test amd */
|
||||
if (ret != 0 && gopt.portmap_program == AMQ_PROGRAM)
|
||||
return ret;
|
||||
}
|
||||
#endif /* HAVE_FS_AUTOFS */
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: nfs_subr.c,v 1.1.1.1 1998/11/05 02:04:48 ezk Exp $
|
||||
* $Id: nfs_subr.c,v 1.3 1999/01/13 23:31:00 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -131,7 +131,7 @@ nfsproc_getattr_2_svc(am_nfs_fh *argp, struct svc_req *rqstp)
|
||||
#ifdef DEBUG
|
||||
amuDebug(D_TRACE)
|
||||
plog(XLOG_DEBUG, "\tstat(%s), size = %d", mp->am_path,
|
||||
attrp->ns_u.ns_attr_u.na_size);
|
||||
(int) attrp->ns_u.ns_attr_u.na_size);
|
||||
#endif /* DEBUG */
|
||||
|
||||
mp->am_stats.s_getattr++;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: ops_TEMPLATE.c,v 1.1.1.1 1998/11/05 02:04:51 ezk Exp $
|
||||
* $Id: ops_TEMPLATE.c,v 1.2 1999/01/10 21:53:48 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: ops_autofs.c,v 1.2 1998/12/27 06:24:47 ezk Exp $
|
||||
* $Id: ops_autofs.c,v 1.4 1999/01/13 23:31:00 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -356,7 +356,7 @@ autofs_program_1(struct svc_req *rqstp, SVCXPRT *transp)
|
||||
(SVC_IN_ARG_TYPE) &argument)) {
|
||||
plog(XLOG_ERROR,
|
||||
"AUTOFS xdr decode failed for %d %d %d",
|
||||
rqstp->rq_prog, rqstp->rq_vers, rqstp->rq_proc);
|
||||
(int) rqstp->rq_prog, (int) rqstp->rq_vers, (int) rqstp->rq_proc);
|
||||
svcerr_decode(transp);
|
||||
return;
|
||||
}
|
||||
@@ -433,11 +433,13 @@ autofs_unmount_1_svc(struct umntrequest *ur, struct umntres *result, struct auth
|
||||
int err = 0;
|
||||
|
||||
#ifdef HAVE_FIELD_UMNTREQUEST_RDEVID
|
||||
plog(XLOG_INFO, "XXX: autofs_unmount_1_svc: %d:%u:%lu:0x%x",
|
||||
ur->isdirect, ur->devid, ur->rdevid, ur->next);
|
||||
plog(XLOG_INFO, "XXX: autofs_unmount_1_svc: %d:%lu:%lu:0x%lx",
|
||||
ur->isdirect, (unsigned long) ur->devid, (unsigned long) ur->rdevid,
|
||||
(unsigned long) ur->next);
|
||||
#else /* HAVE_FIELD_UMNTREQUEST_RDEVID */
|
||||
plog(XLOG_INFO, "XXX: autofs_unmount_1_svc: %d:%u:0x%x",
|
||||
ur->isdirect, ur->devid, ur->next);
|
||||
plog(XLOG_INFO, "XXX: autofs_unmount_1_svc: %d:%lu:0x%lx",
|
||||
ur->isdirect, (unsigned long) ur->devid,
|
||||
(unsigned long) ur->next);
|
||||
#endif /* HAVE_FIELD_UMNTREQUEST_RDEVID */
|
||||
|
||||
err = EINVAL; /* XXX: not implemented yet */
|
||||
@@ -614,8 +616,8 @@ autofs_bgmount(struct continuation * cp, int mpe)
|
||||
* Don't try logging the string from mf, since it may be bad!
|
||||
*/
|
||||
if (cp->fs_opts.opt_fs != mf->mf_fo->opt_fs)
|
||||
plog(XLOG_ERROR, "use %s instead of 0x%x",
|
||||
cp->fs_opts.opt_fs, mf->mf_fo->opt_fs);
|
||||
plog(XLOG_ERROR, "use %s instead of 0x%lx",
|
||||
cp->fs_opts.opt_fs, (unsigned long) mf->mf_fo->opt_fs);
|
||||
|
||||
mp->am_link = str3cat((char *) 0,
|
||||
cp->fs_opts.opt_fs, "/", link_dir);
|
||||
@@ -700,7 +702,7 @@ autofs_bgmount(struct continuation * cp, int mpe)
|
||||
int i = atoi(mf->mf_fo->opt_delay);
|
||||
if (i > 0 && clocktime() < (cp->start + i)) {
|
||||
#ifdef DEBUG
|
||||
dlog("Mount of %s delayed by %ds", mf->mf_mount, i - clocktime() + cp->start);
|
||||
dlog("Mount of %s delayed by %lds", mf->mf_mount, i - clocktime() + cp->start);
|
||||
#endif /* DEBUG */
|
||||
this_error = -1;
|
||||
}
|
||||
@@ -998,7 +1000,7 @@ autofs_lookuppn(am_node *mp, char *fname, int *error_return, int op)
|
||||
if (error) {
|
||||
#ifdef DEBUG
|
||||
errno = error; /* XXX */
|
||||
dlog("Returning error: %m", error);
|
||||
dlog("Returning error: %m");
|
||||
#endif /* DEBUG */
|
||||
XFREE(fname);
|
||||
ereturn(error);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: ops_cachefs.c,v 1.1.1.1 1998/11/05 02:04:50 ezk Exp $
|
||||
* $Id: ops_cachefs.c,v 1.2 1999/01/10 21:53:49 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: ops_cdfs.c,v 1.1.1.1 1998/11/05 02:04:50 ezk Exp $
|
||||
* $Id: ops_cdfs.c,v 1.3 1999/03/30 17:22:46 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -148,6 +148,19 @@ mount_cdfs(char *dir, char *fs_name, char *opts)
|
||||
if (hasmntopt(&mnt, MNTTAB_OPT_RRIP))
|
||||
cdfs_flags |= MNT2_CDFS_OPT_RRIP;
|
||||
#endif /* defined(MNT2_CDFS_OPT_RRIP) && defined(MNTTAB_OPT_RRIP) */
|
||||
#if defined(MNT2_CDFS_OPT_NORRIP) && defined(MNTTAB_OPT_NORRIP)
|
||||
if (hasmntopt(&mnt, MNTTAB_OPT_NORRIP))
|
||||
cdfs_flags |= MNT2_CDFS_OPT_NORRIP;
|
||||
#endif /* defined(MNT2_CDFS_OPT_NORRIP) && defined(MNTTAB_OPT_NORRIP) */
|
||||
|
||||
#if defined(MNT2_CDFS_OPT_GENS) && defined(MNTTAB_OPT_GENS)
|
||||
if (hasmntopt(&mnt, MNTTAB_OPT_GENS))
|
||||
cdfs_flags |= MNT2_CDFS_OPT_GENS;
|
||||
#endif /* defined(MNT2_CDFS_OPT_GENS) && defined(MNTTAB_OPT_GENS) */
|
||||
#if defined(MNT2_CDFS_OPT_EXTATT) && defined(MNTTAB_OPT_EXTATT)
|
||||
if (hasmntopt(&mnt, MNTTAB_OPT_EXTATT))
|
||||
cdfs_flags |= MNT2_CDFS_OPT_EXTATT;
|
||||
#endif /* defined(MNT2_CDFS_OPT_EXTATT) && defined(MNTTAB_OPT_EXTATT) */
|
||||
|
||||
genflags = compute_mount_flags(&mnt);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: ops_efs.c,v 1.1.1.1 1998/11/05 02:04:50 ezk Exp $
|
||||
* $Id: ops_efs.c,v 1.2 1999/01/10 21:53:49 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: ops_lofs.c,v 1.1.1.1 1998/11/05 02:04:50 ezk Exp $
|
||||
* $Id: ops_lofs.c,v 1.2 1999/01/10 21:53:49 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: ops_mfs.c,v 1.1.1.1 1998/11/05 02:04:50 ezk Exp $
|
||||
* $Id: ops_mfs.c,v 1.2 1999/01/10 21:53:50 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
+15
-10
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: ops_nfs.c,v 1.1.1.1 1998/11/05 02:04:50 ezk Exp $
|
||||
* $Id: ops_nfs.c,v 1.5 1999/03/13 17:03:28 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -148,7 +148,7 @@ find_nfs_fhandle_cache(voidp idv, int done)
|
||||
|
||||
#ifdef DEBUG
|
||||
if (fp2) {
|
||||
dlog("fh cache gives fp %#x, fs %s", fp2, fp2->fh_path);
|
||||
dlog("fh cache gives fp %#lx, fs %s", (unsigned long) fp2, fp2->fh_path);
|
||||
} else {
|
||||
dlog("fh cache search failed");
|
||||
}
|
||||
@@ -198,7 +198,7 @@ got_nfs_fh(voidp pkt, int len, struct sockaddr_in * sa, struct sockaddr_in * ia,
|
||||
*/
|
||||
if (fp->fh_wchan) {
|
||||
#ifdef DEBUG
|
||||
dlog("Calling wakeup on %#x", fp->fh_wchan);
|
||||
dlog("Calling wakeup on %#lx", (unsigned long) fp->fh_wchan);
|
||||
#endif /* DEBUG */
|
||||
wakeup(fp->fh_wchan);
|
||||
}
|
||||
@@ -259,7 +259,7 @@ prime_nfs_fhandle_cache(char *path, fserver *fs, am_nfs_handle_t *fhbuf, voidp w
|
||||
if (fs == fp->fh_fs && STREQ(path, fp->fh_path)) {
|
||||
switch (fp->fh_error) {
|
||||
case 0:
|
||||
plog(XLOG_INFO, "prime_nfs_fhandle_cache: NFS version %d", fp->fh_nfs_version);
|
||||
plog(XLOG_INFO, "prime_nfs_fhandle_cache: NFS version %d", (int) fp->fh_nfs_version);
|
||||
#ifdef HAVE_FS_NFS3
|
||||
if (fp->fh_nfs_version == NFS_VERSION3)
|
||||
error = fp->fh_error = unx_error(fp->fh_nfs_handle.v3.fhs_status);
|
||||
@@ -449,7 +449,7 @@ call_mountd(fh_cache *fp, u_long proc, fwd_fun f, voidp wchan)
|
||||
#endif /* HAVE_FS_NFS3 */
|
||||
mnt_version = MOUNTVERS;
|
||||
plog(XLOG_INFO, "call_mountd: NFS version %d, mount version %d",
|
||||
fp->fh_nfs_version, mnt_version);
|
||||
(int) fp->fh_nfs_version, (int) mnt_version);
|
||||
|
||||
rpc_msg_init(&mnt_msg, MOUNTPROG, mnt_version, MOUNTPROC_NULL);
|
||||
len = make_rpc_packet(iobuf,
|
||||
@@ -585,10 +585,13 @@ mount_nfs_fh(am_nfs_handle_t *fhp, char *dir, char *fs_name, char *opts, mntfs *
|
||||
strcpy(host + MAXHOSTNAMELEN - 3, "..");
|
||||
#endif /* MAXHOSTNAMELEN */
|
||||
|
||||
if (mf->mf_remopts && *mf->mf_remopts && !islocalnet(fs->fs_ip->sin_addr.s_addr))
|
||||
if (mf->mf_remopts && *mf->mf_remopts &&
|
||||
!islocalnet(fs->fs_ip->sin_addr.s_addr)) {
|
||||
plog(XLOG_INFO, "Using remopts=\"%s\"", mf->mf_remopts);
|
||||
xopts = strdup(mf->mf_remopts);
|
||||
else
|
||||
} else {
|
||||
xopts = strdup(opts);
|
||||
}
|
||||
|
||||
memset((voidp) &mnt, 0, sizeof(mnt));
|
||||
mnt.mnt_dir = dir;
|
||||
@@ -622,7 +625,7 @@ mount_nfs_fh(am_nfs_handle_t *fhp, char *dir, char *fs_name, char *opts, mntfs *
|
||||
mnt.mnt_type = MNTTAB_TYPE_NFS;
|
||||
}
|
||||
#endif /* HAVE_FS_NFS3 */
|
||||
plog(XLOG_INFO, "mount_nfs_fh: NFS version %d", nfs_version);
|
||||
plog(XLOG_INFO, "mount_nfs_fh: NFS version %d", (int) nfs_version);
|
||||
#if defined(HAVE_FS_NFS3) || defined(HAVE_TRANSPORT_TYPE_TLI)
|
||||
plog(XLOG_INFO, "mount_nfs_fh: using NFS transport %s", nfs_proto);
|
||||
#endif /* defined(HAVE_FS_NFS3) || defined(HAVE_TRANSPORT_TYPE_TLI) */
|
||||
@@ -659,8 +662,10 @@ mount_nfs_fh(am_nfs_handle_t *fhp, char *dir, char *fs_name, char *opts, mntfs *
|
||||
|
||||
/* finally call the mounting function */
|
||||
#ifdef DEBUG
|
||||
amuDebug(D_TRACE)
|
||||
amuDebug(D_TRACE) {
|
||||
print_nfs_args(&nfs_args, nfs_version);
|
||||
plog(XLOG_DEBUG, "Generic mount flags 0x%x", genflags);
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
error = mount_fs(&mnt, genflags, (caddr_t) &nfs_args, retry, type,
|
||||
nfs_version, nfs_proto, mnttab_file_name);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: ops_nfs3.c,v 1.1.1.1 1998/11/05 02:04:50 ezk Exp $
|
||||
* $Id: ops_nfs3.c,v 1.2 1999/01/10 21:53:50 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: ops_nullfs.c,v 1.1.1.1 1998/11/05 02:04:50 ezk Exp $
|
||||
* $Id: ops_nullfs.c,v 1.2 1999/01/10 21:53:50 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: ops_pcfs.c,v 1.1.1.1 1998/11/05 02:04:50 ezk Exp $
|
||||
* $Id: ops_pcfs.c,v 1.2 1999/01/10 21:53:50 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: ops_tfs.c,v 1.1.1.1 1998/11/05 02:04:51 ezk Exp $
|
||||
* $Id: ops_tfs.c,v 1.2 1999/01/10 21:53:51 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: ops_tmpfs.c,v 1.1.1.1 1998/11/05 02:04:51 ezk Exp $
|
||||
* $Id: ops_tmpfs.c,v 1.2 1999/01/10 21:53:51 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: ops_ufs.c,v 1.1.1.1 1998/11/05 02:04:51 ezk Exp $
|
||||
* $Id: ops_ufs.c,v 1.2 1999/01/10 21:53:51 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -132,7 +132,7 @@ mount_ufs(char *dir, char *fs_name, char *opts)
|
||||
#endif /* HAVE_FIELD_UFS_ARGS_T_FLAGS */
|
||||
|
||||
#ifdef HAVE_FIELD_UFS_ARGS_T_UFS_FLAGS
|
||||
ufs_args.ufs_flags = genflags; /* XXX: is this correct? */
|
||||
ufs_args.ufs_flags = genflags;
|
||||
#endif /* HAVE_FIELD_UFS_ARGS_T_UFS_FLAGS */
|
||||
|
||||
#ifdef HAVE_FIELD_UFS_ARGS_T_FSPEC
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: ops_umapfs.c,v 1.1.1.1 1998/11/05 02:04:51 ezk Exp $
|
||||
* $Id: ops_umapfs.c,v 1.2 1999/01/10 21:53:51 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: ops_unionfs.c,v 1.1.1.1 1998/11/05 02:04:51 ezk Exp $
|
||||
* $Id: ops_unionfs.c,v 1.2 1999/01/10 21:53:51 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: ops_xfs.c,v 1.1.1.1 1998/11/05 02:04:51 ezk Exp $
|
||||
* $Id: ops_xfs.c,v 1.2 1999/01/10 21:53:52 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
+24
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1989 Jan-Simon Pendry
|
||||
* Copyright (c) 1989 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1989 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: opts.c,v 1.2 1998/12/27 06:24:48 ezk Exp $
|
||||
* $Id: opts.c,v 1.6 1999/09/30 21:01:32 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -95,6 +95,7 @@ struct functable {
|
||||
*/
|
||||
static int f_in_network(char *);
|
||||
static int f_netgrp(char *);
|
||||
static int f_netgrpd(char *);
|
||||
static int f_exists(char *);
|
||||
static int f_false(char *);
|
||||
static int f_true(char *);
|
||||
@@ -174,6 +175,10 @@ static struct opt opt_fields[] = {
|
||||
0, &gopt.op_sys, 0, TRUE },
|
||||
{ S("osver"),
|
||||
0, &gopt.op_sys_ver, 0, TRUE },
|
||||
{ S("full_os"),
|
||||
0, &gopt.op_sys_full, 0, TRUE },
|
||||
{ S("vendor"),
|
||||
0, &gopt.op_sys_vendor, 0, TRUE },
|
||||
{ S("remopts"),
|
||||
&fs_static.opt_remopts, 0, 0, FALSE },
|
||||
{ S("mount"),
|
||||
@@ -218,6 +223,7 @@ static struct opt opt_fields[] = {
|
||||
static struct functable functable[] = {
|
||||
{ "in_network", f_in_network },
|
||||
{ "netgrp", f_netgrp },
|
||||
{ "netgrpd", f_netgrpd },
|
||||
{ "exists", f_exists },
|
||||
{ "false", f_false },
|
||||
{ "true", f_true },
|
||||
@@ -494,7 +500,7 @@ eval_opts(char *opts, char *mapkey)
|
||||
continue;
|
||||
} else if (NSTREQ(f, "!", 1) && (func = functable_lookup(&f[1]))) {
|
||||
/* then this is a negated prefixed function such as "!exists" */
|
||||
plog(XLOG_USER, "executing negated function %s", &f[1]);
|
||||
plog(XLOG_INFO, "executing negated function %s", &f[1]);
|
||||
if ((*func) (arg)) {
|
||||
return (0);
|
||||
}
|
||||
@@ -730,7 +736,7 @@ f_in_network(char *arg)
|
||||
}
|
||||
|
||||
|
||||
/* test if this host is in netgroup (arg) */
|
||||
/* test if this host (short hostname form) is in netgroup (arg) */
|
||||
static int
|
||||
f_netgrp(char *arg)
|
||||
{
|
||||
@@ -744,6 +750,20 @@ f_netgrp(char *arg)
|
||||
}
|
||||
|
||||
|
||||
/* test if this host (fully-qualified name) is in netgroup (arg) */
|
||||
static int
|
||||
f_netgrpd(char *arg)
|
||||
{
|
||||
int status;
|
||||
|
||||
status = innetgr(arg, opt_hostd, NULL, NULL);
|
||||
#ifdef DEBUG
|
||||
plog(XLOG_USER, "netgrp = %s status = %d hostd = %s", arg, status, opt_hostd);
|
||||
#endif /* DEBUG */
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
/* test if file (arg) exists via lstat */
|
||||
static int
|
||||
f_exists(char *arg)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1990 Jan-Simon Pendry
|
||||
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: restart.c,v 1.1.1.1 1998/11/05 02:04:49 ezk Exp $
|
||||
* $Id: restart.c,v 1.2 1999/01/10 21:53:52 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997-1998 Erez Zadok
|
||||
* Copyright (c) 1997-1999 Erez Zadok
|
||||
* Copyright (c) 1989 Jan-Simon Pendry
|
||||
* Copyright (c) 1989 Imperial College of Science, Technology & Medicine
|
||||
* Copyright (c) 1989 The Regents of the University of California.
|
||||
@@ -38,7 +38,7 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: rpc_fwd.c,v 1.1.1.1 1998/11/05 02:04:49 ezk Exp $
|
||||
* $Id: rpc_fwd.c,v 1.2 1999/01/10 21:53:52 ezk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
Loaded 100 of 1772 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user