Compare commits
740 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eccf1c569c | ||
|
|
7ad96661ef | ||
|
|
8736e4a37e | ||
|
|
e8a2cfa7dc | ||
|
|
f06a1d8b00 | ||
|
|
b4472167c2 | ||
|
|
d22f1c18cc | ||
|
|
dcca8653a5 | ||
|
|
5575995541 | ||
|
|
6f266a30ff | ||
|
|
e668c7e725 | ||
|
|
9e5a852ee0 | ||
|
|
80b52a597f | ||
|
|
d355cb2b16 | ||
|
|
4ce27b5e60 | ||
|
|
62449968fa | ||
|
|
b7e12ec04e | ||
|
|
047bfc47c6 | ||
|
|
913e16ce20 | ||
|
|
3e602b58a2 | ||
|
|
6b341b1e90 | ||
|
|
e751bc67eb | ||
|
|
92bd73c657 | ||
|
|
2b0bdef6f9 | ||
|
|
9750fd6819 | ||
|
|
e1b1d187f4 | ||
|
|
7052a0a2dd | ||
|
|
962c820fba | ||
|
|
363eab25f0 | ||
|
|
4758641b1d | ||
|
|
f5a7404c7a | ||
|
|
618bafc238 | ||
|
|
355ad6a9e0 | ||
|
|
d59a090933 | ||
|
|
0e6fe5e728 | ||
|
|
f93cf255d4 | ||
|
|
6761cf2d7e | ||
|
|
79157cbad8 | ||
|
|
b8c67c320c | ||
|
|
e0d66b4be1 | ||
|
|
868d7b34ea | ||
|
|
30e62bc3bd | ||
|
|
a630fba34b | ||
|
|
92cb9d7785 | ||
|
|
0f31dc5c2c | ||
|
|
2a6164cc4a | ||
|
|
53763ae6ee | ||
|
|
a850520981 | ||
|
|
c0e4ccd032 | ||
|
|
f2e8294bdb | ||
|
|
e2f1fcca0e | ||
|
|
aaaaf21b6f | ||
|
|
9a9c9231db | ||
|
|
292f59f43d | ||
|
|
585b6f00f5 | ||
|
|
abb879fd4f | ||
|
|
f7c2a54212 | ||
|
|
c628caf174 | ||
|
|
6938bab429 | ||
|
|
0c9f641408 | ||
|
|
19f08785f0 | ||
|
|
535f54076c | ||
|
|
445e97ba7c | ||
|
|
d12d300c98 | ||
|
|
32f641b207 | ||
|
|
9724147344 | ||
|
|
dce030ffb8 | ||
|
|
1654f42194 | ||
|
|
3ff3cd9c78 | ||
|
|
3a0160beb0 | ||
|
|
d594243fbb | ||
|
|
02916e9cb2 | ||
|
|
1fdaf69376 | ||
|
|
2fa4234fc7 | ||
|
|
3b6ccf642c | ||
|
|
126fbe57bc | ||
|
|
6c3d4ebf6e | ||
|
|
eb366c255c | ||
|
|
6c4545544f | ||
|
|
d8e54618fe | ||
|
|
adf7378d73 | ||
|
|
624d57c08c | ||
|
|
06eb4e4d76 | ||
|
|
497e90751b | ||
|
|
a757b458ff | ||
|
|
387da46d73 | ||
|
|
b17a17c93d | ||
|
|
1ff0b37134 | ||
|
|
63a96706b1 | ||
|
|
a97399dd0a | ||
|
|
f2476d3ce8 | ||
|
|
fc832e4648 | ||
|
|
7d02af944f | ||
|
|
82b5983301 | ||
|
|
234af5cf67 | ||
|
|
09c752f00f | ||
|
|
5b4082d007 | ||
|
|
cdc8c1e25b | ||
|
|
4bec156db1 | ||
|
|
33f85e93a1 | ||
|
|
6be18d45e1 | ||
|
|
7e2b522a15 | ||
|
|
d7e2bd6fe1 | ||
|
|
4ad2697cc4 | ||
|
|
5bb28a0a7f | ||
|
|
4b85dc66d4 | ||
|
|
049f9a7f6b | ||
|
|
117bc66c6f | ||
|
|
26bbee8c86 | ||
|
|
ab9fad7943 | ||
|
|
7903557988 | ||
|
|
0e0101043b | ||
|
|
fb582ce72f | ||
|
|
679a29da7e | ||
|
|
d7c9550b7f | ||
|
|
e385338ee8 | ||
|
|
2b6312b337 | ||
|
|
ecfcaed0b5 | ||
|
|
f20c688a18 | ||
|
|
7687ae4dbd | ||
|
|
4624e9fca1 | ||
|
|
009e09fd58 | ||
|
|
a5bf83d2e7 | ||
|
|
4bcbe13689 | ||
|
|
049b08481a | ||
|
|
02b200c9aa | ||
|
|
234e8fa7b1 | ||
|
|
c4539fc4f9 | ||
|
|
9dd720a285 | ||
|
|
1c1e0b0c68 | ||
|
|
adb83f7796 | ||
|
|
28a02dc83e | ||
|
|
e318bb9b06 | ||
|
|
05388f748d | ||
|
|
e481437ab9 | ||
|
|
6becc82e26 | ||
|
|
c6847011e8 | ||
|
|
065aae682c | ||
|
|
33c33a32a2 | ||
|
|
cd551ef728 | ||
|
|
fa986b1d73 | ||
|
|
4616fe71e7 | ||
|
|
537b8cd90b | ||
|
|
d4b6d1549b | ||
|
|
f4a84efb46 | ||
|
|
6f9124b7f7 | ||
|
|
496fc2919d | ||
|
|
905eb76cec | ||
|
|
0c821fcf0c | ||
|
|
93086e9aa7 | ||
|
|
c3cf23b00c | ||
|
|
ffd35d8902 | ||
|
|
c7b4f317f9 | ||
|
|
9b58a623f4 | ||
|
|
1a20189b83 | ||
|
|
bd102eaa35 | ||
|
|
ea04eb301d | ||
|
|
c93897a8d7 | ||
|
|
c82ed0c15e | ||
|
|
9eb191edc4 | ||
|
|
e65cc6aebc | ||
|
|
b3b1f5d4a4 | ||
|
|
bc8257cf73 | ||
|
|
dbf230e4cf | ||
|
|
2f0d14eb21 | ||
|
|
d4535015a0 | ||
|
|
14b108728a | ||
|
|
dbfad7d1c9 | ||
|
|
738d92a4bd | ||
|
|
7a3bb4d0ea | ||
|
|
a026ea6bbf | ||
|
|
5939e066db | ||
|
|
af9984bff1 | ||
|
|
0faec51bf0 | ||
|
|
5d0d784197 | ||
|
|
1aed7ae945 | ||
|
|
68ebbf9360 | ||
|
|
83db204477 | ||
|
|
456bdb78f8 | ||
|
|
8281c82e32 | ||
|
|
a6154b8572 | ||
|
|
9d37173b24 | ||
|
|
bd920ab36a | ||
|
|
1d767fb779 | ||
|
|
8eb6f8ace4 | ||
|
|
0871122443 | ||
|
|
d5b15f8633 | ||
|
|
ec1951c181 | ||
|
|
9d169ffc41 | ||
|
|
0fe42f571c | ||
|
|
b0e86b959f | ||
|
|
ea7af4e154 | ||
|
|
3d670ba7ed | ||
|
|
2f1f45d64f | ||
|
|
663824ef4c | ||
|
|
c6cab4a7ba | ||
|
|
e34f49c196 | ||
|
|
322db32971 | ||
|
|
f9831a4a1a | ||
|
|
2b22a6909d | ||
|
|
ca1d912e6b | ||
|
|
3ac8d97825 | ||
|
|
e9e8e3270f | ||
|
|
91d4ab622b | ||
|
|
b8cbc2c113 | ||
|
|
dfe95bd08b | ||
|
|
eb1d2de0e9 | ||
|
|
5f7649fb37 | ||
|
|
e367d111e5 | ||
|
|
95fd179683 | ||
|
|
c0aa8a876e | ||
|
|
6e4b2fe25d | ||
|
|
e6416fd81b | ||
|
|
186b1b7ac1 | ||
|
|
38c079366d | ||
|
|
77e39de1e6 | ||
|
|
2c542f6c65 | ||
|
|
b30e9614c3 | ||
|
|
cc7ea6e8e5 | ||
|
|
fa90ac11c8 | ||
|
|
716f3f99ce | ||
|
|
0f4347d148 | ||
|
|
8492dee663 | ||
|
|
514c1328b6 | ||
|
|
7cfe134090 | ||
|
|
df6ec1d169 | ||
|
|
b865e14f25 | ||
|
|
697901a328 | ||
|
|
9f1a43996c | ||
|
|
7273c25cc2 | ||
|
|
c0818ab01d | ||
|
|
f4cbf38ad7 | ||
|
|
0409c91a7f | ||
|
|
4faf42b31b | ||
|
|
786e44f6dd | ||
|
|
bc22009031 | ||
|
|
4ea269d23e | ||
|
|
f28660f5dd | ||
|
|
246d5c1c25 | ||
|
|
c464ec5570 | ||
|
|
b628850a09 | ||
|
|
fe159b7668 | ||
|
|
325bf584ce | ||
|
|
5cd04d03f9 | ||
|
|
ae169c4046 | ||
|
|
0dffc7c612 | ||
|
|
5d53e0bf07 | ||
|
|
b5fb1b38ee | ||
|
|
c917ed7b76 | ||
|
|
08f5577018 | ||
|
|
1021195bfe | ||
|
|
a8361e7410 | ||
|
|
7384865775 | ||
|
|
fd9d79a1a3 | ||
|
|
c44b71cec2 | ||
|
|
bbf4b79bc4 | ||
|
|
abb5c99114 | ||
|
|
88128000c9 | ||
|
|
599cc003da | ||
|
|
e7938d5a30 | ||
|
|
bd32c1c8fc | ||
|
|
fb0f702cbf | ||
|
|
a04287cf24 | ||
|
|
569bd1d54f | ||
|
|
2df8c0728d | ||
|
|
bd4dc81a82 | ||
|
|
f8642a1986 | ||
|
|
e24700fd5d | ||
|
|
18c5c6139d | ||
|
|
af0f55a625 | ||
|
|
3f09f7b6fb | ||
|
|
dfd19fc35b | ||
|
|
0407fa8813 | ||
|
|
e84df9e163 | ||
|
|
46ad1856ac | ||
|
|
87257a49a1 | ||
|
|
9d3546c695 | ||
|
|
287a9041a1 | ||
|
|
22bfaf9e26 | ||
|
|
2748b4230a | ||
|
|
6bd08f7d18 | ||
|
|
00f01dd416 | ||
|
|
01a8df79b3 | ||
|
|
9a10373ddb | ||
|
|
b065fa4741 | ||
|
|
3f35983656 | ||
|
|
c32743808d | ||
|
|
ec98f190c1 | ||
|
|
cf8101aaae | ||
|
|
4047d1fe8e | ||
|
|
6f38f43fdd | ||
|
|
dc732e7734 | ||
|
|
291c6fcc87 | ||
|
|
94d40b4521 | ||
|
|
3c9836a298 | ||
|
|
a271076041 | ||
|
|
e8c44a4c12 | ||
|
|
d041eec354 | ||
|
|
b215e9d02c | ||
|
|
994a3b463c | ||
|
|
508b968cb1 | ||
|
|
6afa2aaf9d | ||
|
|
342c934a35 | ||
|
|
49930bd3a6 | ||
|
|
7ea342579e | ||
|
|
875d2d49c1 | ||
|
|
83aa88466d | ||
|
|
607f1dd549 | ||
|
|
6baeb25038 | ||
|
|
32cfa176f2 | ||
|
|
b01bd3b139 | ||
|
|
0a7888b1fa | ||
|
|
43a917cce5 | ||
|
|
089cf55e2c | ||
|
|
316a153abb | ||
|
|
6e6494680d | ||
|
|
6155e91f4e | ||
|
|
967bfb0376 | ||
|
|
9cb21c2bdf | ||
|
|
5cb839d977 | ||
|
|
b128222477 | ||
|
|
fc95155aa4 | ||
|
|
320707fcb0 | ||
|
|
4086aed1ed | ||
|
|
096dad6305 | ||
|
|
4772689d27 | ||
|
|
1566921dd8 | ||
|
|
04062cda11 | ||
|
|
c040058fe3 | ||
|
|
c56fe7117b | ||
|
|
e2f74c347b | ||
|
|
f929bfd90b | ||
|
|
c889ebc2c9 | ||
|
|
a3a1cf6536 | ||
|
|
7e0e931519 | ||
|
|
97a76bd9e6 | ||
|
|
69332884b1 | ||
|
|
992c1723af | ||
|
|
8eee5d03fd | ||
|
|
77be9c35c7 | ||
|
|
f7ae4d48f4 | ||
|
|
1d8487d851 | ||
|
|
52aba825af | ||
|
|
25b1a8d591 | ||
|
|
5de28353d4 | ||
|
|
7b36b160f7 | ||
|
|
00e629c0ba | ||
|
|
942f1945bb | ||
|
|
69301dfa24 | ||
|
|
8762f465d4 | ||
|
|
140510de9d | ||
|
|
125a5dc309 | ||
|
|
e78be3df43 | ||
|
|
d60b59b156 | ||
|
|
6543c600d8 | ||
|
|
5070132ee6 | ||
|
|
143b97193d | ||
|
|
2a991a3ce9 | ||
|
|
3f2bbcfa91 | ||
|
|
8a2e3d500c | ||
|
|
c48011d19c | ||
|
|
ebe6def4b7 | ||
|
|
a8533719ed | ||
|
|
c667083c81 | ||
|
|
e5bb71b2fd | ||
|
|
b2753b146a | ||
|
|
724442c3af | ||
|
|
b6aaaba35e | ||
|
|
fa6c58a773 | ||
|
|
8a1e92aff1 | ||
|
|
12ce42be44 | ||
|
|
915cc6bb9c | ||
|
|
2cc7da6058 | ||
|
|
142d788c81 | ||
|
|
33c6a170a5 | ||
|
|
fd4405b763 | ||
|
|
dfceca8427 | ||
|
|
54c1660969 | ||
|
|
eebcacfae8 | ||
|
|
4ed08824e5 | ||
|
|
3e942adb21 | ||
|
|
085d04c3dd | ||
|
|
ed4a0157c4 | ||
|
|
93f1f35123 | ||
|
|
9f7f3b013e | ||
|
|
5a6ddf3b57 | ||
|
|
0512c187c8 | ||
|
|
f32d4a359b | ||
|
|
401d0743af | ||
|
|
a847899b52 | ||
|
|
88c1a6d98d | ||
|
|
ef095ceef1 | ||
|
|
4c9ec2f5a4 | ||
|
|
d7add53f06 | ||
|
|
2aa7427e2b | ||
|
|
1ec36eabb2 | ||
|
|
bd3c39f1c8 | ||
|
|
258944e331 | ||
|
|
51d65f37e5 | ||
|
|
0f332f48bc | ||
|
|
a73d4aee75 | ||
|
|
7f53048875 | ||
|
|
b1a5cda91e | ||
|
|
66b7bc0dcf | ||
|
|
eaaac67d4f | ||
|
|
3cc3948d71 | ||
|
|
08096ed24a | ||
|
|
92a678c250 | ||
|
|
81de782d1e | ||
|
|
d83eccdded | ||
|
|
681b66b13c | ||
|
|
2958bd050b | ||
|
|
38f493aff2 | ||
|
|
19bac44dde | ||
|
|
b49712ed32 | ||
|
|
cdbe1310cc | ||
|
|
b462f5335f | ||
|
|
115a4e89e2 | ||
|
|
9d935d9be1 | ||
|
|
7eca1112fb | ||
|
|
fe2a266c50 | ||
|
|
e97df9b1ec | ||
|
|
d048459d36 | ||
|
|
88fa0651bf | ||
|
|
4e038f3ae7 | ||
|
|
6c6c8d3a33 | ||
|
|
a8a921184f | ||
|
|
cbd2472b7c | ||
|
|
a0efca4581 | ||
|
|
4e1da34601 | ||
|
|
b03df41906 | ||
|
|
8ca6eea938 | ||
|
|
1c2ad5e6b9 | ||
|
|
991fee82df | ||
|
|
b52ce71c27 | ||
|
|
e78d22469f | ||
|
|
c4e8b411d4 | ||
|
|
3a51b90145 | ||
|
|
a2cd3e9ef0 | ||
|
|
1cbb562c23 | ||
|
|
558977bb2b | ||
|
|
332709da65 | ||
|
|
a74587a4ea | ||
|
|
1e13749483 | ||
|
|
1a1b8fcc36 | ||
|
|
23262b249c | ||
|
|
5687be5f31 | ||
|
|
e293aa9cfc | ||
|
|
edf7547ad5 | ||
|
|
2cac079ef4 | ||
|
|
5afc1c5b5f | ||
|
|
3025fefc41 | ||
|
|
00a5cff244 | ||
|
|
fc0ed79e5d | ||
|
|
13c618465d | ||
|
|
3c52a84ff8 | ||
|
|
2bb99b8fe6 | ||
|
|
d2808b1b51 | ||
|
|
b679cdbd3e | ||
|
|
a5f034f272 | ||
|
|
82fa6eccf9 | ||
|
|
8d39357c84 | ||
|
|
aff40d8515 | ||
|
|
51cfc1f89a | ||
|
|
816220f90c | ||
|
|
50b23584d7 | ||
|
|
c1d36a8acb | ||
|
|
caefe9e8de | ||
|
|
64d7688acb | ||
|
|
408b8a5482 | ||
|
|
ce2941ca0d | ||
|
|
47797ca665 | ||
|
|
1697c192ac | ||
|
|
5837240451 | ||
|
|
2c8171f8c8 | ||
|
|
fbb59823c5 | ||
|
|
fe87a1ad96 | ||
|
|
38e3e35c72 | ||
|
|
a8f7132113 | ||
|
|
3d921155e0 | ||
|
|
fe34a2a0e4 | ||
|
|
e24deea4c9 | ||
|
|
d6276066dd | ||
|
|
d2e1e9ce85 | ||
|
|
e61db2c618 | ||
|
|
c40c49536e | ||
|
|
dd2033c40c | ||
|
|
d66a1fe069 | ||
|
|
beb75c6fd6 | ||
|
|
c0c2b99164 | ||
|
|
ebad423023 | ||
|
|
c5898d9f02 | ||
|
|
ee87cda65d | ||
|
|
5b41b7d1b1 | ||
|
|
4633164857 | ||
|
|
59c2dabb26 | ||
|
|
42324e5017 | ||
|
|
52c081b02c | ||
|
|
bb3f810611 | ||
|
|
d5255da20b | ||
|
|
70971457b7 | ||
|
|
ff8b1ebafa | ||
|
|
83f1380600 | ||
|
|
1ecca8439d | ||
|
|
58ee899dce | ||
|
|
10e388efc2 | ||
|
|
fb97da1ce1 | ||
|
|
4aaf05d72e | ||
|
|
6bf2d74dfc | ||
|
|
4be18d3299 | ||
|
|
0d725c1e60 | ||
|
|
3c69af9ed3 | ||
|
|
89b96cb85c | ||
|
|
99dbd4b9ee | ||
|
|
67ec1a5266 | ||
|
|
2fd5815546 | ||
|
|
cba31b52b3 | ||
|
|
eadcb472e1 | ||
|
|
b3b6d9d77c | ||
|
|
48dcf7852e | ||
|
|
73a876a056 | ||
|
|
f50603a5fc | ||
|
|
164dcfe65b | ||
|
|
fb356b1344 | ||
|
|
a3d91ae318 | ||
|
|
65b4f58703 | ||
|
|
54551c7d6e | ||
|
|
d877e3fcac | ||
|
|
dbfe7dd42e | ||
|
|
45b4187596 | ||
|
|
44c63795a7 | ||
|
|
36244ac1ff | ||
|
|
d3790feac0 | ||
|
|
b63aca9a2c | ||
|
|
8f2f2a0d9d | ||
|
|
5d57ca10d9 | ||
|
|
a5913d98e1 | ||
|
|
5f3e3c2c62 | ||
|
|
c53e4c1d77 | ||
|
|
6d8be68071 | ||
|
|
fb28c99b8a | ||
|
|
acaed3deab | ||
|
|
bb47fdf25e | ||
|
|
97bb5b2b6d | ||
|
|
c0f0c67864 | ||
|
|
e91b0f0517 | ||
|
|
3f1f999e2d | ||
|
|
c63bc6bfaa | ||
|
|
a54907dce3 | ||
|
|
2c57c399bf | ||
|
|
a063580dbb | ||
|
|
a2c6e429b3 | ||
|
|
f3e07f105e | ||
|
|
f21700d876 | ||
|
|
34669aa651 | ||
|
|
08248f0859 | ||
|
|
722be83a14 | ||
|
|
ea1a6e814b | ||
|
|
2c930b19ba | ||
|
|
75e8eaad78 | ||
|
|
b74d6cfb98 | ||
|
|
a95d4ac1b5 | ||
|
|
b9c9d411ff | ||
|
|
05cc753275 | ||
|
|
af4a1c4e6b | ||
|
|
ef39098a1b | ||
|
|
6671b44434 | ||
|
|
b2dbde4b8c | ||
|
|
57cb36333b | ||
|
|
bfacc99ac3 | ||
|
|
e2192e119d | ||
|
|
4e0ac33eae | ||
|
|
8078e5bd54 | ||
|
|
146a0da7b3 | ||
|
|
ad7b83fc86 | ||
|
|
c668c49a15 | ||
|
|
3574346318 | ||
|
|
008be2848e | ||
|
|
63261593c8 | ||
|
|
18b14eb4a8 | ||
|
|
4724e503b0 | ||
|
|
2c4d93c7cf | ||
|
|
148c1c0984 | ||
|
|
6bc784b95a | ||
|
|
d275cce099 | ||
|
|
5136659a59 | ||
|
|
414816064f | ||
|
|
dcf96e43fa | ||
|
|
ea7d7bb644 | ||
|
|
60891cd197 | ||
|
|
0556fea593 | ||
|
|
74fcf6f28d | ||
|
|
70eb03ec29 | ||
|
|
856d26cb4b | ||
|
|
1adf386345 | ||
|
|
02137de419 | ||
|
|
73516df908 | ||
|
|
3025b9ebac | ||
|
|
e235f372ce | ||
|
|
62ace035c6 | ||
|
|
07a169d964 | ||
|
|
8e2b91c8cc | ||
|
|
831ff281d0 | ||
|
|
29ad485d17 | ||
|
|
51f740e23e | ||
|
|
c751f4a6ec | ||
|
|
742868dc2d | ||
|
|
9b8bddd179 | ||
|
|
1987203745 | ||
|
|
f7abcfb39a | ||
|
|
016bc8b813 | ||
|
|
66b1a59efe | ||
|
|
bd4750126b | ||
|
|
0fba6bd347 | ||
|
|
eb9db854d7 | ||
|
|
7d68d59cc2 | ||
|
|
f9311ba61d | ||
|
|
60d2888605 | ||
|
|
c2ada4c306 | ||
|
|
310ef194a1 | ||
|
|
daf30eff79 | ||
|
|
a90585f1d6 | ||
|
|
4be6d423e4 | ||
|
|
2db724bc50 | ||
|
|
452b9c26e4 | ||
|
|
d0c05b0143 | ||
|
|
36aeb4e9ee | ||
|
|
f8d4b66edd | ||
|
|
483de7d614 | ||
|
|
a95ed40bf0 | ||
|
|
686efcfcb1 | ||
|
|
bd6f2760a3 | ||
|
|
15631009b4 | ||
|
|
8eb822ebf3 | ||
|
|
aa95b1b763 | ||
|
|
92e3a5e386 | ||
|
|
4c22dcfbfd | ||
|
|
4f459198db | ||
|
|
056f7352ef | ||
|
|
0c2939b331 | ||
|
|
68e3d685fd | ||
|
|
0209d3f185 | ||
|
|
ef6890c31d | ||
|
|
1e98b3b559 | ||
|
|
223238d265 | ||
|
|
33f1f69e9c | ||
|
|
fb04f2723a | ||
|
|
78d4265f65 | ||
|
|
c2aed5345e | ||
|
|
2392894eb0 | ||
|
|
59fa2c0763 | ||
|
|
7081b2df85 | ||
|
|
1f34221552 | ||
|
|
c43681a068 | ||
|
|
992fab50ee | ||
|
|
15be89f89d | ||
|
|
d2902c8d3b | ||
|
|
8e51ec9ee4 | ||
|
|
7d82f203ee | ||
|
|
c07711de1d | ||
|
|
cb610d54b4 | ||
|
|
2f36da5201 | ||
|
|
954e3d2e71 | ||
|
|
830ae266c4 | ||
|
|
6eae751e70 | ||
|
|
f0e0c35f2b | ||
|
|
dc8253450d | ||
|
|
8d28d8cca0 | ||
|
|
274afc2c61 | ||
|
|
5717fe9ca8 | ||
|
|
b6b2c756c9 | ||
|
|
db57db52cf | ||
|
|
08fd4b69e8 | ||
|
|
24130c882d | ||
|
|
759f94e17a | ||
|
|
90c0525c7e | ||
|
|
5ac4918bdd | ||
|
|
3f9af9deb9 | ||
|
|
c6b0664f52 | ||
|
|
e36c0a418a | ||
|
|
efc8c61f75 | ||
|
|
44c690cd9a | ||
|
|
f84a88a824 | ||
|
|
c33ceddc26 | ||
|
|
6a750c7a50 | ||
|
|
f288c4fcef | ||
|
|
ee9e506af2 | ||
|
|
8a122a90fa | ||
|
|
45f141ce69 | ||
|
|
a9824dc6a3 | ||
|
|
84228eaeda | ||
|
|
c739407f92 | ||
|
|
578d495f91 | ||
|
|
bdd68116b7 | ||
|
|
c8508fabd0 | ||
|
|
36bc770ed4 | ||
|
|
5701e147ef | ||
|
|
5fc99f02cf | ||
|
|
411f540590 | ||
|
|
b2bd56a012 | ||
|
|
a3bf32fe87 | ||
|
|
9e93c984f7 | ||
|
|
d7ce9430ca | ||
|
|
0fb53623a5 | ||
|
|
9ad34243aa | ||
|
|
06f719e501 | ||
|
|
f439149cb3 | ||
|
|
32c0b283ef | ||
|
|
6e91297fa2 | ||
|
|
752ca15da4 | ||
|
|
e33cb8ae12 | ||
|
|
10bd7bab14 | ||
|
|
84f0ae00d2 | ||
|
|
e3f213305b | ||
|
|
d886cf40ef | ||
|
|
d572e3b1f9 | ||
|
|
816bd48c83 | ||
|
|
05563a7832 | ||
|
|
93e3044c6d | ||
|
|
6825e6c90a | ||
|
|
6401c5b4ee | ||
|
|
4471e5419d | ||
|
|
2b820c534d | ||
|
|
765993846d | ||
|
|
d9073bb033 | ||
|
|
efbff6a3d9 | ||
|
|
61abb4645c | ||
|
|
11d1b661db | ||
|
|
b95b766bc0 | ||
|
|
4094dc0c96 | ||
|
|
b7fffe8f7e | ||
|
|
a87e2bcdf1 | ||
|
|
6564241674 | ||
|
|
dc5b2a2ec0 | ||
|
|
924cc34647 | ||
|
|
68061f2059 | ||
|
|
67d2bb6e0a | ||
|
|
99b5feadd9 | ||
|
|
507f96cdeb | ||
|
|
c07397695a |
32
.builds/alpine-edge.yml
Normal file
32
.builds/alpine-edge.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
image: alpine/latest
|
||||
# apk add --update alpine-sdk
|
||||
packages:
|
||||
- cmd:setcap
|
||||
- autoconf
|
||||
- automake
|
||||
- byacc
|
||||
- expect
|
||||
- gettext
|
||||
- gettext-dev
|
||||
- gettext-lang
|
||||
- libcap-dev
|
||||
- libtool
|
||||
- linux-pam-dev
|
||||
- sed
|
||||
sources:
|
||||
- https://github.com/shadow-maint/shadow
|
||||
tasks:
|
||||
- build: |
|
||||
cd shadow
|
||||
./autogen.sh --without-selinux --disable-man --disable-nls
|
||||
grep ENABLE_ config.status
|
||||
- tasks: |
|
||||
cd shadow
|
||||
cat /proc/self/uid_map
|
||||
cat /proc/self/status
|
||||
make
|
||||
make DESTDIR=/tmp/shadow-inst install
|
||||
sudo make install
|
||||
#TODO - fix up the tests. Let's merge what's here now as it
|
||||
#at least tests build.
|
||||
#(cd tests; sudo ./run_some || { cat testsuite.log; false; })
|
||||
26
.builds/ubuntu-focal.yml
Normal file
26
.builds/ubuntu-focal.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
image: ubuntu/focal
|
||||
packages:
|
||||
- automake
|
||||
- autopoint
|
||||
- xsltproc
|
||||
- libselinux1-dev
|
||||
- gettext
|
||||
- expect
|
||||
- byacc
|
||||
- libtool
|
||||
sources:
|
||||
- https://github.com/shadow-maint/shadow
|
||||
tasks:
|
||||
- build: |
|
||||
cd shadow
|
||||
./autogen.sh --without-selinux --disable-man
|
||||
grep ENABLE_ config.status
|
||||
- tasks: |
|
||||
cd shadow
|
||||
cat /proc/self/uid_map
|
||||
cat /proc/self/status
|
||||
systemd-detect-virt
|
||||
make
|
||||
make DESTDIR=/tmp/shadow-inst install
|
||||
sudo make install
|
||||
(cd tests; sudo ./run_some || { cat testsuite.log; false; })
|
||||
26
.builds/ubuntu-impish.yml
Normal file
26
.builds/ubuntu-impish.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
image: ubuntu/21.10
|
||||
packages:
|
||||
- automake
|
||||
- autopoint
|
||||
- xsltproc
|
||||
- libselinux1-dev
|
||||
- gettext
|
||||
- expect
|
||||
- byacc
|
||||
- libtool
|
||||
sources:
|
||||
- https://github.com/shadow-maint/shadow
|
||||
tasks:
|
||||
- build: |
|
||||
cd shadow
|
||||
./autogen.sh --without-selinux --enable-man
|
||||
grep ENABLE_ config.status
|
||||
- tasks: |
|
||||
cat /proc/self/uid_map
|
||||
cat /proc/self/status
|
||||
systemd-detect-virt
|
||||
cd shadow
|
||||
make
|
||||
make DESTDIR=/tmp/shadow-inst install
|
||||
sudo make install
|
||||
(cd tests; sudo ./run_some || { cat testsuite.log; false; })
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -18,6 +18,7 @@ Makefile.in
|
||||
/aclocal.m4
|
||||
/autom4te.cache
|
||||
/compile
|
||||
/config.cache
|
||||
/config.guess
|
||||
/config.h
|
||||
/config.h.in
|
||||
@@ -45,4 +46,6 @@ Makefile.in
|
||||
/po/stamp-po
|
||||
|
||||
/shadow.spec
|
||||
/shadow-*.tar.*
|
||||
/libmisc/getdate.c
|
||||
/libsubid/subid.h
|
||||
|
||||
52
.travis.yml
Normal file
52
.travis.yml
Normal file
@@ -0,0 +1,52 @@
|
||||
dist: bionic
|
||||
sudo: false
|
||||
|
||||
language: c
|
||||
|
||||
compiler:
|
||||
- gcc
|
||||
- clang
|
||||
|
||||
arch:
|
||||
- amd64
|
||||
- arm64
|
||||
- ppc64le
|
||||
- s390x
|
||||
|
||||
before_install:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get -y install -qq automake autopoint xsltproc libselinux1-dev gettext expect
|
||||
- sudo apt-get -y install -qq byacc libtool
|
||||
script:
|
||||
- ./autogen.sh --without-selinux --disable-man
|
||||
- grep ENABLE_ config.status
|
||||
- make
|
||||
|
||||
env:
|
||||
global:
|
||||
- secure: "G47VYFrtzqalrVjixTqBG9Qsa8EZRcaqsh1k6fq5JgEyHmMQActpvTUDs9FXf1MEqiY5XX3VDVfBsZgKPHgmHsMzD1bX11xpnpGByB8g7gr8I3u2ZkCREqgi77a5l3LeBh+seWiambe/DYOgvPCNa6pCynLgR9advqtgKhpCruU="
|
||||
|
||||
addons:
|
||||
coverity_scan:
|
||||
|
||||
project:
|
||||
name: "shadow-maint/shadow"
|
||||
description: "Upstream shadow utils tree"
|
||||
|
||||
notification_email: christian.brauner@ubuntu.com,serge@hallyn.com
|
||||
|
||||
build_command_prepend: "./autogen.sh --without-selinux --disable-man"
|
||||
build_command: "make -j4"
|
||||
branch_pattern: master
|
||||
|
||||
script:
|
||||
- cat /proc/self/uid_map
|
||||
- cat /proc/self/status
|
||||
- systemd-detect-virt
|
||||
- ./autogen.sh --without-selinux --disable-man
|
||||
- grep ENABLE_ config.status
|
||||
- make
|
||||
- sudo make install
|
||||
- (cd tests; sudo ./run_some; cat testsuite.log)
|
||||
|
||||
# vim:et:ts=2:sw=2
|
||||
89
AUTHORS.md
Normal file
89
AUTHORS.md
Normal file
@@ -0,0 +1,89 @@
|
||||
Thanks to at least the following people for sending patches, bug
|
||||
reports and various comments. This list may be incomplete, I received
|
||||
a lot of mail...
|
||||
|
||||
# Maintainers
|
||||
Tomasz Kłoczko <kloczek@pld.org.pl> (2000-2007)
|
||||
Nicolas François <nicolas.francois@centraliens.net> (2007-2014)
|
||||
Serge E. Hallyn <serge@hallyn.com> (2014-now)
|
||||
Christian Brauner <christian@brauner.io> (2019-now)
|
||||
|
||||
# Authors and contributors
|
||||
Adam Rudnicki <adam@v-lo.krakow.pl>
|
||||
Alan Curry <pacman@tardis.mars.net>
|
||||
Aleksa Sarai <cyphar@cyphar.com>
|
||||
Alexander O. Yuriev <alex@bach.cis.temple.edu>
|
||||
Algis Rudys <arudys@rice.edu>
|
||||
Andreas Jaeger <aj@arthur.rhein-neckar.de>
|
||||
Andy Zaugg <andy.zaugg@gmail.com>
|
||||
Aniello Del Sorbo <anidel@edu-gw.dia.unisa.it>
|
||||
Anton Gluck <gluc@midway.uchicago.edu>
|
||||
Arkadiusz Miskiewicz <misiek@pld.org.pl>
|
||||
Ben Collins <bcollins@debian.org>
|
||||
Brian R. Gaeke <brg@dgate.org>
|
||||
Calle Karlsson <ckn@kash.se>
|
||||
Chip Rosenthal <chip@unicom.com>
|
||||
Chris Evans <lady0110@sable.ox.ac.uk>
|
||||
Chris Lamb <chris@chris-lamb.co.uk>
|
||||
Cristian Gafton <gafton@sorosis.ro>
|
||||
Dan Walsh <dwalsh@redhat.com>
|
||||
Darcy Boese <possum@chardonnay.niagara.com>
|
||||
Dave Hagewood <admin@arrowweb.com>
|
||||
David A. Holland <dholland@hcs.harvard.edu>
|
||||
David Frey <David.Frey@lugs.ch>
|
||||
Ed Carp <ecarp@netcom.com>
|
||||
Ed Neville <ed@s5h.net>
|
||||
Eric W. Biederman" <ebiederm@xmission.com>
|
||||
Floody <flood@evcom.net>
|
||||
Frank Denis <j@4u.net>
|
||||
George Kraft IV <gk4@us.ibm.com>
|
||||
Greg Mortensen <loki@world.std.com>
|
||||
Guido van Rooij
|
||||
Guy Maor <maor@debian.org>
|
||||
Hrvoje Dogan <hdogan@bjesomar.srce.hr>
|
||||
Iker Pedrosa <ipedrosa@redhat.com>
|
||||
Jakub Hrozek <jhrozek@redhat.com>
|
||||
Janos Farkas <chexum@bankinf.banki.hu>
|
||||
Jason Franklin <jason.franklin@quoininc.com>
|
||||
Jay Soffian <jay@lw.net>
|
||||
Jesse Thilo <Jesse.Thilo@pobox.com>
|
||||
Joey Hess <joey@kite.ml.org>
|
||||
John Adelsberger <jja@umr.edu>
|
||||
Jonathan Hankins <jhankins@mailserv.homewood.k12.al.us>
|
||||
Jon Lewis <jlewis@lewis.org>
|
||||
Joshua Cowan <jcowan@hermit.reslife.okstate.edu>
|
||||
Judd Bourgeois <shagboy@bluesky.net>
|
||||
Juergen Heinzl <unicorn@noris.net>
|
||||
Juha Virtanen <jiivee@iki.fi>
|
||||
Julian Pidancet <julian.pidancet@gmail.com>
|
||||
Julianne Frances Haugh <julie78787@gmail.com>
|
||||
Leonard N. Zubkoff <lnz@dandelion.com>
|
||||
Luca Berra <bluca@www.polimi.it>
|
||||
Lukáš Kuklínek <lkukline@redhat.com>
|
||||
Lutz Schwalowsky <schwalow@mineralogie.uni-hamburg.de>
|
||||
Marc Ewing <marc@redhat.com>
|
||||
Martin Bene <mb@sime.com>
|
||||
Martin Mares <mj@gts.cz>
|
||||
Michael Meskes <meskes@topsystem.de>
|
||||
Michael Talbot-Wilson <mike@calypso.bns.com.au>
|
||||
Michael Vetter <jubalh@iodoru.org>
|
||||
Mike Frysinger <vapier@gentoo.org>
|
||||
Mike Pakovic <mpakovic@users.southeast.net>
|
||||
Nicolas François <nicolas.francois@centraliens.net>
|
||||
Nikos Mavroyanopoulos <nmav@i-net.paiko.gr>
|
||||
Pavel Machek <pavel@bug.ucw.cz>
|
||||
Peter Vrabec <pvrabec@redhat.com>
|
||||
Phillip Street
|
||||
Rafał Maszkowski <rzm@icm.edu.pl>
|
||||
Rani Chouha <ranibey@smartec.com>
|
||||
Sami Kerola <kerolasa@rocketmail.com>
|
||||
Scott Garman <scott.a.garman@intel.com>
|
||||
Sebastian Rick Rijkers <srrijkers@gmail.com>
|
||||
Seraphim Mellos <mellos@ceid.upatras.gr>
|
||||
Shane Watts <shane@nexus.mlckew.edu.au>
|
||||
Steve M. Robbins <steve@nyongwa.montreal.qc.ca>
|
||||
Thorsten Kukuk <kukuk@suse.de>
|
||||
Tim Hockin <thockin@eagle.ais.net>
|
||||
Timo Karjalainen <timok@iki.fi>
|
||||
Ulisses Alonso Camaro <ulisses@pusa.eleinf.uv.es>
|
||||
Werner Fink <werner@suse.de>
|
||||
143
COPYING
143
COPYING
@@ -1,118 +1,41 @@
|
||||
NOTE:
|
||||
This license has been obsoleted by the change to the BSD-style copyright.
|
||||
You may continue to use this license if you wish, but you are under no
|
||||
obligation to do so.
|
||||
SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
(*
|
||||
This document is freely plagiarised from the 'Artistic Licence',
|
||||
distributed as part of the Perl v4.0 kit by Larry Wall, which is
|
||||
available from most major archive sites. I stole it from CrackLib.
|
||||
All files under this project either
|
||||
|
||||
$Id$
|
||||
*)
|
||||
1. fall under the BSD 3 clause license (by default).
|
||||
|
||||
This documents purpose is to state the conditions under which this
|
||||
Package (See definition below) viz: "Shadow", the Shadow Password Suite
|
||||
which is held by Julianne Frances Haugh, may be copied, such that the
|
||||
copyright holder maintains some semblance of artistic control over the
|
||||
development of the package, while giving the users of the package the
|
||||
right to use and distribute the Package in a more-or-less customary
|
||||
fashion, plus the right to make reasonable modifications.
|
||||
2. carry an SPDX header declaring what license applies.
|
||||
|
||||
So there.
|
||||
or
|
||||
|
||||
***************************************************************************
|
||||
3. list a full custom license
|
||||
|
||||
Definitions:
|
||||
This software is originally
|
||||
|
||||
* Copyright (c) 1989 - 1994, Julianne Frances Haugh
|
||||
|
||||
A "Package" refers to the collection of files distributed by the
|
||||
Copyright Holder, and derivatives of that collection of files created
|
||||
through textual modification, or segments thereof.
|
||||
|
||||
"Standard Version" refers to such a Package if it has not been modified,
|
||||
or has been modified in accordance with the wishes of the Copyright
|
||||
Holder.
|
||||
|
||||
"Copyright Holder" is whoever is named in the copyright or copyrights
|
||||
for the package.
|
||||
|
||||
"You" is you, if you're thinking about copying or distributing this
|
||||
Package.
|
||||
|
||||
"Reasonable copying fee" is whatever you can justify on the basis of
|
||||
media cost, duplication charges, time of people involved, and so on.
|
||||
(You will not be required to justify it to the Copyright Holder, but
|
||||
only to the computing community at large as a market that must bear the
|
||||
fee.)
|
||||
|
||||
"Freely Available" means that no fee is charged for the item itself,
|
||||
though there may be fees involved in handling the item. It also means
|
||||
that recipients of the item may redistribute it under the same
|
||||
conditions they received it.
|
||||
|
||||
|
||||
1. You may make and give away verbatim copies of the source form of the
|
||||
Standard Version of this Package without restriction, provided that you
|
||||
duplicate all of the original copyright notices and associated
|
||||
disclaimers.
|
||||
|
||||
2. You may apply bug fixes, portability fixes and other modifications
|
||||
derived from the Public Domain or from the Copyright Holder. A Package
|
||||
modified in such a way shall still be considered the Standard Version.
|
||||
|
||||
3. You may otherwise modify your copy of this Package in any way,
|
||||
provided that you insert a prominent notice in each changed file stating
|
||||
how and when AND WHY you changed that file, and provided that you do at
|
||||
least ONE of the following:
|
||||
|
||||
a) place your modifications in the Public Domain or otherwise make them
|
||||
Freely Available, such as by posting said modifications to Usenet or an
|
||||
equivalent medium, or placing the modifications on a major archive site
|
||||
such as uunet.uu.net, or by allowing the Copyright Holder to include
|
||||
your modifications in the Standard Version of the Package.
|
||||
|
||||
b) use the modified Package only within your corporation or organization.
|
||||
|
||||
c) rename any non-standard executables so the names do not conflict with
|
||||
standard executables, which must also be provided, and provide separate
|
||||
documentation for each non-standard executable that clearly documents
|
||||
how it differs from the Standard Version.
|
||||
|
||||
d) make other distribution arrangements with the Copyright Holder.
|
||||
|
||||
4. You may distribute the programs of this Package in object code or
|
||||
executable form, provided that you do at least ONE of the following:
|
||||
|
||||
a) distribute a Standard Version of the executables and library files,
|
||||
together with instructions (in the manual page or equivalent) on where
|
||||
to get the Standard Version.
|
||||
|
||||
b) accompany the distribution with the machine-readable source of the
|
||||
Package with your modifications.
|
||||
|
||||
c) accompany any non-standard executables with their corresponding
|
||||
Standard Version executables, giving the non-standard executables
|
||||
non-standard names, and clearly documenting the differences in manual
|
||||
pages (or equivalent), together with instructions on where to get the
|
||||
Standard Version.
|
||||
|
||||
d) make other distribution arrangements with the Copyright Holder.
|
||||
|
||||
5. You may charge a reasonable copying fee for any distribution of this
|
||||
Package. You may charge any fee you choose for support of this Package.
|
||||
YOU MAY NOT CHARGE A FEE FOR THIS PACKAGE ITSELF. However, you may
|
||||
distribute this Package in aggregate with other (possibly commercial)
|
||||
programs as part of a larger (possibly commercial) software distribution
|
||||
provided that YOU DO NOT ADVERTISE this package as a product of your
|
||||
own.
|
||||
|
||||
6. The name of the Copyright Holder may not be used to endorse or
|
||||
promote products derived from this software without specific prior
|
||||
written permission.
|
||||
|
||||
7. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
The End
|
||||
* All rights reserved.
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
|
||||
291
ChangeLog
291
ChangeLog
@@ -1,3 +1,264 @@
|
||||
2022-01-02 Serge Hallyn <serge@hallyn.com>
|
||||
|
||||
* build: include lib/shadowlog_internal.h in dist tarballs (Sam James)
|
||||
|
||||
2022-01-02 Serge Hallyn <serge@hallyn.com>
|
||||
|
||||
* Handle possible TOCTTOU issues in usermod/userdel (edneville)
|
||||
* (CVE-2013-4235)
|
||||
* Use O_NOFOLLOW when copying file
|
||||
* Kill all user tasks in userdel
|
||||
* Fix useradd -D segfault (Xi Ruoyao)
|
||||
* Clean up obsolete libc feature-check ifdefs (Alejandro Colomar)
|
||||
* Fix -fno-common build breaks due to duplicate Prog declarations
|
||||
(Adam Sampson)
|
||||
* Have single date_to_str definition (Alejandro Colomar)
|
||||
* Fix libsubid SONAME version (Sam James)
|
||||
|
||||
2021-12-19 Serge Hallyn <serge@hallyn.com>
|
||||
|
||||
Note: From this release forward, su from this package should be
|
||||
considered deprecated. Please replace any users of it with su from
|
||||
util-linux. Please open an issue if there is a problem with that.
|
||||
We intend to remove it in an upcoming release.
|
||||
|
||||
* libsubid fixes (Xi Ruoyao, Serge Hallyn, Iker Pedrosa, Mike Gilbert,
|
||||
GalaxyMaster, and Luís Ferreira)
|
||||
* Rename the test program list_subid_ranges to getsubids, write
|
||||
a manpage, so distros can ship it. (Iker Pedrosa)
|
||||
* Add libeconf dep for new*idmap (Iker Pedrosa)
|
||||
* Allow all group types with usermod -G (Iker Pedrosa)
|
||||
* Avoid useradd generating empty subid range (Iker Pedrosa)
|
||||
* Handle NULL pw_passwd (Jaroslav Jindrak)
|
||||
* Fix default value SHA_get_salt_rounds (Mike Gilbert)
|
||||
* Use https where possible in README (Paul Menzel)
|
||||
* Update content and format of README (Iker Pedrosa)
|
||||
* Translation updates (Balint Reczey, Frans Spiesschaert)
|
||||
* Switch from xml2po to itstool in 'make dist' (Serge Hallyn)
|
||||
* Fix double frees (Michael Vetter)
|
||||
* Add LOG_INIT configurable to useradd (Andy Zaugg)
|
||||
* Add CREATE_MAIL_SPOOL documentation (Andy Zaugg)
|
||||
* Create a security.md
|
||||
* Fix su never being SIGKILLd when trapping TERM (Ruihan li)
|
||||
* Fix wrong SELinux labels in several possible cases (Iker Pedrosa)
|
||||
* Fix missing chmod in chadowtb_move (GalaxyMaster)
|
||||
* Handle malformed hushlogins entries (Tobias Stoeckmann)
|
||||
* Fix groupdel segv when passwd does not exist (François Rigault)
|
||||
* Fix covscan-found newgrp segfault (Iker Pedrosa)
|
||||
* Remove trailing slash on hoedir (Ed Neville)
|
||||
* Fix passwd -l message - it does not change expirey (Ed Neville)
|
||||
* Fix SIGCHLD handling bugs in su and vipw (Tobias Stoeckmann)
|
||||
* Remove special case for "" in usermod (Alejandro Colomar)
|
||||
* Implement usermod -rG to remove a specific group
|
||||
(Andy Zaugg)
|
||||
* call pam_end() after fork in child path for su and login
|
||||
(Björn Fischer)
|
||||
* useradd: In absence of /etc/passwd, assume 0 == root
|
||||
(Ludwig Nussel)
|
||||
* lib: check NULL before freeing data (Iker Pedrosa)
|
||||
* Fix pwck segfault (Iker Pedrosa)
|
||||
|
||||
2021-07-22 Serge Hallyn <serge@hallyn.com>
|
||||
|
||||
* Updated translations (Björn Esser, Juergen Hoetzel)
|
||||
* Major salt updates (Björn Esser)
|
||||
* Various coverity and cleanup fixes (Iker Pedrosa)
|
||||
* Consistently use 0 to disable PASS_MIN_DAYS in man (tzccinct)
|
||||
* Implement NSS support for subids and a libsubid (Serge Hallyn)
|
||||
* setfcap: retain setfcap when mapping uid 0 (Christian Brauner)
|
||||
* login.defs: include HMAC_CRYPTO_ALGO key (Iker Pedrosa)
|
||||
* selinux fixes (Christian Göttsche)
|
||||
* Fix path prefix path handling (Lucas Servén Marín)
|
||||
* Manpage updates (tzccinct, Sevan Janiyan, Iker Pedrosa, Geert Ijewski,
|
||||
谭九鼎, Jamin W. Collins, towerpark, andydna, Frans Spiesschaert)
|
||||
* Treat an empty passwd field as invalid (Haelwenn Monnier)
|
||||
* newxidmap: allow running under alternative gid (Martijn de Gouw)
|
||||
* usermod: check that shell is executable (Geert Ijewski)
|
||||
* Add yescript support (Rodolphe Bréard)
|
||||
* useradd memleak fixes (whzhe)
|
||||
* useradd: use built-in settings by default (Ludwig Nussel)
|
||||
* getdefs: add foreign (non-shadow-utils) items (Karel Zak)
|
||||
* buffer overflow fixes (Tobias Stoeckmann)
|
||||
* Adding run-parts style for pre and post useradd/del (ed@s5h.net)
|
||||
|
||||
2020-01-23 Serge Hallyn <serge@hallyn.com>
|
||||
|
||||
* selinux: inclue stdio (Michael Vetter)
|
||||
* man: don't suggest making groupmems user-writeable (Michael Weiser)
|
||||
* Makefile: bail out on error in for loops (Wolfgang Bumiller)
|
||||
* Adding logging of SSH_ORIGINAL_COMMAND to nologin. (ed@s5h.net)
|
||||
* add new HOME_MODE login.defs option (Duncan Overbruck)
|
||||
* Add tty logging to useradd (ed@s5h.net)
|
||||
* Useradd: make non-executable shell check only a warning (Tomas Mraz)
|
||||
* Update Dutch translation (Frans-Spiesschaert)
|
||||
* user_busy: Do not mistake a regular user process for a namespaced one (Tomas Mraz)
|
||||
* Revert "Honor --sbindir and --bindir for binary installation" Patrick McLean)
|
||||
|
||||
2019-12-20 Dave Reisner <dreisner@archlinux.org>
|
||||
|
||||
* Do not auto-enable acct_tools_setuid just because
|
||||
pam is enabled. NOTE - any distros which are relying
|
||||
on this behavior will need to switch to configure
|
||||
--enable-account-tools-setuid
|
||||
|
||||
2019-12-01 Serge Hallyn <serge@hallyn.com>
|
||||
|
||||
* Release 4.8
|
||||
* Initial optional bcrypt support.
|
||||
* Make build/install of 'su' optional.
|
||||
* Fix for vipw not resuming correctly when suspended
|
||||
* Sync password field descriptions in manpages
|
||||
* Check for valid shell argument in useradd
|
||||
* Allow translation of new strings through POTFILES.in
|
||||
* Migrate to itstool for translations
|
||||
* Migrate to new SELinux api
|
||||
* Support --enable-vendordir
|
||||
* pwck: Only check homedir if set and not a system user
|
||||
* Support nonstandard usernames
|
||||
* sget{pw,gr}ent: check for data at EOL
|
||||
* Add YYY-MM-DD support in chage
|
||||
* Fix failing chmod calls for suidubins
|
||||
* Fix --sbindir and --bindir for binary installations
|
||||
* Fix LASTLOG_UID_MAX in login.defs
|
||||
* Fix configure error with dash
|
||||
|
||||
2019-06-13 Serge Hallyn <serge@hallyn.com>
|
||||
|
||||
* Release 4.7
|
||||
* Spawn: don't loop forever on ECHILD
|
||||
* Do not fail locking if there is a stale lockfile Tomas Mraz)
|
||||
* Use lckpwdf if prefix not set (Tomas Mraz)
|
||||
* Build: check correct DocBook version (Jan Tojnar)
|
||||
* Usermod: Print 'no changes' to stdout, not stderr (Serge Hallyn)
|
||||
* Add support for btrfs subvolumes for home (Adam Majer)
|
||||
* Fix chpasswd long line handling (Nathan Ruiz)
|
||||
* Use secure_getenv for gettime (Chris Lamb)
|
||||
* Make sp_lstchg reproducible (Chris Lamb)
|
||||
* Do not crash commonio_close if db file is not open (Tomas Mraz)
|
||||
* Don't flush nscd and sssd cache in read-only mode (Charlie Vuillemez)
|
||||
* French manpage update (Alban VIDAL)
|
||||
* Fix manpage defaults for SUB_UID/GID_COUNT (Tomas Mraz)
|
||||
* Sync po files from shadow.pot (Alban VIDAL)
|
||||
* Usermod: guard against unsafe chown of homedir contents (Tomas Mraz)
|
||||
* Add LASTLOG_UID_MAX to login.defs (Tomas Mraz)
|
||||
* new[ug]idmap file capabilities support (Giuseppe Scrivano and Christian Brauner)
|
||||
* Fix segfault in useradd (Tomas Mraz)
|
||||
* Coverity issues (Tomas Mraz)
|
||||
* Flush sssd caches (Jakub Hrozek)
|
||||
* Log UID in nologin (Vladimir Ivanov)
|
||||
* run pam_getenvlist after setup_env in su.c (Michael Vogt)
|
||||
* Support systems with only utmpx (A. Wilcox)
|
||||
* Fix unguarded ENABLE_SUBIDS code (Jan Chren (rindeal))
|
||||
* Update po/zh_CN translation (Lion Yang)
|
||||
* Create parent dirs for useradd -m (Michael Vetter)
|
||||
* Prevent usermod segv
|
||||
* Fix usermod crash (fariouche)
|
||||
|
||||
2018-04-29 Serge Hallyn <serge@hallyn.com>
|
||||
|
||||
* Release 4.6
|
||||
* Newgrp: avoid unnecessary lookups
|
||||
* Make language less binary
|
||||
* Add error when turning off man switch
|
||||
* Spelling fixes
|
||||
* Make userdel work with -R
|
||||
* newgidmap: enforce setgroups=deny if self-mapping a group
|
||||
* Norwegian bokmål translation
|
||||
* pwck: prevent crash by not passing O_CREAT
|
||||
* WITH_TCB fixes from Mandriva
|
||||
* Fix pwconv and grpconv entry skips
|
||||
* Fix -- slurping in su
|
||||
* add --prefix option
|
||||
|
||||
2017-07-16 Serge Hallyn <serge@hallyn.com>
|
||||
|
||||
* Import new Dutch translations.
|
||||
|
||||
2017-07-10 Serge Hallyn <serge@hallyn.com>
|
||||
|
||||
* Expand error codes for groupmod.
|
||||
|
||||
2017-05-17 Serge Hallyn <serge@hallyn.com>
|
||||
|
||||
* Release 4.5
|
||||
|
||||
2017-05-17 Serge Hallyn <serge@hallyn.com>
|
||||
|
||||
* Patch from Tobias Stoeckmann fixing regression in previous CVE fix
|
||||
preventing SIGTERM to su from being propagated to the job.
|
||||
* Patch from Chris Lamb making sp_lstchg shadow field reproducible.
|
||||
* Merge Russian translation updates from Yuri Kozlov
|
||||
* Fix missing close of subuid file on error
|
||||
|
||||
2017-02-23 Serge Hallyn <serge@hallyn.com>
|
||||
|
||||
* Merge patch by Tobias Stoeckmann <tobias@stoeckmann.org> to fix
|
||||
the equivalent of util-linux CVE-2017-2616.
|
||||
|
||||
2017-02-08 Serge Hallyn <serge@hallyn.com>
|
||||
|
||||
* Update Kazakh translations
|
||||
* Consult configuration before calculating subuids
|
||||
* Remove misplaced semicolon
|
||||
|
||||
2017-01-29 Serge Hallyn <serge@hallyn.com>
|
||||
|
||||
* Patch from Fedora to improve performance with SSSD, Winbind,
|
||||
or nss_ldap. (Tomas Mraz)
|
||||
* Make sure knowndef_table is NULL-terminated. (Bernhard Rosenkränzer)
|
||||
|
||||
2016-12-21 Serge Hallyn <serge@hallyn.com>
|
||||
|
||||
* Drop leading underscore from _COMMONIO_H and _SHADOWIO_H
|
||||
* Fix readability in usermod error messages.
|
||||
* Reset user in tallylog
|
||||
* Add audit support to su
|
||||
|
||||
2016-12-02 Serge Hallyn <serge@hallyn.com>
|
||||
|
||||
* changes since 4.4
|
||||
- Use sizeof rather than hardcoding snprintf args
|
||||
- Fix useradd improper default loading
|
||||
- Update Vietnamese translations
|
||||
- Update Polish translations
|
||||
- Remove non-POSIX chmod option in Makefile
|
||||
- Fix suidubins assignments
|
||||
- Fix --add-subuids etc spelling in manpages
|
||||
- Audit homedir ownership change.
|
||||
- Print error on selinux file context update failure
|
||||
- Keep original file perms when creating a backup
|
||||
|
||||
* (henceforth we'll update Changelog with each commit
|
||||
and proper credit)
|
||||
|
||||
2016-12-02 Serge Hallyn <serge@hallyn.com>
|
||||
|
||||
* Changes since 4.2.1:
|
||||
- Documentation, error report and translations updates
|
||||
- Replace path_max with 32
|
||||
- User namespace support fixes/updates including:
|
||||
- Correct sanity checks in newXidmap
|
||||
- Fix building without subuid support
|
||||
- Add /etc/subuid support for UID matching
|
||||
- Support subuid for nonlocal users
|
||||
- Default to 65536 subuid allocations
|
||||
- Respect -r
|
||||
- Check for range overflows
|
||||
- Add tests from svn tree
|
||||
- Use AC_CHECK_SIZEOF for uid_t size checks
|
||||
- Accomodate missing /etc and login.defs
|
||||
- Support FORCE_SHADOW
|
||||
- Be more robust in hostile environment
|
||||
- Allow removing a primary group
|
||||
- Clear passwords on __pw_dup errors
|
||||
- Memory leak fix in commonio_update and get_map_ranges
|
||||
- Fix resource leak in syslog_sg
|
||||
- Fix user busy error at userdel
|
||||
- Support set/clear lastlog record via lastlog command
|
||||
- Add --no-create-home as longopt for -M
|
||||
- Fix signal races
|
||||
- Reduce syslog priority of common usage events
|
||||
|
||||
2013-08-25 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
* src/vipw.c: After waitpid(), use errno only if waitpid returned
|
||||
@@ -84,7 +345,7 @@
|
||||
2013-08-15 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
* src/usermod.c: Check early if /etc/subuid (/etc/subgid) exists
|
||||
when option -v/-V (-w/-W) are provided.
|
||||
when option -v/-V (-w/-W) are provided.
|
||||
|
||||
2013-08-15 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
@@ -461,8 +722,8 @@
|
||||
|
||||
* configure.in: Prepare for next point release 4.2.
|
||||
* if using the static char* for pw_dir, strdup it so
|
||||
pw_free() can be used. (Closes: Debian#691459, alioth#313957)
|
||||
* Kill the child process group, rather than just the
|
||||
pw_free() can be used. (Closes: Debian#691459, alioth#313957)
|
||||
* Kill the child process group, rather than just the
|
||||
immediate child; this is needed now that su no
|
||||
longer starts a controlling terminal when not running an
|
||||
interactive shell (closes: Debian#713979)
|
||||
@@ -689,7 +950,7 @@
|
||||
|
||||
* po/pt.po: Updated to 557t.
|
||||
|
||||
2012-01-19 Holger Wansing <linux@wansing-online.de>
|
||||
2012-01-19 Holger Wansing <linux@wansing-online.de>
|
||||
|
||||
* po/de.po: Updated to 557t.
|
||||
|
||||
@@ -1276,8 +1537,8 @@
|
||||
* NEWS, src/chpasswd.c: Create a shadow entry if the password is
|
||||
set to 'x' in passwd and there are no entry in shadow for the
|
||||
user.
|
||||
* NEWS, src/chgpasswd.c: Create a gshadow entry if the password is
|
||||
set to 'x' in group and there are no entry in gshadow for the
|
||||
* NEWS, src/chgpasswd.c: Create a gshadow entry if the password is
|
||||
set to 'x' in group and there are no entry in gshadow for the
|
||||
group.
|
||||
|
||||
2011-07-28 Nicolas François <nicolas.francois@centraliens.net>
|
||||
@@ -1349,7 +1610,7 @@
|
||||
2011-07-22 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
* libmisc/find_new_gid.c, libmisc/find_new_uid.c: Fail in case of
|
||||
invalid configuration.
|
||||
invalid configuration.
|
||||
* libmisc/find_new_gid.c, libmisc/find_new_uid.c: Updated
|
||||
comments.
|
||||
* libmisc/find_new_gid.c, libmisc/find_new_uid.c: Be more strict
|
||||
@@ -1586,7 +1847,7 @@
|
||||
man/login.defs.d/DEFAULT_HOME.xml,
|
||||
man/login.defs.d/LOGIN_RETRIES.xml,
|
||||
man/login.defs.d/MD5_CRYPT_ENAB.xml,
|
||||
man/login.defs.d/PORTTIME_CHECKS_ENAB.xml,
|
||||
man/login.defs.d/PORTTIME_CHECKS_ENAB.xml,
|
||||
man/login.defs.d/SHA_CRYPT_MIN_ROUNDS.xml:
|
||||
Fix typos
|
||||
* man/po/de.po: German translation of manpages completed
|
||||
@@ -1633,7 +1894,7 @@
|
||||
|
||||
2011-03-30 YunQiang Su <wzssyqa@gmail.com>
|
||||
|
||||
* man/po/zh_CN.po: convert Simplified Chinese translation
|
||||
* man/po/zh_CN.po: convert Simplified Chinese translation
|
||||
of manpages to gettext
|
||||
* po/zh_CN.po: Simplified Chinese translation completed
|
||||
|
||||
@@ -1772,7 +2033,7 @@
|
||||
boolean. safe_system last argument is a boolean.
|
||||
* libmisc/system.c: Check return value of dup2.
|
||||
* libmisc/system.c: Do not check *printf/*puts return value.
|
||||
* libmisc/system.c: Do not check execve return value.
|
||||
* libmisc/system.c: Do not check execve return value.
|
||||
* libmisc/salt.c: Do not check *printf/*puts return value.
|
||||
* libmisc/loginprompt.c: Do not check gethostname return value.
|
||||
* libmisc/find_new_gid.c, libmisc/find_new_uid.c: Do not check
|
||||
@@ -1925,7 +2186,7 @@
|
||||
2010-04-04 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
* src/useradd.c: spool is a constant string.
|
||||
* src/useradd.c: Set the new copy_tree's paramater 'copy_root' to false
|
||||
* src/useradd.c: Set the new copy_tree's paramater 'copy_root' to false
|
||||
|
||||
2010-04-04 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
@@ -4774,7 +5035,7 @@
|
||||
<sgrubb@redhat.com>
|
||||
* src/groupadd.c: Log to audit with type AUDIT_ADD_GROUP instead
|
||||
of AUDIT_USER_CHAUTHTOK.
|
||||
* src/groupdel.c: Log to audit with type AUDIT_DEL_GROUP instead
|
||||
* src/groupdel.c: Log to audit with type AUDIT_DEL_GROUP instead
|
||||
of AUDIT_USER_CHAUTHTOK.
|
||||
* src/useradd.c: Log to audit with type AUDIT_ADD_USER /
|
||||
AUDIT_ADD_GROUP / AUDIT_USYS_CONFIG instead of
|
||||
@@ -5030,7 +5291,7 @@
|
||||
* NEWS, src/gpasswd.c: Use getopt_long instead of getopt. Added
|
||||
support for long options --add (-a), --delete (-d),
|
||||
--remove-password (-r), --restrict (-R), --administrators (-A),
|
||||
and --members (-M)
|
||||
and --members (-M)
|
||||
* man/gpasswd.1.xml: Document the new long options.
|
||||
* src/gpasswd.c: The sgrp structure is only used if SHADOWGRP is
|
||||
defined.
|
||||
@@ -7219,7 +7480,7 @@
|
||||
to mimic useradd's behavior choices of UID and GID.
|
||||
* src/newusers.c: Reuse the generic find_new_uid() and
|
||||
find_new_gid() functions. This permits to respect the
|
||||
UID_MIN/UID_MAX and GID_MIN/GID_MAX variables, should
|
||||
UID_MIN/UID_MAX and GID_MIN/GID_MAX variables, should
|
||||
* src/newusers.c: Check if the user or group exist using the
|
||||
external databases (with the libc getpwnam/getgrnam functions).
|
||||
Refuse to update an user which exist in an external database but
|
||||
@@ -9016,7 +9277,7 @@
|
||||
Debian's patch 202_it_man_uses_gettext. Thanks to Giuseppe
|
||||
Sacco who contributed the Italian translation.
|
||||
* man/de/de.po: (nearly) complete German translation of man pages
|
||||
Imported from Debian's patch 203_de-man-update. Thanks to
|
||||
Imported from Debian's patch 203_de-man-update. Thanks to
|
||||
Simon Brandmair
|
||||
* src/usermod.c: Clarify the online help of usermod for "-a"
|
||||
Imported from Debian's patch 402-clarify_usermod_usage
|
||||
|
||||
13
Makefile.am
13
Makefile.am
@@ -2,7 +2,14 @@
|
||||
|
||||
EXTRA_DIST = NEWS README TODO shadow.spec.in
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.5 dist-bzip2 foreign
|
||||
SUBDIRS = libmisc lib
|
||||
|
||||
SUBDIRS = po man libmisc lib src \
|
||||
contrib doc etc
|
||||
if ENABLE_SUBIDS
|
||||
SUBDIRS += libsubid
|
||||
endif
|
||||
|
||||
SUBDIRS += src po contrib doc etc
|
||||
|
||||
if ENABLE_REGENERATE_MAN
|
||||
SUBDIRS += man
|
||||
endif
|
||||
|
||||
160
NEWS
160
NEWS
@@ -15,7 +15,7 @@ shadow-4.1.5.1 -> shadow-4.2 UNRELEASED
|
||||
|
||||
- su
|
||||
* When su receives a signal (SIGTERM, or SIGINT/SIGQUIT in non
|
||||
interactive mode), kill the child process group, rather than just the
|
||||
interactive mode), kill the child process group, rather than just the
|
||||
immediate child.
|
||||
* Fix segmentation faults for users without a proper home or shell in
|
||||
their passwd entries.
|
||||
@@ -622,7 +622,7 @@ shadow-4.0.18.2 -> shadow-4.1.0 09-12-2007
|
||||
- Add support for uClibc with no l64a().
|
||||
- userdel, usermod: Fix infinite loop caused by erroneous group file
|
||||
containing two entries with the same name. (The fix strategy differs
|
||||
from
|
||||
from
|
||||
(https://bugzilla.redhat.com/show_bug.cgi?id=240915)
|
||||
- userdel: Abort if an error is detected while updating the passwd or group
|
||||
databases. The passwd or group files will not be written.
|
||||
@@ -654,9 +654,9 @@ shadow-4.0.18.2 -> shadow-4.1.0 09-12-2007
|
||||
- Use MD5_CRYPT_ENAB, ENCRYPT_METHOD, SHA_CRYPT_MIN_ROUNDS, and
|
||||
SHA_CRYPT_MAX_ROUNDS to define the default encryption algorithm for the
|
||||
passwords.
|
||||
- chpaswd, chgpasswd, newusers: New options -c/--crypt-method and
|
||||
- chpasswd, chgpasswd, newusers: New options -c/--crypt-method and
|
||||
-s/--sha-rounds to supersede the system default encryption algorithm.
|
||||
- chpaswd, chgpasswd, newusers: DES is no more the default algorithm. They
|
||||
- chpasswd, chgpasswd, newusers: DES is no more the default algorithm. They
|
||||
will respect the system default configured in /etc/login.defs
|
||||
|
||||
*** documentation:
|
||||
@@ -701,14 +701,14 @@ shadow-4.0.17 -> shadow-4.0.18 01-08-2006
|
||||
- groupadd, groupmod, useradd, usermod: fixed UID/GID overflow (fixed
|
||||
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=198920)
|
||||
- passwd, useradd, usermod: fixed inactive/mindays/warndays/maxdays overflow
|
||||
(simillar to RH#198920),
|
||||
- groupmems: rewrited for use PAM and getopt_long() and now it is enabled
|
||||
(similar to RH#198920),
|
||||
- groupmems: rewritten for use PAM and getopt_long() and now it is enabled
|
||||
for build and install (patch by George Kraft <gk4@swbell.net>),
|
||||
- S/Key: removed assign getpass() to libshadow_getpass() on autoconf level
|
||||
(patch by Ulrich Mueller <ulm@kph.uni-mainz.de>; http://bugs.gentoo.org/139966),
|
||||
- usermod: back to previous -a option semantics and clarify -a behavior
|
||||
on documentation level (by Greg Schafer <gschafer@zip.com.au>),
|
||||
- chsh, groupmod: rewrited for use getopt_long().
|
||||
- chsh, groupmod: rewritten for use getopt_long().
|
||||
- updated translations: ca, cs, da, eu, fr, gl, hu, ko, pl, pt, ru, sv, tr, uk, vi.
|
||||
*** documentation:
|
||||
- fr and ru man pages are up to date,
|
||||
@@ -743,7 +743,7 @@ shadow-4.0.15 -> shadow-4.0.16 05-06-2006
|
||||
|
||||
*** general:
|
||||
- userdel: better fix for old CERT VU#312962 (which was fixed in shadow 4.0.8):
|
||||
fixed forgoten checking of the return value from fchown() before
|
||||
fixed forgotten checking of the return value from fchown() before
|
||||
proceeding with the fchmod() (based on Owl patch prepared by
|
||||
Rafal Wojtczuk <nergal@owl.openwall.com>),
|
||||
- userdel: use login.defs::MAIL_DIR instead hardcoded /var/mail in created
|
||||
@@ -755,7 +755,7 @@ shadow-4.0.15 -> shadow-4.0.16 05-06-2006
|
||||
passwords and libshadow_getpass() is used only because libc getpass()
|
||||
do not handles password prompting with echo enabled,
|
||||
- move login.defs::MD5_CRYPT_ENAB to non-PAM part,
|
||||
- userdel: rewrited for use getopt_log(),
|
||||
- userdel: rewritten for use getopt_log(),
|
||||
- install default/template configuration files:
|
||||
-- if shadow is configured with use PAM install /etc/pam.d/* files,
|
||||
-- if shadow do not uses PAM install /etc/{limits,login.acces} files,
|
||||
@@ -793,7 +793,7 @@ shadow-4.0.15 -> shadow-4.0.16 05-06-2006
|
||||
- updated ru login.defs(5), passwd(1), userdel(8), usermod(8) man pages,
|
||||
- pw_auth(3) man page removed (outdated),
|
||||
- install limits(5), login.access(5) and porttime(5) man pages only when
|
||||
shadow is builded with PAM support disabled,
|
||||
shadow is built with PAM support disabled,
|
||||
- passwd(1): better document how password strength is checked
|
||||
(fixed http://bugs.debian.org/115380),
|
||||
- usermod(8): added missing -a option description
|
||||
@@ -816,7 +816,7 @@ shadow-4.0.14 -> shadow-4.0.15 13-03-2006
|
||||
- login: default UMASK if not specified in login.defs is 022 (pointed by
|
||||
Peter Vrabec <pvrabec@redhat.com>),
|
||||
- chgpasswd: new tool (by Jonas Meurer <mejo@debian.org>),
|
||||
- lastlog: print the usage and exit if an additional argument is profided to
|
||||
- lastlog: print the usage and exit if an additional argument is provided to
|
||||
lastlog (merge 488_laslog_verify_arguments Debian patch),
|
||||
- login, newgrp, nologin, su: do not link with libselinux (merge
|
||||
490_link_selinux_only_when_needed Debian patch),
|
||||
@@ -830,9 +830,9 @@ shadow-4.0.14 -> shadow-4.0.15 13-03-2006
|
||||
tries exceeded,
|
||||
- always prints the number of tries in the syslog entry.
|
||||
- add special handling for PAM_ABORT
|
||||
- add an entry to failog, as when USE_PAM is not defined. (#53164)
|
||||
- add an entry to faillog, as when USE_PAM is not defined. (#53164)
|
||||
- changed pam_end to PAM_END. This is certainly was a mistake. PAM_END is
|
||||
pam_close_seesion + pam_end. Here, the session is still not open, we
|
||||
pam_close_session + pam_end. Here, the session is still not open, we
|
||||
don't have to close it.
|
||||
- a HAVE_PAM_FAIL_DELAY is missing,
|
||||
- su: fixed pam session support (patch from Topi Miettinen; fixed #57526,
|
||||
@@ -840,7 +840,7 @@ shadow-4.0.14 -> shadow-4.0.15 13-03-2006
|
||||
- userdel: user's group is already removed by update_groups().
|
||||
remove_group() is not needed (bug introduced in 4.0.14 on merge FC fixes).
|
||||
Fixed by Nicolas François <nicolas.francois@centraliens.net>,
|
||||
- useradd: allways remove group and gshadow databases lock, Fixed by Nicolas
|
||||
- useradd: always remove group and gshadow databases lock, Fixed by Nicolas
|
||||
François <nicolas.francois@centraliens.net>
|
||||
(http://bugs.debian.org/348250)
|
||||
- auditing fixes:
|
||||
@@ -848,14 +848,14 @@ shadow-4.0.14 -> shadow-4.0.15 13-03-2006
|
||||
added audit_logger() prototype),
|
||||
- useradd: fixed excess audit_logger() argument,
|
||||
- chage: added missing \n on display password status if password must be
|
||||
chaged,
|
||||
changed,
|
||||
- useradd: fixed allow non-unique UID (http://bugs.debian.org/351281),
|
||||
- variouse code cleanups for make possible compilation of shadow with -Wall
|
||||
- various code cleanups for make possible compilation of shadow with -Wall
|
||||
-Werror (by Alexander Gattin <xrgtn@yandex.ru>),
|
||||
- su: move exit() outside libmisc/shell.c::shell() for handle shell() errors
|
||||
on higher level (now is better visable where some programs exit with 126
|
||||
and 127 exit codes); added new shell() parameter (char *const envp[])
|
||||
which allow fix preserving enviloment in su on using -p, (patch by
|
||||
which allow fix preserving enviroment in su on using -p, (patch by
|
||||
Alexander Gattin <xrgtn@yandex.ru>),
|
||||
- su: added handle -c,--command option for GNU su compliance (merge
|
||||
437_su_-c_option Debian patch),
|
||||
@@ -903,7 +903,7 @@ shadow-4.0.13 -> shadow-4.0.14 03-01-2006
|
||||
- userdel: make the -f option force the removal of the user's group (even if it
|
||||
is the primary group of another user)
|
||||
(merge 453_userdel_-f_removes_group Debian patch),
|
||||
- usermod: rewrited for use getopt_long() (Christian Perrier <bubulle@kheops.frmug.org>),
|
||||
- usermod: rewritten for use getopt_long() (Christian Perrier <bubulle@kheops.frmug.org>),
|
||||
- grpck: fixed segmentation fault on using -s when /etc/gshadow is empty (fix by
|
||||
Tomasz Lemiech <szpajder@staszic.waw.pl>),
|
||||
- passwd: remove handle -f, -g and -s options.
|
||||
@@ -912,7 +912,7 @@ shadow-4.0.13 -> shadow-4.0.14 03-01-2006
|
||||
Nicolas François <nicolas.francois@centraliens.net>)
|
||||
- su: export $USER and $SHELL as well as $HOME (http://bugs.debian.org/11003 and
|
||||
http://bugs.debian.org/11189),
|
||||
- su, vipw: rewrited for use getopt_long(),
|
||||
- su, vipw: rewritten for use getopt_long(),
|
||||
- su: log successful/failed through syslog (http://bugs.debian.org/190215),
|
||||
- updated translations: ca, cs, da, eu, fi, fr, it, pl, pt, ru, sv, tl, vi,
|
||||
- new translations: gl.
|
||||
@@ -946,7 +946,7 @@ shadow-4.0.12 -> shadow-4.0.13 10-10-2005
|
||||
|
||||
*** general:
|
||||
- chage: removed duplicated pam_start(),
|
||||
- chfn, chsh: finished PAM support usin pam_start() and co.,
|
||||
- chfn, chsh: finished PAM support using pam_start() and co.,
|
||||
- userdel: userdel should not remove the group which is primary for someone else
|
||||
(fix by Nicolas François <nicolas.francois@centraliens.net>
|
||||
http://bugs.debian.org/295416),
|
||||
@@ -955,7 +955,7 @@ shadow-4.0.12 -> shadow-4.0.13 10-10-2005
|
||||
- fixedlib/commonio.c: don't assume selinux is enabled if is_selinux_enabled()
|
||||
returns -1 (merge isSelinuxEnabled FC patch by Jeremy Katz <katzj@redhat.com>),
|
||||
- login, su (non-PAM case): fixed setup max address space limits (added missing break
|
||||
statement in case) spoted by Lasse Collin <lasse.collin@tukaani.org>,
|
||||
statement in case) spotted by Lasse Collin <lasse.collin@tukaani.org>,
|
||||
- auditing support added. Patch prepared by Peter Vrabec <pvrabec@redhat.com> basing
|
||||
on work by Steve Grubb from http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=159215
|
||||
Now auditing support have commands: chage, gpasswd, groupadd, groupdel, groupmod,
|
||||
@@ -972,12 +972,12 @@ shadow-4.0.12 -> shadow-4.0.13 10-10-2005
|
||||
This will permit to adduser Debian script to detect if chage failed because the
|
||||
system doesn't have shadowed passwords (fix for http://bugs.debian.org/317012),
|
||||
- merge 010_more-i18ned-messages Debian patch which adds i18n support for few
|
||||
more messages (orginaly patch was prepared by Guillem Jover <guillem@debian.org>),
|
||||
more messages (originally patch was prepared by Guillem Jover <guillem@debian.org>),
|
||||
- lastlog: added handle -b option which allow print only lastlog records older than
|
||||
specified DAYS (fix by <miles@lubin.us>),
|
||||
- chpasswd, gpasswd, newusers: fixed libmisc/salt.c for use login.defs::MD5_CRYPT_ENAB
|
||||
only if PAM support is disabled (fix by John Gatewood Ham <zappaman@buraphalinux.org>),
|
||||
- passwd: rewrited for use getopt_long(),
|
||||
- passwd: rewritten for use getopt_long(),
|
||||
- newgrp: when newgrp process sits between parent and child shells, it should
|
||||
propagate STOPs from child to parent and CONTs from parent to child,
|
||||
otherwise e.g. bash's "suspend" command won't work
|
||||
@@ -987,11 +987,11 @@ shadow-4.0.12 -> shadow-4.0.13 10-10-2005
|
||||
- chsh(1), groupadd(8), newusers(8), pwconv(8), useradd(8), userdel(8), usermod(8):
|
||||
added missing references to /etc/login.defs and login.defs(5)
|
||||
(Christian Perrier <bubulle@kheops.frmug.org>),
|
||||
- passwd(5): rewrited based on work by Greg Wooledge <greg@wooledge.org>
|
||||
- passwd(5): rewritten based on work by Greg Wooledge <greg@wooledge.org>
|
||||
http://bugs.debian.org/328113
|
||||
- login(1): added securetty(5) to SEE ALSO section
|
||||
(fixed Debian bug http://bugs.debian.org/325773),
|
||||
- groupadd(8), useradd(8): fix regular expression describing alloved login/group
|
||||
- groupadd(8), useradd(8): fix regular expression describing allowed login/group
|
||||
names (pointed by Nicolas François <nicolas.francois@centraliens.net>)
|
||||
(correct is [a-z_][a-z0-9_-]*[$]),
|
||||
- groupadd(8), useradd(8): documents in CAVEATS section the limitations shadow
|
||||
@@ -1001,9 +1001,9 @@ shadow-4.0.12 -> shadow-4.0.13 10-10-2005
|
||||
shadow-4.0.11.1 -> shadow-4.0.12 22-08-2005
|
||||
|
||||
*** general:
|
||||
- newgrp, login: remove using login.defs::CLOSE_SESSIONS variable and allways
|
||||
- newgrp, login: remove using login.defs::CLOSE_SESSIONS variable and always
|
||||
close PAM session,
|
||||
- fixed configure.in: realy enable shadow group support by default (pointed by
|
||||
- fixed configure.in: really enable shadow group support by default (pointed by
|
||||
Greg Schafer <gschafer@zip.com.au> and Peter Vrabec <pvrabec@redhat.com>),
|
||||
- login.defs: removed handle QMAIL_DIR variable,
|
||||
- login: allow regular user to login on read-only root file system (not only for root)
|
||||
@@ -1028,9 +1028,9 @@ shadow-4.0.11.1 -> shadow-4.0.12 22-08-2005
|
||||
period and permit brute-force attacks (fixed http://bugs.debian.org/288827),
|
||||
- uClibc fixes (by Martin Schlemmer <azarah@nosferatu.za.org>):
|
||||
added require ngettext (added [need-ngettext] to AM_GNU_GETTEXT() parameters)
|
||||
and stub prototype for ngettext() in lib/prototypes.h (neccessary if shadow
|
||||
and stub prototype for ngettext() in lib/prototypes.h (necessary if shadow
|
||||
compiled with disabled NLS support)
|
||||
- groupadd: rewrited for use getopt_long(),
|
||||
- groupadd: rewritten for use getopt_long(),
|
||||
- groupadd, groupdel, groupmod, userdel: do OPENLOG() before pam_start(),
|
||||
- groupadd: fixed double OPENLOG(),
|
||||
- removed lib/{grpack,gspack,pwpack,sppack}.c and prototypes from lib/prototypes.h
|
||||
@@ -1066,7 +1066,7 @@ shadow-4.0.10 -> shadow-4.0.11 18-07-2005
|
||||
- su: ignore SIGINT while authenticating. A ^C could defeat the waiting period and
|
||||
permit brute-force attacks. Also ignore SIGQUIT.
|
||||
Fixed: http://bugs.debian.org/52372 and http://bugs.debian.org/288827
|
||||
- useradd: rewrited for use getopt_long(),
|
||||
- useradd: rewritten for use getopt_long(),
|
||||
- newgrp: add fix for handle splitted NIS groups: extends the functionality that,
|
||||
if the requested group is given, all groups of the same GID are tested for
|
||||
membership of the requesting user.
|
||||
@@ -1080,7 +1080,7 @@ shadow-4.0.10 -> shadow-4.0.11 18-07-2005
|
||||
- S/Key support is back,
|
||||
- usermod: added -a option. This flag can only be used in conjunction with the -G
|
||||
option. It cause usermod to append user to the current supplementary group list.
|
||||
(patch by Peter Vrabec <pvrabec@redhat.com>)
|
||||
(patch by Peter Vrabec <pvrabec@redhat.com>)
|
||||
- chage: added missing \n in error messages,
|
||||
- useradd, groupadd: change -O option to -K and document it in man page,
|
||||
- su, sulogin, login: fixed erroneous warning messages when used with PAM about some
|
||||
@@ -1097,7 +1097,7 @@ shadow-4.0.10 -> shadow-4.0.11 18-07-2005
|
||||
- updated translations: cs, da, de, es, fi, pl, pt, ro, ru, sk.
|
||||
*** documentation:
|
||||
- pwck(8): document -q option (based on Debian patch for fix http://bugs.debian.org/309408)
|
||||
- pwck(8): rewrited OPTIONS section and better SYNOPSIS,
|
||||
- pwck(8): rewritten OPTIONS section and better SYNOPSIS,
|
||||
- lastlog(8): document that lastlog is a sparse file, and don't need to be rotated
|
||||
http://bugs.debian.org/219321
|
||||
- login(8): better explain the respective roles of login, init and getty with regards
|
||||
@@ -1111,12 +1111,12 @@ shadow-4.0.9 -> shadow-4.0.10 28-06-2005
|
||||
|
||||
*** general:
|
||||
- mkpasswd: removed,
|
||||
- userdel: now deletes user groups from /etc/gshdow as well as /etc/group.
|
||||
- userdel: now deletes user groups from /etc/gshadow as well as /etc/group.
|
||||
Fix by Nicolas François <nicolas.francois@centraliens.net>.
|
||||
http://bugs.debian.org/99442
|
||||
- usermod: when relocating a user's home directory, don't fail and remove the new
|
||||
home directory if we can't remove the old home directory for some
|
||||
reason; the results can be spectularly poort if, for instance, only
|
||||
reason; the results can be spectacularly poor if, for instance, only
|
||||
the rmdir() fails. Patch prepared by Timo Lindfors <lindi-spamtrap@newmail.com>.
|
||||
http://bugs.debian.org/166369
|
||||
- su: fix syslogs to be less ambiguous. Use old:new format instead of old-new
|
||||
@@ -1124,23 +1124,23 @@ shadow-4.0.9 -> shadow-4.0.10 28-06-2005
|
||||
http://bugs.debian.org/213592
|
||||
- removed not used now libmisc/setup.c,
|
||||
- login: use also UTMPX API instead UTMP on failure (login was affected for this
|
||||
when shadow was builded without PAM support)
|
||||
when shadow was built without PAM support)
|
||||
patch by Nicolas François <nicolas.francois@centraliens.net>
|
||||
- login: the PAM session needs to be closed as root, thus before change_uid()
|
||||
http://bugs.debian.org/53570 http://bugs.debian.org/195048 http://bugs.debian.org/211884
|
||||
- login: made login's -f option also able to use the username after -- if none
|
||||
was passed as it's optarg
|
||||
http://bugs.debian.org/53702
|
||||
http://bugs.debian.org/53702
|
||||
- login: check for hushed login and pass PAM_SILENT if true,
|
||||
http://bugs.debian.org/48002
|
||||
- login: fixed username on succesful login (was using the normal username,
|
||||
when it should have used pam_user) http://bugs.debian.org/47819
|
||||
- remove using SHADOWPWD #define so now shadow is allways builded with shadow
|
||||
passwowd support,
|
||||
- chage: rewrited for use getopt_long(),
|
||||
- remove using SHADOWPWD #define so now shadow is always built with shadow
|
||||
password support,
|
||||
- chage: rewritten for use getopt_long(),
|
||||
- updated translations: ca, cs, da, fi, pl, ru, zh_TW.
|
||||
*** documentation:
|
||||
- most of the man pages now are generated from XML files so in case submiting any
|
||||
- most of the man pages now are generated from XML files so in case submitting any
|
||||
chages to this resources please make diff to XML files,
|
||||
- chfn: give more details about the influence of login.defs on what's allowed to
|
||||
users.
|
||||
@@ -1148,7 +1148,7 @@ shadow-4.0.9 -> shadow-4.0.10 28-06-2005
|
||||
shadow-4.0.8 -> shadow-4.0.9 23-05-2005
|
||||
|
||||
*** general:
|
||||
- passwd: fixed segfault in non-PAM connfiguration
|
||||
- passwd: fixed segfault in non-PAM configuration
|
||||
(submited by Greg Schafer <gschafer@zip.com.au>),
|
||||
- newgrp: fixed NULL pointer dereference - getlogin() and ttyname() can
|
||||
return NULL which is not checked (http://bugs.debian.org/162303),
|
||||
@@ -1170,15 +1170,15 @@ shadow-4.0.7 -> shadow-4.0.8 26-04-2005
|
||||
- configure.in: add using AC_GNU_SOURCE macro for kill compilation warnings about
|
||||
implicit declaration of function `fseeko',
|
||||
- faillog: changed faillog record display format for allow fit in 80 columns all
|
||||
faillog atributies,
|
||||
faillog attributes,
|
||||
- removed NDBM code (unused),
|
||||
- fixed use of SU_WHEEL_ONLY in su. Now su realy is avalaible for wheel group
|
||||
- fixed use of SU_WHEEL_ONLY in su. Now su really is available for wheel group
|
||||
members. Thanks to Mike Frysinger <vapier@gentoo.org> for report:
|
||||
http://bugs.gentoo.org/show_bug.cgi?id=80345
|
||||
- drop never finished kerberos and des_rpc support (for kerberos support back firs
|
||||
must be prepared modularization),
|
||||
- fixed UTMP path detection (by Kelledin <kelledin@users.sf.net>),
|
||||
- useradd: rewrited group count to dynamic (by John Newbigin
|
||||
- useradd: rewritten group count to dynamic (by John Newbigin
|
||||
<jnewbigin@ict.swin.edu.au>),
|
||||
- login: fixed create lastlog entry fo users never loged in on non-PAM
|
||||
variant of login (fix by <oracular@ziplip.com>),
|
||||
@@ -1193,7 +1193,7 @@ shadow-4.0.7 -> shadow-4.0.8 26-04-2005
|
||||
fchmod() is executed. (Actually, we could also pass the final "mode" to
|
||||
the open() call and then save the consequent fchmod().)
|
||||
- SELinux changes: added changes in chage, chfn, chsh, passwd for allow
|
||||
construct more grained user password/accuunt properties on SELinux
|
||||
construct more grained user password/account properties on SELinux
|
||||
policies level. Patch originally based on RH changes (submited by Chris
|
||||
PeBenito <pebenito@gentoo.org>),
|
||||
- added SELinux changes: in libmisc/copydir.c (based on Fedora patch),
|
||||
@@ -1208,10 +1208,10 @@ shadow-4.0.7 -> shadow-4.0.8 26-04-2005
|
||||
-- new: chage.1, chpasswd.8, expiry.1, faillog.5, faillog.8, getspnam.3,
|
||||
logoutd.8, porttime.5, pwck.8, shadow.3, shadowconfig.8, su.1,
|
||||
- passwd(1): fix #160477 Debian bug: improve -S output description,
|
||||
- newgrp(1): fix #251926, #166173, #113191 Debian bugs: explain why editing /etc/group
|
||||
- newgrp(1): fix #251926, #166173, #113191 Debian bugs: explain why editing /etc/group
|
||||
(without gshadow) doesn't permit to use newgrp,
|
||||
- newgrp(1): newgrp uses /bin/sh (not bash),
|
||||
- faillog(8): updated after rewrited faillog command for use getopt_long(),
|
||||
- faillog(8): updated after rewritten faillog command for use getopt_long(),
|
||||
- login(1): removed fragment about abilities pass enviroment variables in login prompt,
|
||||
- gshadow(5): new file (by Nicolas Nicolas François <nicolas.francois@centraliens.net>),
|
||||
- usermod(8): fixed #302388 Debian bug: added separated -o option description,
|
||||
@@ -1229,24 +1229,24 @@ shadow-4.0.6 -> shadow-4.0.7 26-01-2005
|
||||
-- use fseeko() instead fseek() and remove casting file offsets to unsigned
|
||||
long.
|
||||
- lastlog:
|
||||
-- rewrited source code using the same style as in chpasswd.c,
|
||||
-- open lastlog file after finish parse comman line optiomns
|
||||
(now --help otput can be displayd for users without lastlog
|
||||
-- rewritten source code using the same style as in chpasswd.c,
|
||||
-- open lastlog file after finish parse commandline options
|
||||
(now --help output can be displayed for users without lastlog
|
||||
file read permission),
|
||||
-- cleanups in lastlog(8) man page using the same style as in
|
||||
chpasswd(8).
|
||||
- chpasswd:
|
||||
-- switch chpasswd to use getopt_long() and adds a --md5 option
|
||||
(by Ian Gulliver <ian@penguinhosting.net>),
|
||||
-- rewrited chpasswd(8) man page.
|
||||
-- rewritten chpasswd(8) man page.
|
||||
|
||||
shadow-4.0.5 -> shadow-4.0.6 08-11-2004
|
||||
|
||||
- su: fixed adding of pam_env env variables to enviroment
|
||||
(Martin Schlemmer <azarah@nosferatu.za.org>),
|
||||
- autoconf: fixed filling MAIL_SPOOL_DIR and MAIL_SPOOL_FILE variables
|
||||
which was allways empty (Gregorio Guidi <g.guidi@sns.it>),
|
||||
- realuy closse security bug in libmisc/pwdcheck.c,
|
||||
which was always empty (Gregorio Guidi <g.guidi@sns.it>),
|
||||
- really close security bug in libmisc/pwdcheck.c,
|
||||
- added missing template/example PAM service config files for chfn, chsh and
|
||||
userdel,
|
||||
- do not translate variable names from /etc/default/useradd during
|
||||
@@ -1257,10 +1257,10 @@ shadow-4.0.4.1 -> shadow-4.0.5 27-10-2004
|
||||
- change libmisc to private static library,
|
||||
- added SELinux support (basing on patch from Gentoo),
|
||||
- chage: more verbose/human readable -l output. This output is much more
|
||||
beter for send directly via email for each users as message with account
|
||||
better for send directly via email for each users as message with account
|
||||
status (for example as message with warning about account/password expiration),
|
||||
- login: fixed handle -f option: now it works correctly without specify "-h
|
||||
<host>" if open login session localy is required (thanks for help
|
||||
<host>" if open login session locally is required (thanks for help
|
||||
investigate bug for Krzysztof Kotlenga),
|
||||
- userdel: when removing a user with userdel, userdel was always exits with 1 (fixed).
|
||||
Based on http://bugs.gentoo.org/show_bug.cgi?id=66687,
|
||||
@@ -1274,7 +1274,7 @@ shadow-4.0.4.1 -> shadow-4.0.5 27-10-2004
|
||||
makes httpd Option SymlinkIfOwnerMatch break for default weg pages
|
||||
including symlinks placed into /etc/skel/public_html for example.
|
||||
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=66819
|
||||
- su: add pam_open_session() support. If builded without PAM support
|
||||
- su: add pam_open_session() support. If built without PAM support
|
||||
propagate $DISPLAY and $XAUTHORITY enviroment variables.
|
||||
Based on http://www.gentoo.org/cgi-bin/viewcvs.cgi/sys-apps/shadow/files/shadow-4.0.4.1-su-pam_open_session.patch?rev=1.1
|
||||
- applied 036_pam_access_with_preauth.patch Debian patch submited by Bjorn
|
||||
@@ -1287,11 +1287,11 @@ shadow-4.0.4.1 -> shadow-4.0.5 27-10-2004
|
||||
Use constant strings rather than argv[0] for syslog ident in the user
|
||||
management commands,
|
||||
shadow-4.0.4.1-owl-tmp.diff:
|
||||
Remove using mktemp() if mkstemp() prototype not found (use allways mkstemp()),
|
||||
Remove using mktemp() if mkstemp() prototype not found (use always mkstemp()),
|
||||
shadow-4.0.4.1-owl-check-reads.diff:
|
||||
Add checking for read errors in commonio and vipw/vigr (not doing so could
|
||||
result in data loss when the records are written back),
|
||||
- fixed securirty bug in libmisc/pwdcheck.c which allow unauthorized
|
||||
- fixed security bug in libmisc/pwdcheck.c which allow unauthorized
|
||||
account properties modification.
|
||||
Affected tools: chfn and chsh.
|
||||
Bug was discovered by Martin Schulze <joey@infodrom.org>.
|
||||
@@ -1307,12 +1307,12 @@ shadow-4.0.4.1 -> shadow-4.0.5 27-10-2004
|
||||
|
||||
shadow-4.0.4 => shadow-4.0.4.1 14-01-2004
|
||||
- bug fixes in automake files for generate correct tar ball on "make dist":
|
||||
added mising "EXTRA_DIST = $(man_MANS)" in man/*/Makefile.am.
|
||||
added missing "EXTRA_DIST = $(man_MANS)" in man/*/Makefile.am.
|
||||
|
||||
shadow-4.0.3 => shadow-4.0.4 14-01-2004
|
||||
shadow-4.0.3 => shadow-4.0.4 14-01-2004
|
||||
|
||||
*** general:
|
||||
- added missing information about -f options in groupadd usage mesage
|
||||
- added missing information about -f options in groupadd usage message
|
||||
(document this also in man page),
|
||||
- removed TCFS support (tcfs is dead),
|
||||
- convert all po/*.po files to utf-8,
|
||||
@@ -1320,7 +1320,7 @@ shadow-4.0.3 => shadow-4.0.4 14-01-2004
|
||||
per service flushing method instead HUPing nscd process),
|
||||
- removed old AUTH_METHODS dependent code,
|
||||
- chage: now all code depend on SHADOWPWD. If shadow will not be configured
|
||||
on autoconf level for using shadow possword chage is olny stub which
|
||||
on autoconf level for using shadow password chage is olny stub which
|
||||
informs "chage not configured for shadow password support."
|
||||
- dpasswd: removed,
|
||||
- login: remove handle login.defs::DIALUPS_CHECK_ENAB code,
|
||||
@@ -1328,7 +1328,7 @@ shadow-4.0.3 => shadow-4.0.4 14-01-2004
|
||||
- ALL tools, libraries: remove old SVR4, SVR4_SI86_EUA BSD_QUOTA and ATT_AGE
|
||||
dependent code,
|
||||
- ALL: ready for gettext 0.11.5, automake 1.7.4, autoconf 2.57,
|
||||
- logoutd, userd: handle also utmpx if avalaile,
|
||||
- logoutd, userd: handle also utmpx if available,
|
||||
- newgrp: fix for non-PAM version
|
||||
Use CLOSE_SESSIONS depending code only when USE_PAM.
|
||||
The problem was reported by Mattias Webjorn Eriksson using Slackware
|
||||
@@ -1356,7 +1356,7 @@ shadow-4.0.3 => shadow-4.0.4 14-01-2004
|
||||
|
||||
shadow-4.0.2 => shadow-4.0.3 13-03-2002
|
||||
|
||||
- added variouse cs, de, fr, id, it, ko man pages found mainly in national
|
||||
- added various cs, de, fr, id, it, ko man pages found mainly in national
|
||||
man pages translations projects (this documents are not synced with
|
||||
current en version but you know .. "Documentations is lik sex. When it is
|
||||
good it very very good. Whet it is bad it is better than nothing."). Any
|
||||
@@ -1372,9 +1372,9 @@ shadow-4.0.2 => shadow-4.0.3 13-03-2002
|
||||
shadow-4.0.1 => shadow-4.0.2 17-02-2002
|
||||
|
||||
- resolve many fuzzy translations also all this which may cause problems on
|
||||
displaing long uid/gid,
|
||||
- allow use "$" on ending in cereated by useradd usermname accounts for allow
|
||||
create machine acounts for samba (thanks to Jerome Borsboom
|
||||
displaying long uid/gid,
|
||||
- allow use "$" on ending in created by useradd username accounts for allow
|
||||
create machine accounts for samba (thanks to Jerome Borsboom
|
||||
<borsboom@tch.fgg.eur.nl> for point this problem in 4.0.1),
|
||||
- fix small but ugly bug in configure.in in libpam_mics library detection.
|
||||
|
||||
@@ -1394,7 +1394,7 @@ shadow-4.0.0 => shadow-4.0.1
|
||||
as root. If root does read-only, there's no lock needed. Added missing
|
||||
"#include <errno.h>" for above (me).
|
||||
shadow-4.0.0-owl-warnings.diff
|
||||
Olny one fix from this patch was aplayd because other was fixed few days
|
||||
Olny one fix from this patch was applied because other was fixed few days
|
||||
before :)
|
||||
shadow-4.0.0-owl-check_names.diff
|
||||
Merge only prat this patch with checking login name matching; checking
|
||||
@@ -1402,13 +1402,13 @@ shadow-4.0.0 => shadow-4.0.1
|
||||
probably _POSIX_LOGIN_NAME_MAX from <bits/posix1_lim.h>,
|
||||
shadow-4.0.0-owl-chage-drop-priv.diff
|
||||
shadow-4.0.0-owl-pam-auth.diff
|
||||
Merge part with reorder initialize PAM and checkin is chage is runed by
|
||||
Merge part with reorder initialize PAM and checking if chage is runed by
|
||||
root or not - now chage can be runed from non-root account for checking
|
||||
by user own account information (if PAM enabled).
|
||||
- fixes for handle/print correctly 32bit uid/gid (Thorsten Kukuk <kukuk@suse.de>),
|
||||
- implemented functions for better reloading the nscd cache (per NSS map)
|
||||
(Thorsten Kukuk <kukuk@suse.de>),
|
||||
- fixed warnings "not used but defined" on compile using gcc 3.0.x
|
||||
- fixed warnings "not used but defined" on compile using gcc 3.0.x
|
||||
(bulletpr00ph <bullet@users.sourceforge.net>),
|
||||
- added ja, ko translations found in SuSE,
|
||||
- added symlinks: newgrp -> sg, vipw -> vigr,
|
||||
@@ -1416,7 +1416,7 @@ shadow-4.0.0 => shadow-4.0.1
|
||||
- added sg(1) man page as roff .so link to newgrp(1),
|
||||
- installed fix for SEGV when using pwck -s on /etc/passwd file with
|
||||
empty lines in it.
|
||||
|
||||
|
||||
shadow-20001016 => shadow-4.0.0 06-01-2002
|
||||
|
||||
- fix bug discovered and fixed by Marcel Ritter
|
||||
@@ -1446,30 +1446,30 @@ shadow-20001016 => shadow-4.0.0 06-01-2002
|
||||
- much better automake support,
|
||||
- added pt_BR man pages for gpasswd(1), groupadd(8), groupdel(8),
|
||||
groupmod(8), shadow(5) (man pages for other nations also are welcome),
|
||||
- mamny small fixes and updates nad improvements in man pages,
|
||||
- aplayed Debian patch to man pages for shadowconfig,
|
||||
- many small fixes and updates nad improvements in man pages,
|
||||
- applied Debian patch to man pages for shadowconfig,
|
||||
- remove limit to 6 chars logged tty name (012_libmisc_sulog.c.diff Debian
|
||||
patch).
|
||||
|
||||
shadow-20001012 -> shadow-20001016:
|
||||
- conditionaly disabled body reload_nscd() because not every
|
||||
- conditionally disabled body reload_nscd() because not every
|
||||
version of nscd can handle it (this can be enabled by define
|
||||
ENABLE_NSCD_SIGHUP) (Marek Michałkiewicz <marekm@linux.org.pl>)
|
||||
- fixes on autoconf/automake level for dist target,
|
||||
- Julianne F. Haugh new contact adress.
|
||||
- Julianne F. Haugh new contact address.
|
||||
|
||||
shadow-20000902 => shadow-20001012
|
||||
|
||||
- removed /redhat directory with obsoleted files (partialy rewrited spec
|
||||
- removed /redhat directory with obsoleted files (partially rewritten spec
|
||||
file is now in root directory),
|
||||
- aplayed shadow-19990827-group.patch patch from RH wich prevents adduser
|
||||
- applied shadow-19990827-group.patch patch from RH wich prevents adduser
|
||||
overwrite previously existing groups in adduser,
|
||||
- added PAM support for chage (bind to "chage" PAM config file) also
|
||||
added PAM support for all other small tools like chpasswd, groupadd,
|
||||
groupdel, groupmod, newusers, useradd, userdel, usermod (bind to common
|
||||
"shadow" PAM config file) - this modificaytions mainly based on
|
||||
groupdel, groupmod, newusers, useradd, userdel, usermod (bind to common
|
||||
"shadow" PAM config file) - this modifications mainly based on
|
||||
modifications prepared by Janek Rękojarski <baggins@pld.org.pl>,
|
||||
- many small fixes and improvments in automake (mow "make dist"
|
||||
- many small fixes and improvements in automake (mow "make dist"
|
||||
works correctly),
|
||||
- added cs translation (Jiri Pavlovsky <Jiri.Pavlovsky@ff.cuni.cz>).
|
||||
|
||||
|
||||
121
README
121
README
@@ -1,121 +0,0 @@
|
||||
Shadow SITES
|
||||
============
|
||||
|
||||
Homepage
|
||||
http://pkg-shadow.alioth.debian.org/
|
||||
|
||||
FTP site
|
||||
ftp://pkg-shadow.alioth.debian.org/pub/pkg-shadow
|
||||
|
||||
SVN repository
|
||||
anonymous read only access: svn://svn.debian.org/pkg-shadow/upstream
|
||||
|
||||
SVN web interface
|
||||
http://svn.debian.org/wsvn/pkg-shadow/upstream
|
||||
or
|
||||
http://svn.debian.org/viewsvn/pkg-shadow/upstream
|
||||
|
||||
Mailing lists
|
||||
for general discuss: pkg-shadow-devel@lists.alioth.debian.org
|
||||
commit list: pkg-shadow-commits@lists.alioth.debian.org
|
||||
|
||||
Mailing lists subscription
|
||||
http://lists.alioth.debian.org/mailman/listinfo/pkg-shadow-devel
|
||||
http://lists.alioth.debian.org/mailman/listinfo/pkg-shadow-commits
|
||||
|
||||
Mailing lists archives:
|
||||
http://lists.alioth.debian.org/pipermail/pkg-shadow-devel/
|
||||
http://lists.alioth.debian.org/pipermail/pkg-shadow-commits/
|
||||
|
||||
S/Key support:
|
||||
Shadow can be built with S/Key support using the S/Key package from:
|
||||
|
||||
http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libskey/
|
||||
or
|
||||
http://gentoo.osuosl.org/distfiles/skey-1.1.5.tar.bz2
|
||||
|
||||
Authors and contributors
|
||||
========================
|
||||
|
||||
Thanks to at least the following people for sending patches, bug
|
||||
reports and various comments. This list may be incomplete, I received
|
||||
a lot of mail...
|
||||
|
||||
|
||||
Adam Rudnicki <adam@v-lo.krakow.pl>
|
||||
Alan Curry <pacman@tardis.mars.net>
|
||||
Alexander O. Yuriev <alex@bach.cis.temple.edu>
|
||||
Algis Rudys <arudys@rice.edu>
|
||||
Andreas Jaeger <aj@arthur.rhein-neckar.de>
|
||||
Aniello Del Sorbo <anidel@edu-gw.dia.unisa.it>
|
||||
Anton Gluck <gluc@midway.uchicago.edu>
|
||||
Arkadiusz Miskiewicz <misiek@pld.org.pl>
|
||||
Ben Collins <bcollins@debian.org>
|
||||
Brian R. Gaeke <brg@dgate.org>
|
||||
Calle Karlsson <ckn@kash.se>
|
||||
Chip Rosenthal <chip@unicom.com>
|
||||
Chris Evans <lady0110@sable.ox.ac.uk>
|
||||
Cristian Gafton <gafton@sorosis.ro>
|
||||
Dan Walsh <dwalsh@redhat.com>
|
||||
Darcy Boese <possum@chardonnay.niagara.com>
|
||||
Dave Hagewood <admin@arrowweb.com>
|
||||
David A. Holland <dholland@hcs.harvard.edu>
|
||||
David Frey <David.Frey@lugs.ch>
|
||||
Ed Carp <ecarp@netcom.com>
|
||||
Floody <flood@evcom.net>
|
||||
Frank Denis <j@4u.net>
|
||||
George Kraft IV <gk4@us.ibm.com>
|
||||
Greg Mortensen <loki@world.std.com>
|
||||
Guido van Rooij
|
||||
Guy Maor <maor@debian.org>
|
||||
Hrvoje Dogan <hdogan@bjesomar.srce.hr>
|
||||
Jakub Hrozek <jhrozek@redhat.com>
|
||||
Janos Farkas <chexum@bankinf.banki.hu>
|
||||
Jay Soffian <jay@lw.net>
|
||||
Jesse Thilo <Jesse.Thilo@pobox.com>
|
||||
Joey Hess <joey@kite.ml.org>
|
||||
John Adelsberger <jja@umr.edu>
|
||||
Jonathan Hankins <jhankins@mailserv.homewood.k12.al.us>
|
||||
Jon Lewis <jlewis@lewis.org>
|
||||
Joshua Cowan <jcowan@hermit.reslife.okstate.edu>
|
||||
Judd Bourgeois <shagboy@bluesky.net>
|
||||
Juergen Heinzl <unicorn@noris.net>
|
||||
Juha Virtanen <jiivee@iki.fi>
|
||||
Julian Pidancet <julian.pidancet@gmail.com>
|
||||
Julianne Frances Haugh <jockgrrl@ix.netcom.com>
|
||||
Leonard N. Zubkoff <lnz@dandelion.com>
|
||||
Luca Berra <bluca@www.polimi.it>
|
||||
Lukáš Kuklínek <lkukline@redhat.com>
|
||||
Lutz Schwalowsky <schwalow@mineralogie.uni-hamburg.de>
|
||||
Marc Ewing <marc@redhat.com>
|
||||
Martin Bene <mb@sime.com>
|
||||
Martin Mares <mj@gts.cz>
|
||||
Michael Meskes <meskes@topsystem.de>
|
||||
Michael Talbot-Wilson <mike@calypso.bns.com.au>
|
||||
Mike Frysinger <vapier@gentoo.org>
|
||||
Mike Pakovic <mpakovic@users.southeast.net>
|
||||
Nicolas François <nicolas.francois@centraliens.net>
|
||||
Nikos Mavroyanopoulos <nmav@i-net.paiko.gr>
|
||||
Pavel Machek <pavel@bug.ucw.cz>
|
||||
Peter Vrabec <pvrabec@redhat.com>
|
||||
Phillip Street
|
||||
Rafał Maszkowski <rzm@icm.edu.pl>
|
||||
Rani Chouha <ranibey@smartec.com>
|
||||
Sami Kerola <kerolasa@rocketmail.com>
|
||||
Scott Garman <scott.a.garman@intel.com>
|
||||
Sebastian Rick Rijkers <srrijkers@gmail.com>
|
||||
Seraphim Mellos <mellos@ceid.upatras.gr>
|
||||
Shane Watts <shane@nexus.mlckew.edu.au>
|
||||
Steve M. Robbins <steve@nyongwa.montreal.qc.ca>
|
||||
Thorsten Kukuk <kukuk@suse.de>
|
||||
Tim Hockin <thockin@eagle.ais.net>
|
||||
Timo Karjalainen <timok@iki.fi>
|
||||
Ulisses Alonso Camaro <ulisses@pusa.eleinf.uv.es>
|
||||
Werner Fink <werner@suse.de>
|
||||
|
||||
Maintainers
|
||||
===========
|
||||
|
||||
Tomasz Kłoczko <kloczek@pld.org.pl> (2000-2007)
|
||||
Nicolas François <nicolas.francois@centraliens.net> (2007-now)
|
||||
|
||||
36
README.md
Normal file
36
README.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# shadow-utils
|
||||
|
||||
## Introduction
|
||||
The shadow-utils package includes the necessary programs for
|
||||
converting UNIX password files to the shadow password format, plus
|
||||
programs for managing user and group accounts. The pwconv command
|
||||
converts passwords to the shadow password format. The pwunconv command
|
||||
unconverts shadow passwords and generates a passwd file (a standard
|
||||
UNIX password file). The pwck command checks the integrity of password
|
||||
and shadow files. The lastlog command prints out the last login times
|
||||
for all users. The useradd, userdel, and usermod commands are used for
|
||||
managing user accounts. The groupadd, groupdel, and groupmod commands
|
||||
are used for managing group accounts.
|
||||
|
||||
## Sites
|
||||
* [Homepage](https://github.com/shadow-maint/shadow)
|
||||
* [Issue tracker](https://github.com/shadow-maint/shadow/issues)
|
||||
* [Releases](https://github.com/shadow-maint/shadow/releases)
|
||||
|
||||
## Contacts
|
||||
There are several ways to contact us:
|
||||
* [the general discussion mailing list](
|
||||
https://alioth-lists.debian.net/mailman/listinfo/pkg-shadow-devel)
|
||||
* the #shadow IRC channel on libera.chat:
|
||||
* irc://irc.libera.chat/shadow
|
||||
|
||||
### Mailing archives
|
||||
* [the general discussion mailing list archive](
|
||||
https://alioth-lists.debian.net/pipermail/pkg-shadow-devel/)
|
||||
* [the commit mailing list archive](
|
||||
https://alioth-lists-archive.debian.net/pipermail/pkg-shadow-commits/),
|
||||
only used for historical purposes
|
||||
|
||||
## Authors and maintainers
|
||||
Authors and maintainers are listed in [AUTHORS.md](
|
||||
https://github.com/shadow-maint/shadow/blob/master/AUTHORS.md).
|
||||
11
SECURITY.md
Normal file
11
SECURITY.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
At the moment only the latest release is supported.
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Security vulnerabilities may be reported to
|
||||
* Serge Hallyn <serge@hallyn.com> (B175CFA98F192AF2)
|
||||
* Christian Brauner <christian@brauner.io> (4880B8C9BD0E5106FC070F4F7B3C391EFEA93624)
|
||||
2
TODO
2
TODO
@@ -1,4 +1,4 @@
|
||||
* Create a common usage function that'd take the array of
|
||||
* Create a common usage function that'd take the array of
|
||||
long options and an array of descriptions and output that so things would
|
||||
be standardized across the utils.
|
||||
Usage strings should be normalized and split first.
|
||||
|
||||
@@ -6,7 +6,7 @@ autoreconf -v -f --install || exit 1
|
||||
CFLAGS="-O2 -Wall" \
|
||||
--enable-man \
|
||||
--enable-maintainer-mode \
|
||||
--disable-shared \
|
||||
--enable-shared \
|
||||
--without-libpam \
|
||||
--with-selinux \
|
||||
"$@"
|
||||
|
||||
145
configure.ac
145
configure.ac
@@ -1,16 +1,29 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT
|
||||
AM_INIT_AUTOMAKE(shadow, 4.3.1)
|
||||
AC_PREREQ([2.69])
|
||||
m4_define([libsubid_abi_major], 4)
|
||||
m4_define([libsubid_abi_minor], 0)
|
||||
m4_define([libsubid_abi_micro], 0)
|
||||
m4_define([libsubid_abi], [libsubid_abi_major.libsubid_abi_minor.libsubid_abi_micro])
|
||||
AC_INIT([shadow], [4.11.1], [pkg-shadow-devel@lists.alioth.debian.org], [],
|
||||
[https://github.com/shadow-maint/shadow])
|
||||
AM_INIT_AUTOMAKE([1.11 foreign dist-xz])
|
||||
AC_CONFIG_MACRO_DIRS([m4])
|
||||
AM_SILENT_RULES([yes])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
|
||||
AC_SUBST([LIBSUBID_ABI_MAJOR], [libsubid_abi_major])
|
||||
AC_SUBST([LIBSUBID_ABI_MINOR], [libsubid_abi_minor])
|
||||
AC_SUBST([LIBSUBID_ABI_MICRO], [libsubid_abi_micro])
|
||||
AC_SUBST([LIBSUBID_ABI], [libsubid_abi])
|
||||
|
||||
dnl Some hacks...
|
||||
test "$prefix" = "NONE" && prefix="/usr"
|
||||
test "$prefix" = "/usr" && exec_prefix=""
|
||||
|
||||
AC_GNU_SOURCE
|
||||
|
||||
AM_DISABLE_SHARED
|
||||
AM_ENABLE_STATIC
|
||||
AM_ENABLE_SHARED
|
||||
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
@@ -29,20 +42,21 @@ AC_HEADER_STDC
|
||||
AC_HEADER_SYS_WAIT
|
||||
AC_HEADER_STDBOOL
|
||||
|
||||
AC_CHECK_HEADERS(errno.h fcntl.h limits.h unistd.h sys/time.h utmp.h \
|
||||
AC_CHECK_HEADERS(crypt.h errno.h fcntl.h limits.h unistd.h sys/time.h utmp.h \
|
||||
utmpx.h termios.h termio.h sgtty.h sys/ioctl.h syslog.h paths.h \
|
||||
utime.h ulimit.h sys/resource.h gshadow.h lastlog.h \
|
||||
locale.h rpc/key_prot.h netdb.h acl/libacl.h attr/libattr.h \
|
||||
attr/error_context.h)
|
||||
utime.h ulimit.h sys/capability.h sys/random.h sys/resource.h \
|
||||
gshadow.h lastlog.h locale.h rpc/key_prot.h netdb.h acl/libacl.h \
|
||||
attr/libattr.h attr/error_context.h)
|
||||
|
||||
dnl shadow now uses the libc's shadow implementation
|
||||
AC_CHECK_HEADER([shadow.h],,[AC_MSG_ERROR([You need a libc with shadow.h])])
|
||||
|
||||
AC_CHECK_FUNCS(l64a fchmod fchown fsync futimes getgroups gethostname getspnam \
|
||||
gettimeofday getusershell getutent initgroups lchown lckpwdf lstat \
|
||||
lutimes memcpy memset setgroups sigaction strchr updwtmp updwtmpx innetgr \
|
||||
getpwnam_r getpwuid_r getgrnam_r getgrgid_r getspnam_r getaddrinfo \
|
||||
ruserok)
|
||||
AC_CHECK_FUNCS(arc4random_buf l64a fchmod fchown fsync futimes \
|
||||
gethostname getentropy getrandom getspnam gettimeofday getusershell \
|
||||
getutent initgroups lchown lckpwdf lstat lutimes \
|
||||
setgroups sigaction strchr updwtmp updwtmpx innetgr getpwnam_r \
|
||||
getpwuid_r getgrnam_r getgrgid_r getspnam_r getaddrinfo ruserok \
|
||||
dlopen)
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
@@ -71,12 +85,6 @@ AC_CHECK_MEMBERS([struct utmp.ut_type,
|
||||
struct utmp.ut_time,
|
||||
struct utmp.ut_xtime,
|
||||
struct utmp.ut_tv],,,[[#include <utmp.h>]])
|
||||
dnl There are dependencies:
|
||||
dnl If UTMPX has to be used, the utmp structure shall have a ut_id field.
|
||||
if test "$ac_cv_header_utmpx_h" = "yes" &&
|
||||
test "$ac_cv_member_struct_utmp_ut_id" != "yes"; then
|
||||
AC_MSG_ERROR(Systems with UTMPX and no ut_id field in the utmp structure are not supported)
|
||||
fi
|
||||
|
||||
AC_CHECK_MEMBERS([struct utmpx.ut_name,
|
||||
struct utmpx.ut_host,
|
||||
@@ -107,12 +115,14 @@ dnl Checks for library functions.
|
||||
AC_TYPE_GETGROUPS
|
||||
AC_TYPE_SIGNAL
|
||||
AC_FUNC_UTIME_NULL
|
||||
AC_FUNC_STRFTIME
|
||||
AC_REPLACE_FUNCS(mkdir putgrent putpwent putspent rename rmdir)
|
||||
AC_REPLACE_FUNCS(sgetgrent sgetpwent sgetspent)
|
||||
AC_REPLACE_FUNCS(snprintf strcasecmp strdup strerror strstr)
|
||||
|
||||
AC_CHECK_FUNC(setpgrp)
|
||||
AC_CHECK_FUNC(secure_getenv, [AC_DEFINE(HAS_SECURE_GETENV,
|
||||
1,
|
||||
[Defined to 1 if you have the declaration of 'secure_getenv'])])
|
||||
|
||||
if test "$ac_cv_header_shadow_h" = "yes"; then
|
||||
AC_CACHE_CHECK(for working shadow group support,
|
||||
@@ -226,7 +236,7 @@ AC_ARG_ENABLE(account-tools-setuid,
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-account-tools-setuid)
|
||||
;;
|
||||
esac],
|
||||
[enable_acct_tools_setuid="maybe"]
|
||||
[enable_acct_tools_setuid="no"]
|
||||
)
|
||||
|
||||
AC_ARG_ENABLE(utmpx,
|
||||
@@ -247,12 +257,15 @@ AC_ARG_ENABLE(subordinate-ids,
|
||||
[enable_subids="maybe"]
|
||||
)
|
||||
|
||||
AC_ARG_WITH(audit,
|
||||
AC_ARG_WITH(audit,
|
||||
[AC_HELP_STRING([--with-audit], [use auditing support @<:@default=yes if found@:>@])],
|
||||
[with_audit=$withval], [with_audit=maybe])
|
||||
AC_ARG_WITH(libpam,
|
||||
[AC_HELP_STRING([--with-libpam], [use libpam for PAM support @<:@default=yes if found@:>@])],
|
||||
[with_libpam=$withval], [with_libpam=maybe])
|
||||
AC_ARG_WITH(btrfs,
|
||||
[AC_HELP_STRING([--with-btrfs], [add BtrFS support @<:@default=yes if found@:>@])],
|
||||
[with_btrfs=$withval], [with_btrfs=maybe])
|
||||
AC_ARG_WITH(selinux,
|
||||
[AC_HELP_STRING([--with-selinux], [use SELinux support @<:@default=yes if found@:>@])],
|
||||
[with_selinux=$withval], [with_selinux=maybe])
|
||||
@@ -274,12 +287,24 @@ AC_ARG_WITH(libcrack,
|
||||
AC_ARG_WITH(sha-crypt,
|
||||
[AC_HELP_STRING([--with-sha-crypt], [allow the SHA256 and SHA512 password encryption algorithms @<:@default=yes@:>@])],
|
||||
[with_sha_crypt=$withval], [with_sha_crypt=yes])
|
||||
AC_ARG_WITH(bcrypt,
|
||||
[AC_HELP_STRING([--with-bcrypt], [allow the bcrypt password encryption algorithm @<:@default=no@:>@])],
|
||||
[with_bcrypt=$withval], [with_bcrypt=no])
|
||||
AC_ARG_WITH(yescrypt,
|
||||
[AC_HELP_STRING([--with-yescrypt], [allow the yescrypt password encryption algorithm @<:@default=no@:>@])],
|
||||
[with_yescrypt=$withval], [with_yescrypt=no])
|
||||
AC_ARG_WITH(nscd,
|
||||
[AC_HELP_STRING([--with-nscd], [enable support for nscd @<:@default=yes@:>@])],
|
||||
[with_nscd=$withval], [with_nscd=yes])
|
||||
AC_ARG_WITH(sssd,
|
||||
[AC_HELP_STRING([--with-sssd], [enable support for flushing sssd caches @<:@default=yes@:>@])],
|
||||
[with_sssd=$withval], [with_sssd=yes])
|
||||
AC_ARG_WITH(group-name-max-length,
|
||||
[AC_HELP_STRING([--with-group-name-max-length], [set max group name length @<:@default=16@:>@])],
|
||||
[with_group_name_max_length=$withval], [with_group_name_max_length=yes])
|
||||
AC_ARG_WITH(su,
|
||||
[AC_HELP_STRING([--with-su], [build and install su program and man page @<:@default=yes@:>@])],
|
||||
[with_su=$withval], [with_su=yes])
|
||||
|
||||
if test "$with_group_name_max_length" = "no" ; then
|
||||
with_group_name_max_length=0
|
||||
@@ -295,12 +320,31 @@ if test "$with_sha_crypt" = "yes"; then
|
||||
AC_DEFINE(USE_SHA_CRYPT, 1, [Define to allow the SHA256 and SHA512 password encryption algorithms])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(USE_BCRYPT, test "x$with_bcrypt" = "xyes")
|
||||
if test "$with_bcrypt" = "yes"; then
|
||||
AC_DEFINE(USE_BCRYPT, 1, [Define to allow the bcrypt password encryption algorithm])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(USE_YESCRYPT, test "x$with_yescrypt" = "xyes")
|
||||
if test "$with_yescrypt" = "yes"; then
|
||||
AC_DEFINE(USE_YESCRYPT, 1, [Define to allow the yescrypt password encryption algorithm])
|
||||
fi
|
||||
|
||||
if test "$with_nscd" = "yes"; then
|
||||
AC_CHECK_FUNC(posix_spawn,
|
||||
[AC_DEFINE(USE_NSCD, 1, [Define to support flushing of nscd caches])],
|
||||
[AC_MSG_ERROR([posix_spawn is needed for nscd support])])
|
||||
fi
|
||||
|
||||
if test "$with_sssd" = "yes"; then
|
||||
AC_CHECK_FUNC(posix_spawn,
|
||||
[AC_DEFINE(USE_SSSD, 1, [Define to support flushing of sssd caches])],
|
||||
[AC_MSG_ERROR([posix_spawn is needed for sssd support])])
|
||||
fi
|
||||
|
||||
AS_IF([test "$with_su" != "no"], AC_DEFINE(WITH_SU, 1, [Build with su]))
|
||||
AM_CONDITIONAL([WITH_SU], [test "x$with_su" != "xno"])
|
||||
|
||||
dnl Check for some functions in libc first, only if not found check for
|
||||
dnl other libraries. This should prevent linking libnsl if not really
|
||||
dnl needed (Linux glibc, Irix), but still link it if needed (Solaris).
|
||||
@@ -309,6 +353,17 @@ AC_SEARCH_LIBS(inet_ntoa, inet)
|
||||
AC_SEARCH_LIBS(socket, socket)
|
||||
AC_SEARCH_LIBS(gethostbyname, nsl)
|
||||
|
||||
AC_CHECK_LIB([econf],[econf_readDirs],[LIBECONF="-leconf"],[LIBECONF=""])
|
||||
if test -n "$LIBECONF"; then
|
||||
ECONF_CPPFLAGS="-DUSE_ECONF=1"
|
||||
AC_ARG_ENABLE([vendordir],
|
||||
AS_HELP_STRING([--enable-vendordir=DIR], [Directory for distribution provided configuration files]),,[])
|
||||
fi
|
||||
AC_SUBST(ECONF_CPPFLAGS)
|
||||
AC_SUBST(LIBECONF)
|
||||
AC_SUBST([VENDORDIR], [$enable_vendordir])
|
||||
AM_CONDITIONAL([HAVE_VENDORDIR], [test "x$enable_vendordir" != x])
|
||||
|
||||
if test "$enable_shadowgrp" = "yes"; then
|
||||
AC_DEFINE(SHADOWGRP, 1, [Define to support the shadow group file.])
|
||||
fi
|
||||
@@ -321,11 +376,12 @@ if test "$enable_man" = "yes"; then
|
||||
AC_PATH_PROG([XSLTPROC], [xsltproc])
|
||||
if test -z "$XSLTPROC"; then
|
||||
enable_man=no
|
||||
AC_MSG_ERROR([xsltproc is missing.])
|
||||
fi
|
||||
|
||||
dnl check for DocBook DTD and stylesheets in the local catalog.
|
||||
JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN],
|
||||
[DocBook XML DTD V4.1.2], [], enable_man=no)
|
||||
JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.5//EN],
|
||||
[DocBook XML DTD V4.5], [], enable_man=no)
|
||||
JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
|
||||
[DocBook XSL Stylesheets >= 1.70.1], [], enable_man=no)
|
||||
fi
|
||||
@@ -354,6 +410,10 @@ AC_SUBST(LIBCRYPT)
|
||||
AC_CHECK_LIB(crypt, crypt, [LIBCRYPT=-lcrypt],
|
||||
[AC_MSG_ERROR([crypt() not found])])
|
||||
|
||||
AC_SUBST(LIYESCRYPT)
|
||||
AC_CHECK_LIB(crypt, crypt, [LIYESCRYPT=-lcrypt],
|
||||
[AC_MSG_ERROR([crypt() not found])])
|
||||
|
||||
AC_SUBST(LIBACL)
|
||||
if test "$with_acl" != "no"; then
|
||||
AC_CHECK_HEADERS(acl/libacl.h attr/error_context.h, [acl_header="yes"], [acl_header="no"])
|
||||
@@ -449,6 +509,20 @@ if test "$with_libcrack" = "yes"; then
|
||||
AC_DEFINE(HAVE_LIBCRACK_PW, 1, [Defined if it includes *Pw functions.]))
|
||||
fi
|
||||
|
||||
if test "$with_btrfs" != "no"; then
|
||||
AC_CHECK_HEADERS([sys/statfs.h linux/magic.h linux/btrfs_tree.h], \
|
||||
[btrfs_headers="yes"], [btrfs_headers="no"])
|
||||
if test "$btrfs_headers$with_btrfs" = "noyes" ; then
|
||||
AC_MSG_ERROR([One of sys/statfs.h linux/magic.h linux/btrfs_tree.h is missing])
|
||||
fi
|
||||
|
||||
if test "$btrfs_headers" = "yes" ; then
|
||||
AC_DEFINE(WITH_BTRFS, 1, [Build shadow with BtrFS support])
|
||||
with_btrfs="yes"
|
||||
fi
|
||||
fi
|
||||
AM_CONDITIONAL(WITH_BTRFS, test x$with_btrfs = xyes)
|
||||
|
||||
AC_SUBST(LIBSELINUX)
|
||||
AC_SUBST(LIBSEMANAGE)
|
||||
if test "$with_selinux" != "no"; then
|
||||
@@ -473,7 +547,7 @@ if test "$with_selinux" != "no"; then
|
||||
AC_MSG_ERROR([libsemanage not found])
|
||||
fi
|
||||
|
||||
if test "$selinux_lib$semanage_lib" == "yesyes" ; then
|
||||
if test "$selinux_lib$semanage_lib" = "yesyes" ; then
|
||||
AC_DEFINE(WITH_SELINUX, 1,
|
||||
[Build shadow with SELinux support])
|
||||
LIBSELINUX="-lselinux"
|
||||
@@ -563,7 +637,7 @@ if test "$with_libpam" = "yes"; then
|
||||
LIBS=$save_libs
|
||||
|
||||
AC_DEFINE(USE_PAM, 1, [Define to support Pluggable Authentication Modules])
|
||||
AC_DEFINE_UNQUOTED(SHADOW_PAM_CONVERSATION, [$pam_conv_function],[PAM converstation to use])
|
||||
AC_DEFINE_UNQUOTED(SHADOW_PAM_CONVERSATION, [$pam_conv_function],[PAM conversation to use])
|
||||
AM_CONDITIONAL(USE_PAM, [true])
|
||||
|
||||
AC_MSG_CHECKING(use login and su access checking if PAM not used)
|
||||
@@ -593,6 +667,19 @@ if test "$enable_acct_tools_setuid" != "no"; then
|
||||
fi
|
||||
AM_CONDITIONAL(ACCT_TOOLS_SETUID, test "x$enable_acct_tools_setuid" = "xyes")
|
||||
|
||||
|
||||
AC_ARG_WITH(fcaps,
|
||||
[AC_HELP_STRING([--with-fcaps], [use file capabilities instead of suid binaries for newuidmap/newgidmap @<:@default=no@:>@])],
|
||||
[with_fcaps=$withval], [with_fcaps=no])
|
||||
AM_CONDITIONAL(FCAPS, test "x$with_fcaps" = "xyes")
|
||||
|
||||
if test "x$with_fcaps" = "xyes"; then
|
||||
AC_CHECK_PROGS(capcmd, "setcap")
|
||||
if test "x$capcmd" = "x" ; then
|
||||
AC_MSG_ERROR([setcap command not available])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(LIBSKEY)
|
||||
AC_SUBST(LIBMD)
|
||||
if test "$with_skey" = "yes"; then
|
||||
@@ -650,6 +737,8 @@ AC_CONFIG_FILES([
|
||||
man/zh_TW/Makefile
|
||||
libmisc/Makefile
|
||||
lib/Makefile
|
||||
libsubid/Makefile
|
||||
libsubid/subid.h
|
||||
src/Makefile
|
||||
contrib/Makefile
|
||||
etc/Makefile
|
||||
@@ -668,12 +757,18 @@ if test "$with_libpam" = "yes"; then
|
||||
echo " suid account management tools: $enable_acct_tools_setuid"
|
||||
fi
|
||||
echo " SELinux support: $with_selinux"
|
||||
echo " BtrFS support: $with_btrfs"
|
||||
echo " ACL support: $with_acl"
|
||||
echo " Extended Attributes support: $with_attr"
|
||||
echo " tcb support (incomplete): $with_tcb"
|
||||
echo " shadow group support: $enable_shadowgrp"
|
||||
echo " S/Key support: $with_skey"
|
||||
echo " SHA passwords encryption: $with_sha_crypt"
|
||||
echo " bcrypt passwords encryption: $with_bcrypt"
|
||||
echo " yescrypt passwords encryption: $with_yescrypt"
|
||||
echo " nscd support: $with_nscd"
|
||||
echo " sssd support: $with_sssd"
|
||||
echo " subordinate IDs support: $enable_subids"
|
||||
echo " use file caps: $with_fcaps"
|
||||
echo " install su: $with_su"
|
||||
echo
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
** --marekm
|
||||
**
|
||||
** 02/26/96
|
||||
** modified to call shadow utils (useradd,chage,passwd) on shadowed
|
||||
** modified to call shadow utils (useradd,chage,passwd) on shadowed
|
||||
** systems - Cristian Gafton, gafton@sorosis.ro
|
||||
**
|
||||
** 6/27/95
|
||||
** shadow-adduser 1.4:
|
||||
**
|
||||
** now it copies the /etc/skel dir into the person's dir,
|
||||
** makes the mail folders, changed some defaults and made a 'make
|
||||
** now it copies the /etc/skel dir into the person's dir,
|
||||
** makes the mail folders, changed some defaults and made a 'make
|
||||
** install' just for the hell of it.
|
||||
**
|
||||
** Greg Gallagher
|
||||
@@ -19,20 +19,20 @@
|
||||
**
|
||||
** 1/28/95
|
||||
** shadow-adduser 1.3:
|
||||
**
|
||||
** Basically a bug-fix on my additions in 1.2. Thanx to Terry Stewart
|
||||
**
|
||||
** Basically a bug-fix on my additions in 1.2. Thanks to Terry Stewart
|
||||
** (stew@texas.net) for pointing out one of the many idiotic bugs I introduced.
|
||||
** It was such a stupid bug that I would have never seen it myself.
|
||||
**
|
||||
** Brandon
|
||||
*****
|
||||
** 01/27/95
|
||||
**
|
||||
**
|
||||
** shadow-adduser 1.2:
|
||||
** I took the C source from adduser-shadow (credits are below) and made
|
||||
** it a little more worthwhile. Many small changes... Here's
|
||||
** the ones I can remember:
|
||||
**
|
||||
**
|
||||
** Removed support for non-shadowed systems (if you don't have shadow,
|
||||
** use the original adduser, don't get this shadow version!)
|
||||
** Added support for the correct /etc/shadow fields (Min days before
|
||||
@@ -56,7 +56,7 @@
|
||||
** Brandon
|
||||
** photon@usis.com
|
||||
**
|
||||
*****
|
||||
*****
|
||||
** adduser 1.0: add a new user account (For systems not using shadow)
|
||||
** With a nice little interface and a will to do all the work for you.
|
||||
**
|
||||
@@ -119,14 +119,14 @@
|
||||
|
||||
void main()
|
||||
{
|
||||
char foo[32];
|
||||
char foo[32];
|
||||
char uname[9],person[32],dir[32],shell[32];
|
||||
unsigned int group,min_pass,max_pass,warn_pass,user_die;
|
||||
/* the group and uid of the new user */
|
||||
int bad=0,done=0,correct=0,gets_warning=0;
|
||||
char cmd[255];
|
||||
struct group *grp;
|
||||
|
||||
|
||||
/* flags, in order:
|
||||
* bad to see if the username is in /etc/passwd, or if strange stuff has
|
||||
* been typed if the user might be put in group 0
|
||||
@@ -137,24 +137,24 @@ void main()
|
||||
*/
|
||||
|
||||
/* The real program starts HERE! */
|
||||
|
||||
|
||||
if(geteuid()!=0)
|
||||
{
|
||||
printf("It seems you don't have access to add a new user. Try\n");
|
||||
printf("logging in as root or su root to gain super-user access.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
/* Sanity checks
|
||||
*/
|
||||
|
||||
|
||||
if (!(grp=getgrgid(DEFAULT_GROUP))){
|
||||
printf("Error: the default group %d does not exist on this system!\n",
|
||||
DEFAULT_GROUP);
|
||||
printf("adduser must be recompiled.\n");
|
||||
exit(1);
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
while(!correct) { /* loop until a "good" uname is chosen */
|
||||
while(!done) {
|
||||
printf("\nLogin to add (^C to quit): ");
|
||||
@@ -178,19 +178,19 @@ void main()
|
||||
} else
|
||||
done=1;
|
||||
}; /* done, we have a valid new user name */
|
||||
|
||||
|
||||
/* all set, get the rest of the stuff */
|
||||
printf("\nEditing information for new user [%s]\n",uname);
|
||||
|
||||
|
||||
printf("\nFull Name [%s]: ",uname);
|
||||
gets(person);
|
||||
if (!strlen(person)) {
|
||||
bzero(person,sizeof(person));
|
||||
strcpy(person,uname);
|
||||
};
|
||||
|
||||
|
||||
do {
|
||||
bad=0;
|
||||
bad=0;
|
||||
printf("GID [%d]: ",DEFAULT_GROUP);
|
||||
gets(foo);
|
||||
if (!strlen(foo))
|
||||
@@ -220,7 +220,7 @@ void main()
|
||||
|
||||
|
||||
fflush(stdin);
|
||||
|
||||
|
||||
printf("\nIf home dir ends with a / then [%s] will be appended to it\n",uname);
|
||||
printf("Home Directory [%s/%s]: ",DEFAULT_HOME,uname);
|
||||
fflush(stdout);
|
||||
@@ -237,30 +237,30 @@ void main()
|
||||
gets(shell);
|
||||
if (!strlen(shell))
|
||||
sprintf(shell,"%s",DEFAULT_SHELL);
|
||||
|
||||
|
||||
printf("\nMin. Password Change Days [0]: ");
|
||||
gets(foo);
|
||||
min_pass=atoi(foo);
|
||||
|
||||
|
||||
printf("Max. Password Change Days [%d]: ",DEFAULT_MAX_PASS);
|
||||
gets(foo);
|
||||
if (strlen(foo) > 1)
|
||||
max_pass = atoi(foo);
|
||||
else
|
||||
max_pass = DEFAULT_MAX_PASS;
|
||||
|
||||
|
||||
printf("Password Warning Days [%d]: ",DEFAULT_WARN_PASS);
|
||||
gets(foo);
|
||||
warn_pass = atoi(foo);
|
||||
if (warn_pass==0)
|
||||
warn_pass = DEFAULT_WARN_PASS;
|
||||
|
||||
|
||||
printf("Days after Password Expiry for Account Locking [%d]: ",DEFAULT_USER_DIE);
|
||||
gets(foo);
|
||||
user_die = atoi(foo);
|
||||
if (user_die == 0)
|
||||
user_die = DEFAULT_USER_DIE;
|
||||
|
||||
|
||||
printf("\nInformation for new user [%s] [%s]:\n",uname,person);
|
||||
printf("Home directory: [%s] Shell: [%s]\n",dir,shell);
|
||||
printf("GID: [%d]\n",group);
|
||||
@@ -279,7 +279,7 @@ void main()
|
||||
bzero(cmd,sizeof(cmd));
|
||||
sprintf(cmd,"%s -g %d -d %s -s %s -c \"%s\" -m -k /etc/skel %s",
|
||||
USERADD_PATH,group,dir,shell,person,uname);
|
||||
printf("Calling useradd to add new user:\n%s\n",cmd);
|
||||
printf("Calling useradd to add new user:\n%s\n",cmd);
|
||||
if(system(cmd)){
|
||||
printf("User add failed!\n");
|
||||
exit(errno);
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
** 1/28/95
|
||||
** shadow-adduser 1.3:
|
||||
**
|
||||
** Basically a bug-fix on my additions in 1.2. Thanx to Terry Stewart
|
||||
** Basically a bug-fix on my additions in 1.2. Thanks to Terry Stewart
|
||||
** (stew@texas.net) for pointing out one of the many idiotic bugs I introduced.
|
||||
** It was such a stupid bug that I would have never seen it myself.
|
||||
**
|
||||
|
||||
@@ -32,7 +32,7 @@ def_home_dir=/home/users
|
||||
# default shell
|
||||
def_shell=/bin/tcsh
|
||||
|
||||
# Defaul expiration date (mm/dd/yy)
|
||||
# Default expiration date (mm/dd/yy)
|
||||
def_expire=""
|
||||
|
||||
# default dates
|
||||
|
||||
@@ -1,34 +1,7 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# Copyright (c) 1996 Brian R. Gaeke
|
||||
# All rights reserved.
|
||||
#
|
||||
# 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 Brian R. Gaeke.
|
||||
# 4. The name of the author, Brian R. Gaeke, may not be used to endorse
|
||||
# or promote products derived from this software without specific
|
||||
# prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY BRIAN R. GAEKE ``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 BRIAN R. GAEKE 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.
|
||||
# SPDX-FileCopyrightText: 1996 Brian R. Gaeke
|
||||
# SPDX-License-Identifier: BSD-4-Clause
|
||||
#
|
||||
# Additionally:
|
||||
#
|
||||
|
||||
@@ -76,36 +76,9 @@ else
|
||||
$echo 'x -' extracting 'Makefile' '(text)'
|
||||
sed 's/^X//' << 'SHAR_EOF' > 'Makefile' &&
|
||||
/*
|
||||
# Copyright 2000, International Business Machines, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# original author: George Kraft IV, gk4@us.ibm.com
|
||||
#
|
||||
# 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. Neither the name of International Business Machines, Inc., 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 INTERNATIONAL BUSINESS MACHINES, INC. 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
|
||||
# INTERNATIONAL BUSINESS MACHINES, INC. 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.
|
||||
# SPDX-FileCopyrightText: 2000, International Business Machines, Inc.
|
||||
# SPDX-FileCopyrightText: 2000, George Kraft IV, gk4@us.ibm.com
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
X
|
||||
all: groupmems
|
||||
@@ -143,36 +116,9 @@ else
|
||||
$echo 'x -' extracting 'groupmems.c' '(text)'
|
||||
sed 's/^X//' << 'SHAR_EOF' > 'groupmems.c' &&
|
||||
/*
|
||||
X * Copyright 2000, International Business Machines, Inc.
|
||||
X * All rights reserved.
|
||||
X *
|
||||
X * original author: George Kraft IV, gk4@us.ibm.com
|
||||
X *
|
||||
X * Redistribution and use in source and binary forms, with or without
|
||||
X * modification, are permitted provided that the following conditions
|
||||
X * are met:
|
||||
X *
|
||||
X * 1. Redistributions of source code must retain the above copyright
|
||||
X * notice, this list of conditions and the following disclaimer.
|
||||
X * 2. Redistributions in binary form must reproduce the above copyright
|
||||
X * notice, this list of conditions and the following disclaimer in the
|
||||
X * documentation and/or other materials provided with the distribution.
|
||||
X * 3. Neither the name of International Business Machines, Inc., nor the
|
||||
X * names of its contributors may be used to endorse or promote products
|
||||
X * derived from this software without specific prior written permission.
|
||||
X *
|
||||
X * THIS SOFTWARE IS PROVIDED BY INTERNATIONAL BUSINESS MACHINES, INC. AND
|
||||
X * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
|
||||
X * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
X * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
X * INTERNATIONAL BUSINESS MACHINES, INC. OR CONTRIBUTORS BE LIABLE
|
||||
X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
X * SUCH DAMAGE.
|
||||
X * SPDX-FileCopyrightText: 2000, International Business Machines, Inc.
|
||||
X * SPDX-FileCopyrightText: 2000, George Kraft IV, gk4@us.ibm.com
|
||||
X * SPDX-License-Identifier: BSD-3-Clause
|
||||
X */
|
||||
/*
|
||||
**
|
||||
@@ -436,36 +382,9 @@ else
|
||||
$echo 'x -' extracting 'groupmems.8' '(text)'
|
||||
sed 's/^X//' << 'SHAR_EOF' > 'groupmems.8' &&
|
||||
X.\"
|
||||
X.\" Copyright 2000, International Business Machines, Inc.
|
||||
X.\" All rights reserved.
|
||||
X.\"
|
||||
X.\" original author: George Kraft IV, gk4@us.ibm.com
|
||||
X.\"
|
||||
X.\" Redistribution and use in source and binary forms, with or without
|
||||
X.\" modification, are permitted provided that the following conditions
|
||||
X.\" are met:
|
||||
X.\"
|
||||
X.\" 1. Redistributions of source code must retain the above copyright
|
||||
X.\" notice, this list of conditions and the following disclaimer.
|
||||
X.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
X.\" notice, this list of conditions and the following disclaimer in the
|
||||
X.\" documentation and/or other materials provided with the distribution.
|
||||
X.\" 3. Neither the name of International Business Machines, Inc., nor the
|
||||
X.\" names of its contributors may be used to endorse or promote products
|
||||
X.\" derived from this software without specific prior written permission.
|
||||
X.\"
|
||||
X.\" THIS SOFTWARE IS PROVIDED BY INTERNATIONAL BUSINESS MACHINES, INC. AND
|
||||
X.\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
|
||||
X.\" BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
X.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
X.\" INTERNATIONAL BUSINESS MACHINES, INC. OR CONTRIBUTORS BE LIABLE
|
||||
X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
X.\" SUCH DAMAGE.
|
||||
X.\" SPDX-FileCopyrightText: 2000, International Business Machines, Inc.
|
||||
X.\" SPDX-FileCopyrightText: 2000, George Kraft IV, gk4@us.ibm.com
|
||||
X.\" SPDX-License-Identifier: BSD-3-Clause
|
||||
X.\"
|
||||
X.\" $Id$
|
||||
X.\"
|
||||
@@ -480,7 +399,7 @@ X.B groupmems
|
||||
\fB-D\fR |
|
||||
[\fB-g\fI group_name \fR]
|
||||
X.SH DESCRIPTION
|
||||
The \fBgroupmems\fR utility allows a user to administer his/her own
|
||||
The \fBgroupmems\fR utility allows a user to administer their own
|
||||
group membership list without the requirement of superuser privileges.
|
||||
The \fBgroupmems\fR utility is for systems that configure its users to
|
||||
be in their own name sake primary group (i.e., guest / guest).
|
||||
|
||||
@@ -2,7 +2,7 @@ Hello Marek,
|
||||
|
||||
I have created a diffile against the 980403 release that adds
|
||||
functionality to newusers for automatic handling of users with only
|
||||
anonomous ftp login (using the guestgroup feature in ftpaccess, which
|
||||
anonymous ftp login (using the guestgroup feature in ftpaccess, which
|
||||
means that the users home directory looks like '/home/user/./'). It also
|
||||
adds a commandline argument to specify an initial directory structure
|
||||
for such users, with a tarball normally containing the bin,lib,etc
|
||||
|
||||
@@ -1311,7 +1311,7 @@
|
||||
|
||||
This means that fred's password is valid, it was last changed on
|
||||
03/04/96, it can be changed at any time, it expires after 60 days,
|
||||
fred will not be warned, and and the account won't be disabled when
|
||||
fred will not be warned, and the account won't be disabled when
|
||||
the password expires.
|
||||
|
||||
This simply means that if fred logs in after the password expires, he
|
||||
@@ -1487,7 +1487,7 @@
|
||||
|
||||
If a user logs into a line that is listed in /etc/dialups, and his
|
||||
shell is listed in the file /etc/d_passwd he will be allowed access
|
||||
only by suppling the correct password.
|
||||
only by supplying the correct password.
|
||||
|
||||
Another useful purpose for using dial-up passwords might be to setup a
|
||||
line that only allows a certain type of connect (perhaps a PPP or UUCP
|
||||
|
||||
@@ -15,7 +15,7 @@ Changes:
|
||||
- code merged into lmain.c --cristiang
|
||||
|
||||
TODO: - support groups in the limits file
|
||||
(only usernames are supported at this momment :-( )
|
||||
(only usernames are supported at this moment :-( )
|
||||
|
||||
Setting user limits for shadow login program
|
||||
|
||||
@@ -63,4 +63,3 @@ To completely disable limits for a user, a single dash (-) will do.
|
||||
Also, please note that all limit settings are set PER LOGIN. They are
|
||||
not global, nor are they permanent. Perhaps global limits will come, but
|
||||
for now this will have to do ;)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# This is the current (still incomplete) list of platforms this
|
||||
# package has been verified to work on. Additions (preferably
|
||||
# in the format as described below) are welcome. Thanks!
|
||||
#
|
||||
#
|
||||
# V: last version reported to work
|
||||
# H: host type
|
||||
# L: Linux libc version
|
||||
|
||||
4
doc/README.skey
Normal file
4
doc/README.skey
Normal file
@@ -0,0 +1,4 @@
|
||||
# S/Key support
|
||||
shadow-utils can be built with S/Key support using the S/Key package from:
|
||||
* http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libskey/ or
|
||||
* https://gentoo.osuosl.org/distfiles/skey-1.1.5.tar.bz2
|
||||
@@ -37,4 +37,3 @@ New ideas to add to this list are welcome, too. --marekm
|
||||
per-user configuration, to be executed with run-parts. Some hooks should
|
||||
be executed at package install time for existing users, likewise for
|
||||
package removal and possibly modification. (Debian Bug#36019)
|
||||
|
||||
|
||||
15
docs/index.html
Normal file
15
docs/index.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<head>
|
||||
<title>shadow - Welcome</title>
|
||||
</head>
|
||||
<body>
|
||||
<h2> Welcome!</h2>
|
||||
<p> This is the shadow tool suite home page. </p>
|
||||
|
||||
<p>
|
||||
You can find releases <a href="https://github.com/shadow-maint/shadow/releases">here</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Raise issues, request features, and report bugs <a href="https://github.com/shadow-maint/shadow/issues">here</a>.
|
||||
</p>
|
||||
</body>
|
||||
@@ -4,8 +4,7 @@
|
||||
sysconf_DATA = login.defs
|
||||
|
||||
defaultdir = $(sysconfdir)/default
|
||||
default_DATA = \
|
||||
useradd
|
||||
default_DATA =
|
||||
|
||||
nonpam_files = \
|
||||
limits \
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
# $Id$
|
||||
#
|
||||
# Login access control table.
|
||||
#
|
||||
#
|
||||
# When someone logs in, the table is scanned for the first entry that
|
||||
# matches the (user, host) combination, or, in case of non-networked
|
||||
# logins, the first entry that matches the (user, tty) combination. The
|
||||
# permissions field of that table entry determines whether the login will
|
||||
# permissions field of that table entry determines whether the login will
|
||||
# be accepted or refused.
|
||||
#
|
||||
#
|
||||
# Format of the login access control table is three fields separated by a
|
||||
# ":" character:
|
||||
#
|
||||
#
|
||||
# permission : users : origins
|
||||
#
|
||||
#
|
||||
# The first field should be a "+" (access granted) or "-" (access denied)
|
||||
# character.
|
||||
# character.
|
||||
#
|
||||
# The second field should be a list of one or more login names, group
|
||||
# names, or ALL (always matches). A pattern of the form user@host is
|
||||
@@ -37,7 +37,7 @@
|
||||
# listed: the program does not look at a user's primary group id value.
|
||||
#
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# Disallow console logins to all but a few accounts.
|
||||
#
|
||||
#-:ALL EXCEPT wheel shutdown sync:console
|
||||
|
||||
@@ -31,6 +31,15 @@ LOG_OK_LOGINS no
|
||||
#
|
||||
LASTLOG_ENAB yes
|
||||
|
||||
#
|
||||
# Limit the highest user ID number for which the lastlog entries should
|
||||
# be updated.
|
||||
#
|
||||
# No LASTLOG_UID_MAX means that there is no user ID limit for writing
|
||||
# lastlog entries.
|
||||
#
|
||||
#LASTLOG_UID_MAX
|
||||
|
||||
#
|
||||
# Enable checking and display of mailbox status upon login.
|
||||
#
|
||||
@@ -186,12 +195,17 @@ KILLCHAR 025
|
||||
# Default initial "umask" value used by login(1) on non-PAM enabled systems.
|
||||
# Default "umask" value for pam_umask(8) on PAM enabled systems.
|
||||
# UMASK is also used by useradd(8) and newusers(8) to set the mode for new
|
||||
# home directories.
|
||||
# home directories if HOME_MODE is not set.
|
||||
# 022 is the default value, but 027, or even 077, could be considered
|
||||
# for increased privacy. There is no One True Answer here: each sysadmin
|
||||
# must make up his/her mind.
|
||||
# must make up their mind.
|
||||
UMASK 022
|
||||
|
||||
# HOME_MODE is used by useradd(8) and newusers(8) to set the mode for new
|
||||
# home directories.
|
||||
# If HOME_MODE is not set, the value of UMASK is used to create the mode.
|
||||
#HOME_MODE 0700
|
||||
|
||||
#
|
||||
# Password aging controls:
|
||||
#
|
||||
@@ -281,7 +295,7 @@ CHFN_AUTH yes
|
||||
# any combination of letters "frwh" (full name, room number, work
|
||||
# phone, home phone). If not defined, no changes are allowed.
|
||||
# For backward compatibility, "yes" = "rwh" and "no" = "frwh".
|
||||
#
|
||||
#
|
||||
CHFN_RESTRICT rwh
|
||||
|
||||
#
|
||||
@@ -311,7 +325,10 @@ CHFN_RESTRICT rwh
|
||||
# If set to MD5, MD5-based algorithm will be used for encrypting password
|
||||
# If set to SHA256, SHA256-based algorithm will be used for encrypting password
|
||||
# If set to SHA512, SHA512-based algorithm will be used for encrypting password
|
||||
# If set to BCRYPT, BCRYPT-based algorithm will be used for encrypting password
|
||||
# If set to YESCRYPT, YESCRYPT-based algorithm will be used for encrypting password
|
||||
# If set to DES, DES-based algorithm will be used for encrypting password (default)
|
||||
# MD5 and DES should not be used for new hashes, see crypt(5) for recommendations.
|
||||
# Overrides the MD5_CRYPT_ENAB option
|
||||
#
|
||||
# Note: If you use PAM, it is recommended to use a value consistent with
|
||||
@@ -327,13 +344,42 @@ CHFN_RESTRICT rwh
|
||||
# However, more CPU resources will be needed to authenticate users if
|
||||
# this value is increased.
|
||||
#
|
||||
# If not specified, the libc will choose the default number of rounds (5000).
|
||||
# If not specified, the libc will choose the default number of rounds (5000),
|
||||
# which is orders of magnitude too low for modern hardware.
|
||||
# The values must be within the 1000-999999999 range.
|
||||
# If only one of the MIN or MAX values is set, then this value will be used.
|
||||
# If MIN > MAX, the highest value will be used.
|
||||
#
|
||||
# SHA_CRYPT_MIN_ROUNDS 5000
|
||||
# SHA_CRYPT_MAX_ROUNDS 5000
|
||||
#SHA_CRYPT_MIN_ROUNDS 5000
|
||||
#SHA_CRYPT_MAX_ROUNDS 5000
|
||||
|
||||
#
|
||||
# Only works if ENCRYPT_METHOD is set to BCRYPT.
|
||||
#
|
||||
# Define the number of BCRYPT rounds.
|
||||
# With a lot of rounds, it is more difficult to brute-force the password.
|
||||
# However, more CPU resources will be needed to authenticate users if
|
||||
# this value is increased.
|
||||
#
|
||||
# If not specified, 13 rounds will be attempted.
|
||||
# If only one of the MIN or MAX values is set, then this value will be used.
|
||||
# If MIN > MAX, the highest value will be used.
|
||||
#
|
||||
#BCRYPT_MIN_ROUNDS 13
|
||||
#BCRYPT_MAX_ROUNDS 13
|
||||
|
||||
#
|
||||
# Only works if ENCRYPT_METHOD is set to YESCRYPT.
|
||||
#
|
||||
# Define the YESCRYPT cost factor.
|
||||
# With a higher cost factor, it is more difficult to brute-force the password.
|
||||
# However, more CPU time and more memory will be needed to authenticate users
|
||||
# if this value is increased.
|
||||
#
|
||||
# If not specified, a cost factor of 5 will be used.
|
||||
# The value must be within the 1-11 range.
|
||||
#
|
||||
#YESCRYPT_COST_FACTOR 5
|
||||
|
||||
#
|
||||
# List of groups to add to the user's supplementary group set
|
||||
@@ -352,6 +398,14 @@ CHFN_RESTRICT rwh
|
||||
#
|
||||
DEFAULT_HOME yes
|
||||
|
||||
#
|
||||
# The pwck(8) utility emits a warning for any system account with a home
|
||||
# directory that does not exist. Some system accounts intentionally do
|
||||
# not have a home directory. Such accounts may have this string as
|
||||
# their home directory in /etc/passwd to avoid a spurious warning.
|
||||
#
|
||||
NONEXISTENT /nonexistent
|
||||
|
||||
#
|
||||
# If this file exists and is readable, login environment will be
|
||||
# read from it. Every line should be in the form name=value.
|
||||
@@ -398,3 +452,27 @@ USERGROUPS_ENAB yes
|
||||
# missing.
|
||||
#
|
||||
#FORCE_SHADOW yes
|
||||
|
||||
#
|
||||
# Allow newuidmap and newgidmap when running under an alternative
|
||||
# primary group.
|
||||
#
|
||||
#GRANT_AUX_GROUP_SUBIDS yes
|
||||
|
||||
#
|
||||
# Prevents an empty password field to be interpreted as "no authentication
|
||||
# required".
|
||||
# Set to "yes" to prevent for all accounts
|
||||
# Set to "superuser" to prevent for UID 0 / root (default)
|
||||
# Set to "no" to not prevent for any account (dangerous, historical default)
|
||||
PREVENT_NO_AUTH superuser
|
||||
|
||||
#
|
||||
# Select the HMAC cryptography algorithm.
|
||||
# Used in pam_timestamp module to calculate the keyed-hash message
|
||||
# authentication code.
|
||||
#
|
||||
# Note: It is recommended to check hmac(3) to see the possible algorithms
|
||||
# that are available in your system.
|
||||
#
|
||||
#HMAC_CRYPTO_ALGO SHA512
|
||||
|
||||
@@ -6,8 +6,7 @@ pamd_files = \
|
||||
chsh \
|
||||
groupmems \
|
||||
login \
|
||||
passwd \
|
||||
su
|
||||
passwd
|
||||
|
||||
pamd_acct_tools_files = \
|
||||
chage \
|
||||
@@ -29,4 +28,8 @@ pamd_DATA += $(pamd_acct_tools_files)
|
||||
endif
|
||||
endif
|
||||
|
||||
if WITH_SU
|
||||
pamd_files += su
|
||||
endif
|
||||
|
||||
EXTRA_DIST = $(pamd_files) $(pamd_acct_tools_files)
|
||||
|
||||
28
etc/shadow-maint/userdel-pre.d/01-kill_user_procs.sh
Executable file
28
etc/shadow-maint/userdel-pre.d/01-kill_user_procs.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
|
||||
# Check user exists, and if so, send sigkill to processes that the user owns
|
||||
|
||||
RUNNING=`ps -eo user | grep -Fx "$SUBJECT" | wc -l`
|
||||
|
||||
# if the user does not exist, RUNNING will be 0
|
||||
|
||||
if [ "${RUNNING}x" = "0x" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
ls -1 /proc | while IFS= read -r PROC; do
|
||||
echo "$PROC" | grep -E '^[0-9]+$' >/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
continue
|
||||
fi
|
||||
if [ -d "/proc/${PROC}" ]; then
|
||||
USR=`stat -c "%U" /proc/${PROC}`
|
||||
if [ "${USR}" = "${SUBJECT}" ]; then
|
||||
echo "Killing ${SUBJECT} owned ${PROC}"
|
||||
kill -9 "${PROC}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
# useradd defaults file
|
||||
GROUP=1000
|
||||
HOME=/home
|
||||
INACTIVE=-1
|
||||
EXPIRE=
|
||||
SHELL=/bin/bash
|
||||
SKEL=/etc/skel
|
||||
CREATE_MAIL_SPOOL=yes
|
||||
@@ -1,11 +1,16 @@
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.0 foreign
|
||||
|
||||
DEFS =
|
||||
DEFS =
|
||||
|
||||
noinst_LTLIBRARIES = libshadow.la
|
||||
|
||||
libshadow_la_LDFLAGS = -version-info 0:0:0
|
||||
libshadow_la_CPPFLAGS = $(ECONF_CPPFLAGS)
|
||||
if HAVE_VENDORDIR
|
||||
libshadow_la_CPPFLAGS += -DVENDORDIR=\"$(VENDORDIR)\"
|
||||
endif
|
||||
|
||||
libshadow_la_CPPFLAGS += -I$(top_srcdir)
|
||||
|
||||
libshadow_la_SOURCES = \
|
||||
commonio.c \
|
||||
@@ -28,8 +33,14 @@ libshadow_la_SOURCES = \
|
||||
groupio.h \
|
||||
gshadow.c \
|
||||
lockpw.c \
|
||||
nss.c \
|
||||
nscd.c \
|
||||
nscd.h \
|
||||
shadowlog.c \
|
||||
shadowlog.h \
|
||||
shadowlog_internal.h \
|
||||
sssd.c \
|
||||
sssd.h \
|
||||
pam_defs.h \
|
||||
port.c \
|
||||
port.h \
|
||||
@@ -39,6 +50,8 @@ libshadow_la_SOURCES = \
|
||||
pwio.c \
|
||||
pwio.h \
|
||||
pwmem.c \
|
||||
run_part.h \
|
||||
run_part.c \
|
||||
subordinateio.h \
|
||||
subordinateio.c \
|
||||
selinux.c \
|
||||
|
||||
210
lib/commonio.c
210
lib/commonio.c
@@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 1990 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 2001, Marek Michałkiewicz
|
||||
* Copyright (c) 2001 - 2006, Tomasz Kłoczko
|
||||
* Copyright (c) 2007 - 2011, Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 2001, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2001 - 2006, Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2007 - 2011, Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -45,11 +22,13 @@
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include "nscd.h"
|
||||
#include "sssd.h"
|
||||
#ifdef WITH_TCB
|
||||
#include <tcb.h>
|
||||
#endif /* WITH_TCB */
|
||||
#include "prototypes.h"
|
||||
#include "commonio.h"
|
||||
#include "shadowlog_internal.h"
|
||||
|
||||
/* local function prototypes */
|
||||
static int lrename (const char *, const char *);
|
||||
@@ -140,12 +119,12 @@ static int do_lock_file (const char *file, const char *lock, bool log)
|
||||
int retval;
|
||||
char buf[32];
|
||||
|
||||
fd = open (file, O_CREAT | O_EXCL | O_WRONLY, 0600);
|
||||
fd = open (file, O_CREAT | O_TRUNC | O_WRONLY, 0600);
|
||||
if (-1 == fd) {
|
||||
if (log) {
|
||||
(void) fprintf (stderr,
|
||||
(void) fprintf (shadow_logfd,
|
||||
"%s: %s: %s\n",
|
||||
Prog, file, strerror (errno));
|
||||
shadow_progname, file, strerror (errno));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -155,9 +134,19 @@ static int do_lock_file (const char *file, const char *lock, bool log)
|
||||
len = (ssize_t) strlen (buf) + 1;
|
||||
if (write (fd, buf, (size_t) len) != len) {
|
||||
if (log) {
|
||||
(void) fprintf (stderr,
|
||||
"%s: %s: %s\n",
|
||||
Prog, file, strerror (errno));
|
||||
(void) fprintf (shadow_logfd,
|
||||
"%s: %s file write error: %s\n",
|
||||
shadow_progname, file, strerror (errno));
|
||||
}
|
||||
(void) close (fd);
|
||||
unlink (file);
|
||||
return 0;
|
||||
}
|
||||
if (fdatasync (fd) == -1) {
|
||||
if (log) {
|
||||
(void) fprintf (shadow_logfd,
|
||||
"%s: %s file sync error: %s\n",
|
||||
shadow_progname, file, strerror (errno));
|
||||
}
|
||||
(void) close (fd);
|
||||
unlink (file);
|
||||
@@ -168,9 +157,9 @@ static int do_lock_file (const char *file, const char *lock, bool log)
|
||||
if (link (file, lock) == 0) {
|
||||
retval = check_link_count (file);
|
||||
if ((0==retval) && log) {
|
||||
(void) fprintf (stderr,
|
||||
(void) fprintf (shadow_logfd,
|
||||
"%s: %s: lock file already used\n",
|
||||
Prog, file);
|
||||
shadow_progname, file);
|
||||
}
|
||||
unlink (file);
|
||||
return retval;
|
||||
@@ -179,9 +168,9 @@ static int do_lock_file (const char *file, const char *lock, bool log)
|
||||
fd = open (lock, O_RDWR);
|
||||
if (-1 == fd) {
|
||||
if (log) {
|
||||
(void) fprintf (stderr,
|
||||
(void) fprintf (shadow_logfd,
|
||||
"%s: %s: %s\n",
|
||||
Prog, lock, strerror (errno));
|
||||
shadow_progname, lock, strerror (errno));
|
||||
}
|
||||
unlink (file);
|
||||
errno = EINVAL;
|
||||
@@ -191,9 +180,9 @@ static int do_lock_file (const char *file, const char *lock, bool log)
|
||||
close (fd);
|
||||
if (len <= 0) {
|
||||
if (log) {
|
||||
(void) fprintf (stderr,
|
||||
(void) fprintf (shadow_logfd,
|
||||
"%s: existing lock file %s without a PID\n",
|
||||
Prog, lock);
|
||||
shadow_progname, lock);
|
||||
}
|
||||
unlink (file);
|
||||
errno = EINVAL;
|
||||
@@ -202,9 +191,9 @@ static int do_lock_file (const char *file, const char *lock, bool log)
|
||||
buf[len] = '\0';
|
||||
if (get_pid (buf, &pid) == 0) {
|
||||
if (log) {
|
||||
(void) fprintf (stderr,
|
||||
(void) fprintf (shadow_logfd,
|
||||
"%s: existing lock file %s with an invalid PID '%s'\n",
|
||||
Prog, lock, buf);
|
||||
shadow_progname, lock, buf);
|
||||
}
|
||||
unlink (file);
|
||||
errno = EINVAL;
|
||||
@@ -212,9 +201,9 @@ static int do_lock_file (const char *file, const char *lock, bool log)
|
||||
}
|
||||
if (kill (pid, 0) == 0) {
|
||||
if (log) {
|
||||
(void) fprintf (stderr,
|
||||
(void) fprintf (shadow_logfd,
|
||||
"%s: lock %s already used by PID %lu\n",
|
||||
Prog, lock, (unsigned long) pid);
|
||||
shadow_progname, lock, (unsigned long) pid);
|
||||
}
|
||||
unlink (file);
|
||||
errno = EEXIST;
|
||||
@@ -222,9 +211,9 @@ static int do_lock_file (const char *file, const char *lock, bool log)
|
||||
}
|
||||
if (unlink (lock) != 0) {
|
||||
if (log) {
|
||||
(void) fprintf (stderr,
|
||||
(void) fprintf (shadow_logfd,
|
||||
"%s: cannot get lock %s: %s\n",
|
||||
Prog, lock, strerror (errno));
|
||||
shadow_progname, lock, strerror (errno));
|
||||
}
|
||||
unlink (file);
|
||||
return 0;
|
||||
@@ -234,15 +223,15 @@ static int do_lock_file (const char *file, const char *lock, bool log)
|
||||
if (link (file, lock) == 0) {
|
||||
retval = check_link_count (file);
|
||||
if ((0==retval) && log) {
|
||||
(void) fprintf (stderr,
|
||||
(void) fprintf (shadow_logfd,
|
||||
"%s: %s: lock file already used\n",
|
||||
Prog, file);
|
||||
shadow_progname, file);
|
||||
}
|
||||
} else {
|
||||
if (log) {
|
||||
(void) fprintf (stderr,
|
||||
(void) fprintf (shadow_logfd,
|
||||
"%s: cannot get lock %s: %s\n",
|
||||
Prog, lock, strerror (errno));
|
||||
shadow_progname, lock, strerror (errno));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -301,15 +290,12 @@ static int create_backup (const char *backup, FILE * fp)
|
||||
struct utimbuf ub;
|
||||
FILE *bkfp;
|
||||
int c;
|
||||
mode_t mask;
|
||||
|
||||
if (fstat (fileno (fp), &sb) != 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
mask = umask (077);
|
||||
bkfp = fopen (backup, "w");
|
||||
(void) umask (mask);
|
||||
bkfp = fopen_set_perms (backup, "w", &sb);
|
||||
if (NULL == bkfp) {
|
||||
return -1;
|
||||
}
|
||||
@@ -328,8 +314,12 @@ static int create_backup (const char *backup, FILE * fp)
|
||||
/* FIXME: unlink the backup file? */
|
||||
return -1;
|
||||
}
|
||||
if ( (fsync (fileno (bkfp)) != 0)
|
||||
|| (fclose (bkfp) != 0)) {
|
||||
if (fsync (fileno (bkfp)) != 0) {
|
||||
(void) fclose (bkfp);
|
||||
/* FIXME: unlink the backup file? */
|
||||
return -1;
|
||||
}
|
||||
if (fclose (bkfp) != 0) {
|
||||
/* FIXME: unlink the backup file? */
|
||||
return -1;
|
||||
}
|
||||
@@ -366,6 +356,7 @@ static void free_linked_list (struct commonio_db *db)
|
||||
int commonio_setname (struct commonio_db *db, const char *name)
|
||||
{
|
||||
snprintf (db->filename, sizeof (db->filename), "%s", name);
|
||||
db->setname = true;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -378,57 +369,77 @@ bool commonio_present (const struct commonio_db *db)
|
||||
|
||||
int commonio_lock_nowait (struct commonio_db *db, bool log)
|
||||
{
|
||||
char file[1024];
|
||||
char lock[1024];
|
||||
char* file = NULL;
|
||||
char* lock = NULL;
|
||||
size_t lock_file_len;
|
||||
size_t file_len;
|
||||
int err = 0;
|
||||
|
||||
if (db->locked) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
snprintf (file, sizeof file, "%s.%lu",
|
||||
file_len = strlen(db->filename) + 11;/* %lu max size */
|
||||
lock_file_len = strlen(db->filename) + 6; /* sizeof ".lock" */
|
||||
file = (char*)malloc(file_len);
|
||||
if (file == NULL) {
|
||||
goto cleanup_ENOMEM;
|
||||
}
|
||||
lock = (char*)malloc(lock_file_len);
|
||||
if (lock == NULL) {
|
||||
goto cleanup_ENOMEM;
|
||||
}
|
||||
snprintf (file, file_len, "%s.%lu",
|
||||
db->filename, (unsigned long) getpid ());
|
||||
snprintf (lock, sizeof lock, "%s.lock", db->filename);
|
||||
snprintf (lock, lock_file_len, "%s.lock", db->filename);
|
||||
if (do_lock_file (file, lock, log) != 0) {
|
||||
db->locked = true;
|
||||
lock_count++;
|
||||
return 1;
|
||||
err = 1;
|
||||
}
|
||||
return 0;
|
||||
cleanup_ENOMEM:
|
||||
if (file)
|
||||
free(file);
|
||||
if (lock)
|
||||
free(lock);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
int commonio_lock (struct commonio_db *db)
|
||||
{
|
||||
int i;
|
||||
|
||||
#ifdef HAVE_LCKPWDF
|
||||
/*
|
||||
* only if the system libc has a real lckpwdf() - the one from
|
||||
* Only if the system libc has a real lckpwdf() - the one from
|
||||
* lockpw.c calls us and would cause infinite recursion!
|
||||
* It is also not used with the prefix option.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Call lckpwdf() on the first lock.
|
||||
* If it succeeds, call *_lock() only once
|
||||
* (no retries, it should always succeed).
|
||||
*/
|
||||
if (0 == lock_count) {
|
||||
if (lckpwdf () == -1) {
|
||||
if (geteuid () != 0) {
|
||||
(void) fprintf (stderr,
|
||||
"%s: Permission denied.\n",
|
||||
Prog);
|
||||
if (!db->setname) {
|
||||
/*
|
||||
* Call lckpwdf() on the first lock.
|
||||
* If it succeeds, call *_lock() only once
|
||||
* (no retries, it should always succeed).
|
||||
*/
|
||||
if (0 == lock_count) {
|
||||
if (lckpwdf () == -1) {
|
||||
if (geteuid () != 0) {
|
||||
(void) fprintf (shadow_logfd,
|
||||
"%s: Permission denied.\n",
|
||||
shadow_progname);
|
||||
}
|
||||
return 0; /* failure */
|
||||
}
|
||||
return 0; /* failure */
|
||||
}
|
||||
}
|
||||
|
||||
if (commonio_lock_nowait (db, true) != 0) {
|
||||
return 1; /* success */
|
||||
}
|
||||
if (commonio_lock_nowait (db, true) != 0) {
|
||||
return 1; /* success */
|
||||
}
|
||||
|
||||
ulckpwdf ();
|
||||
return 0; /* failure */
|
||||
#else /* !HAVE_LCKPWDF */
|
||||
int i;
|
||||
ulckpwdf ();
|
||||
return 0; /* failure */
|
||||
}
|
||||
#endif /* !HAVE_LCKPWDF */
|
||||
|
||||
/*
|
||||
* lckpwdf() not used - do it the old way.
|
||||
@@ -449,13 +460,12 @@ int commonio_lock (struct commonio_db *db)
|
||||
}
|
||||
/* no unnecessary retries on "permission denied" errors */
|
||||
if (geteuid () != 0) {
|
||||
(void) fprintf (stderr, "%s: Permission denied.\n",
|
||||
Prog);
|
||||
(void) fprintf (shadow_logfd, "%s: Permission denied.\n",
|
||||
shadow_progname);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 0; /* failure */
|
||||
#endif /* !HAVE_LCKPWDF */
|
||||
}
|
||||
|
||||
static void dec_lock_count (void)
|
||||
@@ -468,6 +478,7 @@ static void dec_lock_count (void)
|
||||
if (nscd_need_reload) {
|
||||
nscd_flush_cache ("passwd");
|
||||
nscd_flush_cache ("group");
|
||||
sssd_flush_cache (SSSD_DB_PASSWD | SSSD_DB_GROUP);
|
||||
nscd_need_reload = false;
|
||||
}
|
||||
#ifdef HAVE_LCKPWDF
|
||||
@@ -754,16 +765,16 @@ commonio_sort (struct commonio_db *db, int (*cmp) (const void *, const void *))
|
||||
for (ptr = db->head;
|
||||
(NULL != ptr)
|
||||
#if KEEP_NIS_AT_END
|
||||
&& (NULL != ptr->line)
|
||||
&& ( ('+' != ptr->line[0])
|
||||
&& ('-' != ptr->line[0]))
|
||||
&& ((NULL == ptr->line)
|
||||
|| (('+' != ptr->line[0])
|
||||
&& ('-' != ptr->line[0])))
|
||||
#endif
|
||||
;
|
||||
ptr = ptr->next) {
|
||||
n++;
|
||||
}
|
||||
#if KEEP_NIS_AT_END
|
||||
if ((NULL != ptr) && (NULL != ptr->line)) {
|
||||
if (NULL != ptr) {
|
||||
nis = ptr;
|
||||
}
|
||||
#endif
|
||||
@@ -908,7 +919,6 @@ static int write_all (const struct commonio_db *db)
|
||||
|
||||
|
||||
int commonio_close (struct commonio_db *db)
|
||||
/*@requires notnull db->fp@*/
|
||||
{
|
||||
char buf[1024];
|
||||
int errors = 0;
|
||||
@@ -921,8 +931,10 @@ int commonio_close (struct commonio_db *db)
|
||||
db->isopen = false;
|
||||
|
||||
if (!db->changed || db->readonly) {
|
||||
(void) fclose (db->fp);
|
||||
db->fp = NULL;
|
||||
if (NULL != db->fp) {
|
||||
(void) fclose (db->fp);
|
||||
db->fp = NULL;
|
||||
}
|
||||
goto success;
|
||||
}
|
||||
|
||||
@@ -944,7 +956,7 @@ int commonio_close (struct commonio_db *db)
|
||||
snprintf (buf, sizeof buf, "%s-", db->filename);
|
||||
|
||||
#ifdef WITH_SELINUX
|
||||
if (set_selinux_file_context (buf) != 0) {
|
||||
if (set_selinux_file_context (db->filename, S_IFREG) != 0) {
|
||||
errors++;
|
||||
}
|
||||
#endif
|
||||
@@ -977,7 +989,7 @@ int commonio_close (struct commonio_db *db)
|
||||
snprintf (buf, sizeof buf, "%s+", db->filename);
|
||||
|
||||
#ifdef WITH_SELINUX
|
||||
if (set_selinux_file_context (buf) != 0) {
|
||||
if (set_selinux_file_context (db->filename, S_IFREG) != 0) {
|
||||
errors++;
|
||||
}
|
||||
#endif
|
||||
@@ -1079,7 +1091,7 @@ int commonio_update (struct commonio_db *db, const void *eptr)
|
||||
p = find_entry_by_name (db, db->ops->getname (eptr));
|
||||
if (NULL != p) {
|
||||
if (next_entry_by_name (db, p->next, db->ops->getname (eptr)) != NULL) {
|
||||
fprintf (stderr, _("Multiple entries named '%s' in %s. Please fix this with pwck or grpck.\n"), db->ops->getname (eptr), db->filename);
|
||||
fprintf (shadow_logfd, _("Multiple entries named '%s' in %s. Please fix this with pwck or grpck.\n"), db->ops->getname (eptr), db->filename);
|
||||
db->ops->free (nentry);
|
||||
return 0;
|
||||
}
|
||||
@@ -1184,7 +1196,7 @@ int commonio_remove (struct commonio_db *db, const char *name)
|
||||
return 0;
|
||||
}
|
||||
if (next_entry_by_name (db, p->next, name) != NULL) {
|
||||
fprintf (stderr, _("Multiple entries named '%s' in %s. Please fix this with pwck or grpck.\n"), name, db->filename);
|
||||
fprintf (shadow_logfd, _("Multiple entries named '%s' in %s. Please fix this with pwck or grpck.\n"), name, db->filename);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,42 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 1990 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 2000, Marek Michałkiewicz
|
||||
* Copyright (c) 2001 - 2005, Tomasz Kłoczko
|
||||
* Copyright (c) 2007 - 2010, Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2001 - 2005, Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2007 - 2010, Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
#ifndef _COMMONIO_H
|
||||
#define _COMMONIO_H
|
||||
|
||||
#ifdef WITH_SELINUX
|
||||
#include <selinux/selinux.h>
|
||||
#endif
|
||||
#ifndef COMMONIO_H
|
||||
#define COMMONIO_H
|
||||
|
||||
#include "defines.h" /* bool */
|
||||
|
||||
@@ -121,7 +94,7 @@ struct commonio_db {
|
||||
/*@dependent@*/ /*@null@*/FILE *fp;
|
||||
|
||||
#ifdef WITH_SELINUX
|
||||
/*@null@*/security_context_t scontext;
|
||||
/*@null@*/char *scontext;
|
||||
#endif
|
||||
/*
|
||||
* Default permissions and owner for newly created data file.
|
||||
@@ -143,6 +116,7 @@ struct commonio_db {
|
||||
bool isopen:1;
|
||||
bool locked:1;
|
||||
bool readonly:1;
|
||||
bool setname:1;
|
||||
};
|
||||
|
||||
extern int commonio_setname (struct commonio_db *, const char *);
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#ifndef _DEFINES_H_
|
||||
#define _DEFINES_H_
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if HAVE_STDBOOL_H
|
||||
# include <stdbool.h>
|
||||
#else
|
||||
@@ -24,7 +26,7 @@ typedef unsigned char _Bool;
|
||||
|
||||
/* Take care of NLS matters. */
|
||||
#ifdef S_SPLINT_S
|
||||
extern char *setlocale(int categorie, const char *locale);
|
||||
extern char *setlocale(int categories, const char *locale);
|
||||
# define LC_ALL (6)
|
||||
extern char * bindtextdomain (const char * domainname, const char * dirname);
|
||||
extern char * textdomain (const char * domainname);
|
||||
@@ -68,10 +70,6 @@ extern char * textdomain (const char * domainname);
|
||||
# define strrchr rindex
|
||||
# endif
|
||||
char *strchr (), *strrchr (), *strtok ();
|
||||
|
||||
# ifndef HAVE_MEMCPY
|
||||
# define memcpy(d, s, n) bcopy((s), (d), (n))
|
||||
# endif
|
||||
#endif /* not STDC_HEADERS */
|
||||
|
||||
#if HAVE_ERRNO_H
|
||||
@@ -94,6 +92,14 @@ char *strchr (), *strrchr (), *strtok ();
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* crypt(3), crypt_gensalt(3), and their
|
||||
* feature test macros may be defined in here.
|
||||
*/
|
||||
#if HAVE_CRYPT_H
|
||||
# include <crypt.h>
|
||||
#endif
|
||||
|
||||
#if TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
@@ -105,11 +111,7 @@ char *strchr (), *strrchr (), *strtok ();
|
||||
# endif
|
||||
#endif /* not TIME_WITH_SYS_TIME */
|
||||
|
||||
#ifdef HAVE_MEMSET
|
||||
# define memzero(ptr, size) memset((void *)(ptr), 0, (size))
|
||||
#else
|
||||
# define memzero(ptr, size) bzero((char *)(ptr), (size))
|
||||
#endif
|
||||
#define memzero(ptr, size) memset((void *)(ptr), 0, (size))
|
||||
#define strzero(s) memzero(s, strlen(s)) /* warning: evaluates twice */
|
||||
|
||||
#ifdef HAVE_DIRENT_H /* DIR_SYSV */
|
||||
@@ -382,4 +384,10 @@ extern char *strerror ();
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SECURE_GETENV
|
||||
# define shadow_getenv(name) secure_getenv(name)
|
||||
# else
|
||||
# define shadow_getenv(name) getenv(name)
|
||||
#endif
|
||||
|
||||
#endif /* _DEFINES_H_ */
|
||||
|
||||
@@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 1990 - 1993, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 2000, Marek Michałkiewicz
|
||||
* Copyright (c) 2005 , Tomasz Kłoczko
|
||||
* Copyright (c) 2007 - 2010, Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1990 - 1993, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2007 - 2010, Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -39,6 +16,7 @@
|
||||
|
||||
#include "prototypes.h"
|
||||
#include "defines.h"
|
||||
#include "shadowlog_internal.h"
|
||||
|
||||
/*@exposed@*//*@null@*/char *pw_encrypt (const char *clear, const char *salt)
|
||||
{
|
||||
@@ -65,12 +43,18 @@
|
||||
case '1':
|
||||
method = "MD5";
|
||||
break;
|
||||
case '2':
|
||||
method = "BCRYPT";
|
||||
break;
|
||||
case '5':
|
||||
method = "SHA256";
|
||||
break;
|
||||
case '6':
|
||||
method = "SHA512";
|
||||
break;
|
||||
case 'y':
|
||||
method = "YESCRYPT";
|
||||
break;
|
||||
default:
|
||||
{
|
||||
static char nummethod[4] = "$x$";
|
||||
@@ -78,7 +62,7 @@
|
||||
method = &nummethod[0];
|
||||
}
|
||||
}
|
||||
(void) fprintf (stderr,
|
||||
(void) fprintf (shadow_logfd,
|
||||
_("crypt method not supported by libcrypt? (%s)\n"),
|
||||
method);
|
||||
exit (EXIT_FAILURE);
|
||||
|
||||
@@ -1,30 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2005 - 2006, Tomasz Kłoczko
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 2005 - 2006, Tomasz Kłoczko
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
@@ -1,32 +1,9 @@
|
||||
/*
|
||||
* Copyright (c) 1989 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 1997, Marek Michałkiewicz
|
||||
* Copyright (c) 2005 , Tomasz Kłoczko
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1989 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 1997, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -45,8 +22,8 @@
|
||||
struct faillog {
|
||||
short fail_cnt; /* failures since last success */
|
||||
short fail_max; /* failures before turning account off */
|
||||
char fail_line[12]; /* last failure occured here */
|
||||
time_t fail_time; /* last failure occured then */
|
||||
char fail_line[12]; /* last failure occurred here */
|
||||
time_t fail_time; /* last failure occurred then */
|
||||
/*
|
||||
* If nonzero, the account will be re-enabled if there are no
|
||||
* failures for fail_locktime seconds since last failure.
|
||||
|
||||
33
lib/fields.c
33
lib/fields.c
@@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 1990 , Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 1997, Marek Michałkiewicz
|
||||
* Copyright (c) 2003 - 2005, Tomasz Kłoczko
|
||||
* Copyright (c) 2007 , Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1990 , Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 1997, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2007 , Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
33
lib/fputsx.c
33
lib/fputsx.c
@@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 1990 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 1999, Marek Michałkiewicz
|
||||
* Copyright (c) 2005 , Tomasz Kłoczko
|
||||
* Copyright (c) 2008 , Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 1999, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -1,30 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2009 , Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 2009 , Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -1,30 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2009 , Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 2009 , Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -1,30 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2009 , Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 2009 , Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
161
lib/getdef.c
161
lib/getdef.c
@@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 1991 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 2000, Marek Michałkiewicz
|
||||
* Copyright (c) 2002 - 2006, Tomasz Kłoczko
|
||||
* Copyright (c) 2007 - 2008, Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1991 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2002 - 2006, Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2007 - 2008, Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -40,7 +17,11 @@
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#ifdef USE_ECONF
|
||||
#include <libeconf.h>
|
||||
#endif
|
||||
#include "getdef.h"
|
||||
#include "shadowlog_internal.h"
|
||||
/*
|
||||
* A configuration item definition.
|
||||
*/
|
||||
@@ -58,6 +39,7 @@ struct itemdef {
|
||||
{"ENV_TZ", NULL}, \
|
||||
{"FAILLOG_ENAB", NULL}, \
|
||||
{"FTMP_FILE", NULL}, \
|
||||
{"HMAC_CRYPTO_ALGO", NULL}, \
|
||||
{"ISSUE_FILE", NULL}, \
|
||||
{"LASTLOG_ENAB", NULL}, \
|
||||
{"LOGIN_STRING", NULL}, \
|
||||
@@ -74,6 +56,16 @@ struct itemdef {
|
||||
{"SU_WHEEL_ONLY", NULL}, \
|
||||
{"ULIMIT", NULL},
|
||||
|
||||
/*
|
||||
* Items used in other tools (util-linux, etc.)
|
||||
*/
|
||||
#define FOREIGNDEFS \
|
||||
{"ALWAYS_SET_PATH", NULL}, \
|
||||
{"ENV_ROOTPATH", NULL}, \
|
||||
{"LOGIN_KEEP_USERNAME", NULL}, \
|
||||
{"LOGIN_PLAIN_PROMPT", NULL}, \
|
||||
{"MOTD_FIRSTONLY", NULL}, \
|
||||
|
||||
|
||||
#define NUMDEFS (sizeof(def_table)/sizeof(def_table[0]))
|
||||
static struct itemdef def_table[] = {
|
||||
@@ -90,8 +82,10 @@ static struct itemdef def_table[] = {
|
||||
{"FAKE_SHELL", NULL},
|
||||
{"GID_MAX", NULL},
|
||||
{"GID_MIN", NULL},
|
||||
{"HOME_MODE", NULL},
|
||||
{"HUSHLOGIN_FILE", NULL},
|
||||
{"KILLCHAR", NULL},
|
||||
{"LASTLOG_UID_MAX", NULL},
|
||||
{"LOGIN_RETRIES", NULL},
|
||||
{"LOGIN_TIMEOUT", NULL},
|
||||
{"LOG_OK_LOGINS", NULL},
|
||||
@@ -100,12 +94,20 @@ static struct itemdef def_table[] = {
|
||||
{"MAIL_FILE", NULL},
|
||||
{"MAX_MEMBERS_PER_GROUP", NULL},
|
||||
{"MD5_CRYPT_ENAB", NULL},
|
||||
{"NONEXISTENT", NULL},
|
||||
{"PASS_MAX_DAYS", NULL},
|
||||
{"PASS_MIN_DAYS", NULL},
|
||||
{"PASS_WARN_AGE", NULL},
|
||||
#ifdef USE_SHA_CRYPT
|
||||
{"SHA_CRYPT_MAX_ROUNDS", NULL},
|
||||
{"SHA_CRYPT_MIN_ROUNDS", NULL},
|
||||
#endif
|
||||
#ifdef USE_BCRYPT
|
||||
{"BCRYPT_MAX_ROUNDS", NULL},
|
||||
{"BCRYPT_MIN_ROUNDS", NULL},
|
||||
#endif
|
||||
#ifdef USE_YESCRYPT
|
||||
{"YESCRYPT_COST_FACTOR", NULL},
|
||||
#endif
|
||||
{"SUB_GID_COUNT", NULL},
|
||||
{"SUB_GID_MAX", NULL},
|
||||
@@ -140,6 +142,8 @@ static struct itemdef def_table[] = {
|
||||
{"USE_TCB", NULL},
|
||||
#endif
|
||||
{"FORCE_SHADOW", NULL},
|
||||
{"GRANT_AUX_GROUP_SUBIDS", NULL},
|
||||
{"PREVENT_NO_AUTH", NULL},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
@@ -148,13 +152,24 @@ static struct itemdef knowndef_table[] = {
|
||||
#ifdef USE_PAM
|
||||
PAMDEFS
|
||||
#endif
|
||||
FOREIGNDEFS
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
#ifdef USE_ECONF
|
||||
#ifdef VENDORDIR
|
||||
static const char* vendordir = VENDORDIR;
|
||||
#else
|
||||
static const char* vendordir = NULL;
|
||||
#endif
|
||||
static const char* sysconfdir = "/etc";
|
||||
#else
|
||||
#ifndef LOGINDEFS
|
||||
#define LOGINDEFS "/etc/login.defs"
|
||||
#endif
|
||||
|
||||
static char def_fname[] = LOGINDEFS; /* login config defs file */
|
||||
static const char* def_fname = LOGINDEFS; /* login config defs file */
|
||||
#endif
|
||||
static bool def_loaded = false; /* are defs already loaded? */
|
||||
|
||||
/* local function prototypes */
|
||||
@@ -230,7 +245,7 @@ int getdef_num (const char *item, int dflt)
|
||||
if ( (getlong (d->value, &val) == 0)
|
||||
|| (val > INT_MAX)
|
||||
|| (val < INT_MIN)) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("configuration error - cannot parse %s value: '%s'"),
|
||||
item, d->value);
|
||||
return dflt;
|
||||
@@ -265,7 +280,7 @@ unsigned int getdef_unum (const char *item, unsigned int dflt)
|
||||
if ( (getlong (d->value, &val) == 0)
|
||||
|| (val < 0)
|
||||
|| (val > INT_MAX)) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("configuration error - cannot parse %s value: '%s'"),
|
||||
item, d->value);
|
||||
return dflt;
|
||||
@@ -298,7 +313,7 @@ long getdef_long (const char *item, long dflt)
|
||||
}
|
||||
|
||||
if (getlong (d->value, &val) == 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("configuration error - cannot parse %s value: '%s'"),
|
||||
item, d->value);
|
||||
return dflt;
|
||||
@@ -331,7 +346,7 @@ unsigned long getdef_ulong (const char *item, unsigned long dflt)
|
||||
|
||||
if (getulong (d->value, &val) == 0) {
|
||||
/* FIXME: we should have a getulong */
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("configuration error - cannot parse %s value: '%s'"),
|
||||
item, d->value);
|
||||
return dflt;
|
||||
@@ -369,7 +384,7 @@ int putdef_str (const char *name, const char *value)
|
||||
cp = strdup (value);
|
||||
if (NULL == cp) {
|
||||
(void) fputs (_("Could not allocate space for config info.\n"),
|
||||
stderr);
|
||||
shadow_logfd);
|
||||
SYSLOG ((LOG_ERR, "could not allocate space for config info"));
|
||||
return -1;
|
||||
}
|
||||
@@ -394,7 +409,6 @@ static /*@observer@*/ /*@null@*/struct itemdef *def_find (const char *name)
|
||||
{
|
||||
struct itemdef *ptr;
|
||||
|
||||
|
||||
/*
|
||||
* Search into the table.
|
||||
*/
|
||||
@@ -414,7 +428,7 @@ static /*@observer@*/ /*@null@*/struct itemdef *def_find (const char *name)
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("configuration error - unknown item '%s' (notify administrator)\n"),
|
||||
name);
|
||||
SYSLOG ((LOG_CRIT, "unknown configuration item `%s'", name));
|
||||
@@ -423,6 +437,37 @@ out:
|
||||
return (struct itemdef *) NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* setdef_config_file - set the default configuration file path
|
||||
*
|
||||
* must be called prior to any def* calls.
|
||||
*/
|
||||
|
||||
void setdef_config_file (const char* file)
|
||||
{
|
||||
#ifdef USE_ECONF
|
||||
size_t len;
|
||||
char* cp;
|
||||
|
||||
len = strlen(file) + strlen(sysconfdir) + 2;
|
||||
cp = malloc(len);
|
||||
if (cp == NULL)
|
||||
exit (13);
|
||||
snprintf(cp, len, "%s/%s", file, sysconfdir);
|
||||
sysconfdir = cp;
|
||||
#ifdef VENDORDIR
|
||||
len = strlen(file) + strlen(vendordir) + 2;
|
||||
cp = malloc(len);
|
||||
if (cp == NULL)
|
||||
exit (13);
|
||||
snprintf(cp, len, "%s/%s", file, vendordir);
|
||||
vendordir = cp;
|
||||
#endif
|
||||
#else
|
||||
def_fname = file;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* def_load - load configuration table
|
||||
*
|
||||
@@ -431,9 +476,16 @@ out:
|
||||
|
||||
static void def_load (void)
|
||||
{
|
||||
#ifdef USE_ECONF
|
||||
econf_file *defs_file = NULL;
|
||||
econf_err error;
|
||||
char **keys;
|
||||
size_t key_number;
|
||||
#else
|
||||
int i;
|
||||
FILE *fp;
|
||||
char buf[1024], *name, *value, *s;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Set the initialized flag.
|
||||
@@ -441,6 +493,42 @@ static void def_load (void)
|
||||
*/
|
||||
def_loaded = true;
|
||||
|
||||
#ifdef USE_ECONF
|
||||
|
||||
error = econf_readDirs (&defs_file, vendordir, sysconfdir, "login", "defs", " \t", "#");
|
||||
if (error) {
|
||||
if (error == ECONF_NOFILE)
|
||||
return;
|
||||
|
||||
SYSLOG ((LOG_CRIT, "cannot open login definitions [%s]",
|
||||
econf_errString(error)));
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if ((error = econf_getKeys(defs_file, NULL, &key_number, &keys))) {
|
||||
SYSLOG ((LOG_CRIT, "cannot read login definitions [%s]",
|
||||
econf_errString(error)));
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < key_number; i++) {
|
||||
char *value;
|
||||
|
||||
econf_getStringValue(defs_file, NULL, keys[i], &value);
|
||||
|
||||
/*
|
||||
* Store the value in def_table.
|
||||
*
|
||||
* Ignore failures to load the login.defs file.
|
||||
* The error was already reported to the user and to
|
||||
* syslog. The tools will just use their default values.
|
||||
*/
|
||||
(void)putdef_str (keys[i], value);
|
||||
}
|
||||
|
||||
econf_free (keys);
|
||||
econf_free (defs_file);
|
||||
#else
|
||||
/*
|
||||
* Open the configuration definitions file.
|
||||
*/
|
||||
@@ -504,6 +592,7 @@ static void def_load (void)
|
||||
}
|
||||
|
||||
(void) fclose (fp);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
34
lib/getdef.h
34
lib/getdef.h
@@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 1991 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 2000, Marek Michałkiewicz
|
||||
* Copyright (c) 2002 - 2006, Tomasz Kłoczko
|
||||
* Copyright (c) 2008 , Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1991 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2002 - 2006, Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
#ifndef _GETDEF_H
|
||||
#define _GETDEF_H
|
||||
@@ -40,6 +17,7 @@ extern unsigned long getdef_ulong (const char *, unsigned long);
|
||||
extern unsigned int getdef_unum (const char *, unsigned int);
|
||||
extern /*@observer@*/ /*@null@*/const char *getdef_str (const char *);
|
||||
extern int putdef_str (const char *, const char *);
|
||||
extern void setdef_config_file (const char* file);
|
||||
|
||||
/* default UMASK value if not specified in /etc/login.defs */
|
||||
#define GETDEF_DEFAULT_UMASK 022
|
||||
|
||||
@@ -1,30 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2007 - 2009, Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 2007 - 2009, Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -1,30 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2007 - 2009, Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 2007 - 2009, Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -1,34 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 1990 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 2000, Marek Michałkiewicz
|
||||
* Copyright (c) 2001 , Michał Moskal
|
||||
* Copyright (c) 2005 , Tomasz Kłoczko
|
||||
* Copyright (c) 2007 - 2010, Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2001 , Michał Moskal
|
||||
* SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2007 - 2010, Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -139,7 +116,8 @@ static /*@owned@*/struct commonio_db group_db = {
|
||||
false, /* changed */
|
||||
false, /* isopen */
|
||||
false, /* locked */
|
||||
false /* readonly */
|
||||
false, /* readonly */
|
||||
false /* setname */
|
||||
};
|
||||
|
||||
int gr_setdbname (const char *filename)
|
||||
@@ -338,8 +316,7 @@ static /*@null@*/struct commonio_entry *merge_group_entries (
|
||||
errno = ENOMEM;
|
||||
return NULL;
|
||||
}
|
||||
snprintf(new_line, new_line_len, "%s\n%s", gr1->line, gr2->line);
|
||||
new_line[new_line_len] = '\0';
|
||||
snprintf(new_line, new_line_len + 1, "%s\n%s", gr1->line, gr2->line);
|
||||
|
||||
/* Concatenate the 2 list of members */
|
||||
for (i=0; NULL != gptr1->gr_mem[i]; i++);
|
||||
|
||||
@@ -1,34 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 1990 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 2000, Marek Michałkiewicz
|
||||
* Copyright (c) 2001 , Michał Moskal
|
||||
* Copyright (c) 2005 , Tomasz Kłoczko
|
||||
* Copyright (c) 2008 , Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2001 , Michał Moskal
|
||||
* SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
@@ -1,34 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 1990 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 2000, Marek Michałkiewicz
|
||||
* Copyright (c) 2001 , Michał Moskal
|
||||
* Copyright (c) 2005 , Tomasz Kłoczko
|
||||
* Copyright (c) 2007 - 2013, Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2001 , Michał Moskal
|
||||
* SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2007 - 2013, Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -87,6 +64,18 @@
|
||||
return gr;
|
||||
}
|
||||
|
||||
void gr_free_members (struct group *grent)
|
||||
{
|
||||
if (NULL != grent->gr_mem) {
|
||||
size_t i;
|
||||
for (i = 0; NULL != grent->gr_mem[i]; i++) {
|
||||
free (grent->gr_mem[i]);
|
||||
}
|
||||
free (grent->gr_mem);
|
||||
grent->gr_mem = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void gr_free (/*@out@*/ /*@only@*/struct group *grent)
|
||||
{
|
||||
free (grent->gr_name);
|
||||
@@ -94,13 +83,36 @@ void gr_free (/*@out@*/ /*@only@*/struct group *grent)
|
||||
memzero (grent->gr_passwd, strlen (grent->gr_passwd));
|
||||
free (grent->gr_passwd);
|
||||
}
|
||||
if (NULL != grent->gr_mem) {
|
||||
size_t i;
|
||||
for (i = 0; NULL != grent->gr_mem[i]; i++) {
|
||||
free (grent->gr_mem[i]);
|
||||
}
|
||||
free (grent->gr_mem);
|
||||
}
|
||||
gr_free_members(grent);
|
||||
free (grent);
|
||||
}
|
||||
|
||||
bool gr_append_member(struct group *grp, char *member)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (NULL == grp->gr_mem || grp->gr_mem[0] == NULL) {
|
||||
grp->gr_mem = (char **)malloc(2 * sizeof(char *));
|
||||
if (!grp->gr_mem) {
|
||||
return false;
|
||||
}
|
||||
grp->gr_mem[0] = strdup(member);
|
||||
if (!grp->gr_mem[0]) {
|
||||
return false;
|
||||
}
|
||||
grp->gr_mem[1] = NULL;
|
||||
return true;
|
||||
}
|
||||
|
||||
for (i = 0; grp->gr_mem[i]; i++) ;
|
||||
grp->gr_mem = realloc(grp->gr_mem, (i + 2) * sizeof(char *));
|
||||
if (NULL == grp->gr_mem) {
|
||||
return false;
|
||||
}
|
||||
grp->gr_mem[i] = strdup(member);
|
||||
if (NULL == grp->gr_mem[i]) {
|
||||
return false;
|
||||
}
|
||||
grp->gr_mem[i + 1] = NULL;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 1990 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 1998, Marek Michałkiewicz
|
||||
* Copyright (c) 2005 , Tomasz Kłoczko
|
||||
* Copyright (c) 2008 - 2009, Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2008 - 2009, Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -1,32 +1,9 @@
|
||||
/*
|
||||
* Copyright (c) 1988 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 1997, Marek Michałkiewicz
|
||||
* Copyright (c) 2003 - 2005, Tomasz Kłoczko
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1988 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 1997, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
31
lib/lockpw.c
31
lib/lockpw.c
@@ -1,32 +1,9 @@
|
||||
/*
|
||||
* Copyright (c) 1992 , Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 1998, Marek Michałkiewicz
|
||||
* Copyright (c) 2005 , Tomasz Kłoczko
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1992 , Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
13
lib/nscd.c
13
lib/nscd.c
@@ -10,6 +10,7 @@
|
||||
#include "defines.h"
|
||||
#include "prototypes.h"
|
||||
#include "nscd.h"
|
||||
#include "shadowlog_internal.h"
|
||||
|
||||
#define MSG_NSCD_FLUSH_CACHE_FAILED "%s: Failed to flush the nscd cache.\n"
|
||||
|
||||
@@ -25,15 +26,15 @@ int nscd_flush_cache (const char *service)
|
||||
|
||||
if (run_command (cmd, spawnedArgs, spawnedEnv, &status) != 0) {
|
||||
/* run_command writes its own more detailed message. */
|
||||
(void) fprintf (stderr, _(MSG_NSCD_FLUSH_CACHE_FAILED), Prog);
|
||||
(void) fprintf (shadow_logfd, _(MSG_NSCD_FLUSH_CACHE_FAILED), shadow_progname);
|
||||
return -1;
|
||||
}
|
||||
|
||||
code = WEXITSTATUS (status);
|
||||
if (!WIFEXITED (status)) {
|
||||
(void) fprintf (stderr,
|
||||
(void) fprintf (shadow_logfd,
|
||||
_("%s: nscd did not terminate normally (signal %d)\n"),
|
||||
Prog, WTERMSIG (status));
|
||||
shadow_progname, WTERMSIG (status));
|
||||
return -1;
|
||||
} else if (code == E_CMD_NOTFOUND) {
|
||||
/* nscd is not installed, or it is installed but uses an
|
||||
@@ -43,9 +44,9 @@ int nscd_flush_cache (const char *service)
|
||||
/* nscd is installed, but it isn't active. */
|
||||
return 0;
|
||||
} else if (code != 0) {
|
||||
(void) fprintf (stderr, _("%s: nscd exited with status %d\n"),
|
||||
Prog, code);
|
||||
(void) fprintf (stderr, _(MSG_NSCD_FLUSH_CACHE_FAILED), Prog);
|
||||
(void) fprintf (shadow_logfd, _("%s: nscd exited with status %d\n"),
|
||||
shadow_progname, code);
|
||||
(void) fprintf (shadow_logfd, _(MSG_NSCD_FLUSH_CACHE_FAILED), shadow_progname);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
150
lib/nss.c
Normal file
150
lib/nss.c
Normal file
@@ -0,0 +1,150 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <dlfcn.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <ctype.h>
|
||||
#include <stdatomic.h>
|
||||
#include "prototypes.h"
|
||||
#include "../libsubid/subid.h"
|
||||
#include "shadowlog_internal.h"
|
||||
|
||||
#define NSSWITCH "/etc/nsswitch.conf"
|
||||
|
||||
// NSS plugin handling for subids
|
||||
// If nsswitch has a line like
|
||||
// subid: sssd
|
||||
// then sssd will be consulted for subids. Unlike normal NSS dbs,
|
||||
// only one db is supported at a time. That's open to debate, but
|
||||
// the subids are a pretty limited resource, and local files seem
|
||||
// bound to step on any other allocations leading to insecure
|
||||
// conditions.
|
||||
static atomic_flag nss_init_started;
|
||||
static atomic_bool nss_init_completed;
|
||||
|
||||
static struct subid_nss_ops *subid_nss;
|
||||
|
||||
bool nss_is_initialized() {
|
||||
return atomic_load(&nss_init_completed);
|
||||
}
|
||||
|
||||
void nss_exit() {
|
||||
if (nss_is_initialized() && subid_nss) {
|
||||
dlclose(subid_nss->handle);
|
||||
free(subid_nss);
|
||||
subid_nss = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// nsswitch_path is an argument only to support testing.
|
||||
void nss_init(char *nsswitch_path) {
|
||||
FILE *nssfp = NULL;
|
||||
char *line = NULL, *p, *token, *saveptr;
|
||||
size_t len = 0;
|
||||
|
||||
if (atomic_flag_test_and_set(&nss_init_started)) {
|
||||
// Another thread has started nss_init, wait for it to complete
|
||||
while (!atomic_load(&nss_init_completed))
|
||||
usleep(100);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!nsswitch_path)
|
||||
nsswitch_path = NSSWITCH;
|
||||
|
||||
// read nsswitch.conf to check for a line like:
|
||||
// subid: files
|
||||
nssfp = fopen(nsswitch_path, "r");
|
||||
if (!nssfp) {
|
||||
fprintf(shadow_logfd, "Failed opening %s: %m", nsswitch_path);
|
||||
atomic_store(&nss_init_completed, true);
|
||||
return;
|
||||
}
|
||||
while ((getline(&line, &len, nssfp)) != -1) {
|
||||
if (line[0] == '\0' || line[0] == '#')
|
||||
continue;
|
||||
if (strlen(line) < 8)
|
||||
continue;
|
||||
if (strncasecmp(line, "subid:", 6) != 0)
|
||||
continue;
|
||||
p = &line[6];
|
||||
while ((*p) && isspace(*p))
|
||||
p++;
|
||||
if (!*p)
|
||||
continue;
|
||||
for (token = strtok_r(p, " \n\t", &saveptr);
|
||||
token;
|
||||
token = strtok_r(NULL, " \n\t", &saveptr)) {
|
||||
char libname[65];
|
||||
void *h;
|
||||
if (strcmp(token, "files") == 0) {
|
||||
subid_nss = NULL;
|
||||
goto done;
|
||||
}
|
||||
if (strlen(token) > 50) {
|
||||
fprintf(shadow_logfd, "Subid NSS module name too long (longer than 50 characters): %s\n", token);
|
||||
fprintf(shadow_logfd, "Using files\n");
|
||||
subid_nss = NULL;
|
||||
goto done;
|
||||
}
|
||||
snprintf(libname, 64, "libsubid_%s.so", token);
|
||||
h = dlopen(libname, RTLD_LAZY);
|
||||
if (!h) {
|
||||
fprintf(shadow_logfd, "Error opening %s: %s\n", libname, dlerror());
|
||||
fprintf(shadow_logfd, "Using files\n");
|
||||
subid_nss = NULL;
|
||||
goto done;
|
||||
}
|
||||
subid_nss = malloc(sizeof(*subid_nss));
|
||||
if (!subid_nss) {
|
||||
dlclose(h);
|
||||
goto done;
|
||||
}
|
||||
subid_nss->has_range = dlsym(h, "shadow_subid_has_range");
|
||||
if (!subid_nss->has_range) {
|
||||
fprintf(shadow_logfd, "%s did not provide @has_range@\n", libname);
|
||||
dlclose(h);
|
||||
free(subid_nss);
|
||||
subid_nss = NULL;
|
||||
goto done;
|
||||
}
|
||||
subid_nss->list_owner_ranges = dlsym(h, "shadow_subid_list_owner_ranges");
|
||||
if (!subid_nss->list_owner_ranges) {
|
||||
fprintf(shadow_logfd, "%s did not provide @list_owner_ranges@\n", libname);
|
||||
dlclose(h);
|
||||
free(subid_nss);
|
||||
subid_nss = NULL;
|
||||
goto done;
|
||||
}
|
||||
subid_nss->find_subid_owners = dlsym(h, "shadow_subid_find_subid_owners");
|
||||
if (!subid_nss->find_subid_owners) {
|
||||
fprintf(shadow_logfd, "%s did not provide @find_subid_owners@\n", libname);
|
||||
dlclose(h);
|
||||
free(subid_nss);
|
||||
subid_nss = NULL;
|
||||
goto done;
|
||||
}
|
||||
subid_nss->handle = h;
|
||||
goto done;
|
||||
}
|
||||
fprintf(shadow_logfd, "No usable subid NSS module found, using files\n");
|
||||
// subid_nss has to be null here, but to ease reviews:
|
||||
free(subid_nss);
|
||||
subid_nss = NULL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
done:
|
||||
atomic_store(&nss_init_completed, true);
|
||||
free(line);
|
||||
if (nssfp) {
|
||||
atexit(nss_exit);
|
||||
fclose(nssfp);
|
||||
}
|
||||
}
|
||||
|
||||
struct subid_nss_ops *get_subid_nss_handle() {
|
||||
nss_init(NULL);
|
||||
return subid_nss;
|
||||
}
|
||||
@@ -1,31 +1,8 @@
|
||||
/*
|
||||
* Copyright (c) 1999 , Marek Michałkiewicz
|
||||
* Copyright (c) 2001 - 2005, Tomasz Kłoczko
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1999 , Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2001 - 2005, Tomasz Kłoczko
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
33
lib/port.c
33
lib/port.c
@@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 1989 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 1997, Marek Michałkiewicz
|
||||
* Copyright (c) 2005 , Tomasz Kłoczko
|
||||
* Copyright (c) 2008 , Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1989 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 1997, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
31
lib/port.h
31
lib/port.h
@@ -1,32 +1,9 @@
|
||||
/*
|
||||
* Copyright (c) 1989 - 1991, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 1997, Marek Michałkiewicz
|
||||
* Copyright (c) 2005 , Tomasz Kłoczko
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1989 - 1991, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 1997, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
143
lib/prototypes.h
143
lib/prototypes.h
@@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 1990 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 2000, Marek Michałkiewicz
|
||||
* Copyright (c) 2003 - 2006, Tomasz Kłoczko
|
||||
* Copyright (c) 2007 - 2010, Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2003 - 2006, Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2007 - 2010, Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -59,8 +36,6 @@
|
||||
#include "defines.h"
|
||||
#include "commonio.h"
|
||||
|
||||
extern /*@observer@*/ const char *Prog;
|
||||
|
||||
/* addgrps.c */
|
||||
#if defined (HAVE_SETGROUPS) && ! defined (USE_PAM)
|
||||
extern int add_groups (const char *);
|
||||
@@ -72,6 +47,14 @@ extern int expire (const struct passwd *, /*@null@*/const struct spwd *);
|
||||
/* isexpired.c */
|
||||
extern int isexpired (const struct passwd *, /*@null@*/const struct spwd *);
|
||||
|
||||
/* btrfs.c */
|
||||
#ifdef WITH_BTRFS
|
||||
extern int btrfs_create_subvolume(const char *path);
|
||||
extern int btrfs_remove_subvolume(const char *path);
|
||||
extern int btrfs_is_subvolume(const char *path);
|
||||
extern int is_btrfs(const char *path);
|
||||
#endif
|
||||
|
||||
/* basename() renamed to Basename() to avoid libc name space confusion */
|
||||
/* basename.c */
|
||||
extern /*@observer@*/const char *Basename (const char *str);
|
||||
@@ -125,6 +108,9 @@ extern int copy_tree (const char *src_root, const char *dst_root,
|
||||
uid_t old_uid, uid_t new_uid,
|
||||
gid_t old_gid, gid_t new_gid);
|
||||
|
||||
/* date_to_str.c */
|
||||
extern void date_to_str (size_t size, char buf[size], long date);
|
||||
|
||||
/* encrypt.c */
|
||||
extern /*@exposed@*//*@null@*/char *pw_encrypt (const char *, const char *);
|
||||
|
||||
@@ -153,12 +139,10 @@ extern int find_new_uid (bool sys_user,
|
||||
|
||||
#ifdef ENABLE_SUBIDS
|
||||
/* find_new_sub_gids.c */
|
||||
extern int find_new_sub_gids (const char *owner,
|
||||
gid_t *range_start, unsigned long *range_count);
|
||||
extern int find_new_sub_gids (gid_t *range_start, unsigned long *range_count);
|
||||
|
||||
/* find_new_sub_uids.c */
|
||||
extern int find_new_sub_uids (const char *owner,
|
||||
uid_t *range_start, unsigned long *range_count);
|
||||
extern int find_new_sub_uids (uid_t *range_start, unsigned long *range_count);
|
||||
#endif /* ENABLE_SUBIDS */
|
||||
|
||||
|
||||
@@ -179,6 +163,9 @@ extern int getrange (char *range,
|
||||
unsigned long *min, bool *has_min,
|
||||
unsigned long *max, bool *has_max);
|
||||
|
||||
/* gettime.c */
|
||||
extern time_t gettime ();
|
||||
|
||||
/* get_uid.c */
|
||||
extern int get_uid (const char *uidstr, uid_t *uid);
|
||||
|
||||
@@ -197,7 +184,9 @@ extern void __gr_set_changed (void);
|
||||
|
||||
/* groupmem.c */
|
||||
extern /*@null@*/ /*@only@*/struct group *__gr_dup (const struct group *grent);
|
||||
extern void gr_free_members (struct group *grent);
|
||||
extern void gr_free (/*@out@*/ /*@only@*/struct group *grent);
|
||||
extern bool gr_append_member (struct group *grp, char *member);
|
||||
|
||||
/* hushed.c */
|
||||
extern bool hushed (const char *username);
|
||||
@@ -251,9 +240,65 @@ extern void motd (void);
|
||||
/* myname.c */
|
||||
extern /*@null@*//*@only@*/struct passwd *get_my_pwent (void);
|
||||
|
||||
/* pam_pass_non_interractive.c */
|
||||
/* nss.c */
|
||||
#include <libsubid/subid.h>
|
||||
extern void nss_init(char *nsswitch_path);
|
||||
extern bool nss_is_initialized();
|
||||
|
||||
struct subid_nss_ops {
|
||||
/*
|
||||
* nss_has_range: does a user own a given subid range
|
||||
*
|
||||
* @owner: username
|
||||
* @start: first subid in queried range
|
||||
* @count: number of subids in queried range
|
||||
* @idtype: subuid or subgid
|
||||
* @result: true if @owner has been allocated the subid range.
|
||||
*
|
||||
* returns success if the module was able to determine an answer (true or false),
|
||||
* else an error status.
|
||||
*/
|
||||
enum subid_status (*has_range)(const char *owner, unsigned long start, unsigned long count, enum subid_type idtype, bool *result);
|
||||
|
||||
/*
|
||||
* nss_list_owner_ranges: list the subid ranges delegated to a user.
|
||||
*
|
||||
* @owner - string representing username being queried
|
||||
* @id_type - subuid or subgid
|
||||
* @ranges - pointer to an array of struct subid_range, or NULL. The
|
||||
* returned array must be freed by the caller.
|
||||
* @count - pointer to an integer into which the number of returned ranges
|
||||
* is written.
|
||||
|
||||
* returns success if the module was able to determine an answer,
|
||||
* else an error status.
|
||||
*/
|
||||
enum subid_status (*list_owner_ranges)(const char *owner, enum subid_type id_type, struct subid_range **ranges, int *count);
|
||||
|
||||
/*
|
||||
* nss_find_subid_owners: find uids who own a given subuid or subgid.
|
||||
*
|
||||
* @id - the delegated id (subuid or subgid) being queried
|
||||
* @id_type - subuid or subgid
|
||||
* @uids - pointer to an array of uids which will be allocated by
|
||||
* nss_find_subid_owners()
|
||||
* @count - number of uids found
|
||||
*
|
||||
* returns success if the module was able to determine an answer,
|
||||
* else an error status.
|
||||
*/
|
||||
enum subid_status (*find_subid_owners)(unsigned long id, enum subid_type id_type, uid_t **uids, int *count);
|
||||
|
||||
/* The dlsym handle to close */
|
||||
void *handle;
|
||||
};
|
||||
|
||||
extern struct subid_nss_ops *get_subid_nss_handle();
|
||||
|
||||
|
||||
/* pam_pass_non_interactive.c */
|
||||
#ifdef USE_PAM
|
||||
extern int do_pam_passwd_non_interractive (const char *pam_service,
|
||||
extern int do_pam_passwd_non_interactive (const char *pam_service,
|
||||
const char *username,
|
||||
const char* password);
|
||||
#endif /* USE_PAM */
|
||||
@@ -271,6 +316,21 @@ extern void do_pam_passwd (const char *user, bool silent, bool change_expired);
|
||||
/* port.c */
|
||||
extern bool isttytime (const char *, const char *, time_t);
|
||||
|
||||
/* prefix_flag.c */
|
||||
extern const char* process_prefix_flag (const char* short_opt, int argc, char **argv);
|
||||
extern struct group *prefix_getgrnam(const char *name);
|
||||
extern struct group *prefix_getgrgid(gid_t gid);
|
||||
extern struct passwd *prefix_getpwuid(uid_t uid);
|
||||
extern struct passwd *prefix_getpwnam(const char* name);
|
||||
extern struct spwd *prefix_getspnam(const char* name);
|
||||
extern struct group *prefix_getgr_nam_gid(const char *grname);
|
||||
extern void prefix_setpwent();
|
||||
extern struct passwd* prefix_getpwent();
|
||||
extern void prefix_endpwent();
|
||||
extern void prefix_setgrent();
|
||||
extern struct group* prefix_getgrent();
|
||||
extern void prefix_endgrent();
|
||||
|
||||
/* pwd2spwd.c */
|
||||
#ifndef USE_PAM
|
||||
extern struct spwd *pwd_to_spwd (const struct passwd *);
|
||||
@@ -308,8 +368,10 @@ extern /*@observer@*/const char *crypt_make_salt (/*@null@*//*@observer@*/const
|
||||
|
||||
/* selinux.c */
|
||||
#ifdef WITH_SELINUX
|
||||
extern int set_selinux_file_context (const char *dst_name);
|
||||
extern int set_selinux_file_context (const char *dst_name, mode_t mode);
|
||||
extern void reset_selinux_handle (void);
|
||||
extern int reset_selinux_file_context (void);
|
||||
extern int check_selinux_permit (const char *perm_name);
|
||||
#endif
|
||||
|
||||
/* semanage.c */
|
||||
@@ -398,17 +460,19 @@ extern int set_filesize_limit (int blocks);
|
||||
extern int user_busy (const char *name, uid_t uid);
|
||||
|
||||
/* utmp.c */
|
||||
#ifndef USE_UTMPX
|
||||
extern /*@null@*/struct utmp *get_current_utmp (void);
|
||||
extern struct utmp *prepare_utmp (const char *name,
|
||||
const char *line,
|
||||
const char *host,
|
||||
/*@null@*/const struct utmp *ut);
|
||||
extern int setutmp (struct utmp *ut);
|
||||
#ifdef USE_UTMPX
|
||||
#else
|
||||
extern /*@null@*/struct utmpx *get_current_utmp (void);
|
||||
extern struct utmpx *prepare_utmpx (const char *name,
|
||||
const char *line,
|
||||
const char *host,
|
||||
/*@null@*/const struct utmp *ut);
|
||||
/*@null@*/const struct utmpx *ut);
|
||||
extern int setutmpx (struct utmpx *utx);
|
||||
#endif /* USE_UTMPX */
|
||||
|
||||
@@ -419,6 +483,7 @@ extern bool valid (const char *, const struct passwd *);
|
||||
extern /*@maynotreturn@*/ /*@only@*//*@out@*//*@notnull@*/char *xmalloc (size_t size)
|
||||
/*@ensures MaxSet(result) == (size - 1); @*/;
|
||||
extern /*@maynotreturn@*/ /*@only@*//*@notnull@*/char *xstrdup (const char *);
|
||||
extern void xfree(void *ap);
|
||||
|
||||
/* xgetpwnam.c */
|
||||
extern /*@null@*/ /*@only@*/struct passwd *xgetpwnam (const char *);
|
||||
|
||||
35
lib/pwauth.c
35
lib/pwauth.c
@@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 1992 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 2000, Marek Michałkiewicz
|
||||
* Copyright (c) 2003 - 2006, Tomasz Kłoczko
|
||||
* Copyright (c) 2008 - 2009, Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1992 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2003 - 2006, Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2008 - 2009, Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -127,7 +104,7 @@ int pw_auth (const char *cipher,
|
||||
#ifdef SKEY
|
||||
/*
|
||||
* If the user has an S/KEY entry show them the pertinent info
|
||||
* and then we can try validating the created cyphertext and the SKEY.
|
||||
* and then we can try validating the created ciphertext and the SKEY.
|
||||
* If there is no SKEY information we default to not using SKEY.
|
||||
*/
|
||||
|
||||
|
||||
33
lib/pwauth.h
33
lib/pwauth.h
@@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 1992 - 1993, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 1997, Marek Michałkiewicz
|
||||
* Copyright (c) 2003 - 2005, Tomasz Kłoczko
|
||||
* Copyright (c) 2009 , Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1992 - 1993, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 1997, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2009 , Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
38
lib/pwio.c
38
lib/pwio.c
@@ -1,34 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 1990 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 2000, Marek Michałkiewicz
|
||||
* Copyright (c) 2001 , Michał Moskal
|
||||
* Copyright (c) 2003 - 2005, Tomasz Kłoczko
|
||||
* Copyright (c) 2007 - 2009, Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2001 , Michał Moskal
|
||||
* SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2007 - 2009, Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -114,7 +91,8 @@ static struct commonio_db passwd_db = {
|
||||
false, /* changed */
|
||||
false, /* isopen */
|
||||
false, /* locked */
|
||||
false /* readonly */
|
||||
false, /* readonly */
|
||||
false /* setname */
|
||||
};
|
||||
|
||||
int pw_setdbname (const char *filename)
|
||||
|
||||
35
lib/pwio.h
35
lib/pwio.h
@@ -1,34 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 1990 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 2000, Marek Michałkiewicz
|
||||
* Copyright (c) 2005 , Michał Moskal
|
||||
* Copyright (c) 2005 , Tomasz Kłoczko
|
||||
* Copyright (c) 2008 , Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2005 , Michał Moskal
|
||||
* SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
53
lib/pwmem.c
53
lib/pwmem.c
@@ -1,34 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 1990 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 2000, Marek Michałkiewicz
|
||||
* Copyright (c) 2001 , Michał Moskal
|
||||
* Copyright (c) 2003 - 2005, Tomasz Kłoczko
|
||||
* Copyright (c) 2007 - 2013, Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2001 , Michał Moskal
|
||||
* SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2007 - 2013, Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -93,14 +70,16 @@
|
||||
|
||||
void pw_free (/*@out@*/ /*@only@*/struct passwd *pwent)
|
||||
{
|
||||
free (pwent->pw_name);
|
||||
if (pwent->pw_passwd) {
|
||||
memzero (pwent->pw_passwd, strlen (pwent->pw_passwd));
|
||||
free (pwent->pw_passwd);
|
||||
if (pwent != NULL) {
|
||||
free (pwent->pw_name);
|
||||
if (pwent->pw_passwd) {
|
||||
memzero (pwent->pw_passwd, strlen (pwent->pw_passwd));
|
||||
free (pwent->pw_passwd);
|
||||
}
|
||||
free (pwent->pw_gecos);
|
||||
free (pwent->pw_dir);
|
||||
free (pwent->pw_shell);
|
||||
free (pwent);
|
||||
}
|
||||
free (pwent->pw_gecos);
|
||||
free (pwent->pw_dir);
|
||||
free (pwent->pw_shell);
|
||||
free (pwent);
|
||||
}
|
||||
|
||||
|
||||
103
lib/run_part.c
Normal file
103
lib/run_part.c
Normal file
@@ -0,0 +1,103 @@
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
#include <lib/prototypes.h>
|
||||
#include "shadowlog_internal.h"
|
||||
|
||||
int run_part (char *script_path, char *name, char *action)
|
||||
{
|
||||
int pid;
|
||||
int wait_status;
|
||||
int pid_status;
|
||||
char *args[] = { script_path, NULL };
|
||||
|
||||
pid=fork();
|
||||
if (pid==-1) {
|
||||
perror ("Could not fork");
|
||||
return 1;
|
||||
}
|
||||
if (pid==0) {
|
||||
setenv ("ACTION",action,1);
|
||||
setenv ("SUBJECT",name,1);
|
||||
execv (script_path,args);
|
||||
perror ("execv");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
pid_status = wait (&wait_status);
|
||||
if (pid_status == pid) {
|
||||
return (wait_status);
|
||||
}
|
||||
|
||||
perror ("waitpid");
|
||||
return (1);
|
||||
}
|
||||
|
||||
int run_parts (char *directory, char *name, char *action)
|
||||
{
|
||||
struct dirent **namelist;
|
||||
int scanlist;
|
||||
int n;
|
||||
int execute_result;
|
||||
|
||||
scanlist = scandir (directory, &namelist, 0, alphasort);
|
||||
if (scanlist<0) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
for (n=0; n<scanlist; n++) {
|
||||
int path_length;
|
||||
struct stat sb;
|
||||
|
||||
path_length=strlen(directory) + strlen(namelist[n]->d_name) + 2;
|
||||
char *s = (char*)malloc(path_length);
|
||||
if (!s) {
|
||||
printf ("could not allocate memory\n");
|
||||
for (; n<scanlist; n++) {
|
||||
free (namelist[n]);
|
||||
}
|
||||
free (namelist);
|
||||
return (1);
|
||||
}
|
||||
snprintf (s, path_length, "%s/%s", directory, namelist[n]->d_name);
|
||||
|
||||
execute_result = 0;
|
||||
if (stat (s, &sb) == -1) {
|
||||
perror ("stat");
|
||||
free (s);
|
||||
for (; n<scanlist; n++) {
|
||||
free (namelist[n]);
|
||||
}
|
||||
free (namelist);
|
||||
return (1);
|
||||
}
|
||||
|
||||
if (S_ISREG (sb.st_mode) || S_ISLNK (sb.st_mode)) {
|
||||
execute_result = run_part (s, name, action);
|
||||
}
|
||||
|
||||
free (s);
|
||||
|
||||
if (execute_result!=0) {
|
||||
fprintf (shadow_logfd,
|
||||
"%s: did not exit cleanly.\n",
|
||||
namelist[n]->d_name);
|
||||
for (; n<scanlist; n++) {
|
||||
free (namelist[n]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
free (namelist[n]);
|
||||
}
|
||||
free (namelist);
|
||||
|
||||
return (execute_result);
|
||||
}
|
||||
|
||||
2
lib/run_part.h
Normal file
2
lib/run_part.h
Normal file
@@ -0,0 +1,2 @@
|
||||
int run_part (char *script_path, char *name, char *action);
|
||||
int run_parts (char *directory, char *name, char *action);
|
||||
183
lib/selinux.c
183
lib/selinux.c
@@ -1,44 +1,38 @@
|
||||
/*
|
||||
* Copyright (c) 2011 , Peter Vrabec <pvrabec@redhat.com>
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 2011 , Peter Vrabec <pvrabec@redhat.com>
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef WITH_SELINUX
|
||||
|
||||
#include <stdio.h>
|
||||
#include "defines.h"
|
||||
|
||||
#include <selinux/selinux.h>
|
||||
#include <selinux/label.h>
|
||||
#include "prototypes.h"
|
||||
|
||||
#include "shadowlog_internal.h"
|
||||
|
||||
static bool selinux_checked = false;
|
||||
static bool selinux_enabled;
|
||||
static /*@null@*/struct selabel_handle *selabel_hnd = NULL;
|
||||
|
||||
static void cleanup(void)
|
||||
{
|
||||
if (selabel_hnd) {
|
||||
selabel_close(selabel_hnd);
|
||||
selabel_hnd = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void reset_selinux_handle (void)
|
||||
{
|
||||
cleanup();
|
||||
}
|
||||
|
||||
/*
|
||||
* set_selinux_file_context - Set the security context before any file or
|
||||
@@ -50,10 +44,8 @@ static bool selinux_enabled;
|
||||
* Callers may have to Reset SELinux to create files with default
|
||||
* contexts with reset_selinux_file_context
|
||||
*/
|
||||
int set_selinux_file_context (const char *dst_name)
|
||||
int set_selinux_file_context (const char *dst_name, mode_t mode)
|
||||
{
|
||||
/*@null@*/security_context_t scontext = NULL;
|
||||
|
||||
if (!selinux_checked) {
|
||||
selinux_enabled = is_selinux_enabled () > 0;
|
||||
selinux_checked = true;
|
||||
@@ -61,18 +53,34 @@ int set_selinux_file_context (const char *dst_name)
|
||||
|
||||
if (selinux_enabled) {
|
||||
/* Get the default security context for this file */
|
||||
if (matchpathcon (dst_name, 0, &scontext) < 0) {
|
||||
if (security_getenforce () != 0) {
|
||||
return 1;
|
||||
|
||||
/*@null@*/char *fcontext_raw = NULL;
|
||||
int r;
|
||||
|
||||
if (selabel_hnd == NULL) {
|
||||
selabel_hnd = selabel_open(SELABEL_CTX_FILE, NULL, 0);
|
||||
if (selabel_hnd == NULL) {
|
||||
return security_getenforce () != 0;
|
||||
}
|
||||
(void) atexit(cleanup);
|
||||
}
|
||||
|
||||
r = selabel_lookup_raw(selabel_hnd, &fcontext_raw, dst_name, mode);
|
||||
if (r < 0) {
|
||||
/* No context specified for the searched path */
|
||||
if (errno == ENOENT) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return security_getenforce () != 0;
|
||||
}
|
||||
|
||||
/* Set the security context for the next created file */
|
||||
if (setfscreatecon (scontext) < 0) {
|
||||
if (security_getenforce () != 0) {
|
||||
return 1;
|
||||
}
|
||||
r = setfscreatecon_raw (fcontext_raw);
|
||||
freecon (fcontext_raw);
|
||||
if (r < 0) {
|
||||
return security_getenforce () != 0;
|
||||
}
|
||||
freecon (scontext);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -91,13 +99,112 @@ int reset_selinux_file_context (void)
|
||||
selinux_checked = true;
|
||||
}
|
||||
if (selinux_enabled) {
|
||||
if (setfscreatecon (NULL) != 0) {
|
||||
return 1;
|
||||
if (setfscreatecon_raw (NULL) != 0) {
|
||||
return security_getenforce () != 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Log callback for libselinux internal error reporting.
|
||||
*/
|
||||
__attribute__((__format__ (printf, 2, 3)))
|
||||
static int selinux_log_cb (int type, const char *fmt, ...) {
|
||||
va_list ap;
|
||||
char *buf;
|
||||
int r;
|
||||
#ifdef WITH_AUDIT
|
||||
static int selinux_audit_fd = -2;
|
||||
#endif
|
||||
|
||||
va_start (ap, fmt);
|
||||
r = vasprintf (&buf, fmt, ap);
|
||||
va_end (ap);
|
||||
|
||||
if (r < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef WITH_AUDIT
|
||||
if (-2 == selinux_audit_fd) {
|
||||
selinux_audit_fd = audit_open ();
|
||||
|
||||
if (-1 == selinux_audit_fd) {
|
||||
/* You get these only when the kernel doesn't have
|
||||
* audit compiled in. */
|
||||
if ( (errno != EINVAL)
|
||||
&& (errno != EPROTONOSUPPORT)
|
||||
&& (errno != EAFNOSUPPORT)) {
|
||||
|
||||
(void) fputs (_("Cannot open audit interface.\n"),
|
||||
shadow_logfd);
|
||||
SYSLOG ((LOG_WARN, "Cannot open audit interface."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (-1 != selinux_audit_fd) {
|
||||
if (SELINUX_AVC == type) {
|
||||
if (audit_log_user_avc_message (selinux_audit_fd,
|
||||
AUDIT_USER_AVC, buf, NULL, NULL,
|
||||
NULL, 0) > 0) {
|
||||
goto skip_syslog;
|
||||
}
|
||||
} else if (SELINUX_ERROR == type) {
|
||||
if (audit_log_user_avc_message (selinux_audit_fd,
|
||||
AUDIT_USER_SELINUX_ERR, buf, NULL, NULL,
|
||||
NULL, 0) > 0) {
|
||||
goto skip_syslog;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
SYSLOG ((LOG_WARN, "libselinux: %s", buf));
|
||||
|
||||
skip_syslog:
|
||||
free (buf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* check_selinux_permit - Check whether SELinux grants the given
|
||||
* operation
|
||||
*
|
||||
* Parameter is the SELinux permission name, e.g. rootok
|
||||
*
|
||||
* Returns 0 when permission is granted
|
||||
* or something failed but running in
|
||||
* permissive mode
|
||||
*/
|
||||
int check_selinux_permit (const char *perm_name)
|
||||
{
|
||||
char *user_context_raw;
|
||||
int r;
|
||||
|
||||
if (0 == is_selinux_enabled ()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
selinux_set_callback (SELINUX_CB_LOG, (union selinux_callback) selinux_log_cb);
|
||||
|
||||
if (getprevcon_raw (&user_context_raw) != 0) {
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: can not get previous SELinux process context: %s\n"),
|
||||
shadow_progname, strerror (errno));
|
||||
SYSLOG ((LOG_WARN,
|
||||
"can not get previous SELinux process context: %s",
|
||||
strerror (errno)));
|
||||
return (security_getenforce () != 0);
|
||||
}
|
||||
|
||||
r = selinux_check_access (user_context_raw, user_context_raw, "passwd", perm_name, NULL);
|
||||
freecon (user_context_raw);
|
||||
return r;
|
||||
}
|
||||
|
||||
#else /* !WITH_SELINUX */
|
||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
||||
#endif /* !WITH_SELINUX */
|
||||
|
||||
@@ -1,31 +1,8 @@
|
||||
/*
|
||||
* Copyright (c) 2010 , Jakub Hrozek <jhrozek@redhat.com>
|
||||
* Copyright (c) 2011 , Peter Vrabec <pvrabec@redhat.com>
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 2010 , Jakub Hrozek <jhrozek@redhat.com>
|
||||
* SPDX-FileCopyrightText: 2011 , Peter Vrabec <pvrabec@redhat.com>
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -43,6 +20,7 @@
|
||||
#include <semanage/semanage.h>
|
||||
#include "prototypes.h"
|
||||
|
||||
#include "shadowlog_internal.h"
|
||||
|
||||
#ifndef DEFAULT_SERANGE
|
||||
#define DEFAULT_SERANGE "s0"
|
||||
@@ -69,7 +47,7 @@ static void semanage_error_callback (unused void *varg,
|
||||
switch (semanage_msg_get_level (handle)) {
|
||||
case SEMANAGE_MSG_ERR:
|
||||
case SEMANAGE_MSG_WARN:
|
||||
fprintf (stderr, _("[libsemanage]: %s\n"), message);
|
||||
fprintf (shadow_logfd, _("[libsemanage]: %s\n"), message);
|
||||
break;
|
||||
case SEMANAGE_MSG_INFO:
|
||||
/* nop */
|
||||
@@ -87,7 +65,7 @@ static semanage_handle_t *semanage_init (void)
|
||||
|
||||
handle = semanage_handle_create ();
|
||||
if (NULL == handle) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("Cannot create SELinux management handle\n"));
|
||||
return NULL;
|
||||
}
|
||||
@@ -96,26 +74,26 @@ static semanage_handle_t *semanage_init (void)
|
||||
|
||||
ret = semanage_is_managed (handle);
|
||||
if (ret != 1) {
|
||||
fprintf (stderr, _("SELinux policy not managed\n"));
|
||||
fprintf (shadow_logfd, _("SELinux policy not managed\n"));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
ret = semanage_access_check (handle);
|
||||
if (ret < SEMANAGE_CAN_READ) {
|
||||
fprintf (stderr, _("Cannot read SELinux policy store\n"));
|
||||
fprintf (shadow_logfd, _("Cannot read SELinux policy store\n"));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
ret = semanage_connect (handle);
|
||||
if (ret != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("Cannot establish SELinux management connection\n"));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
ret = semanage_begin_transaction (handle);
|
||||
if (ret != 0) {
|
||||
fprintf (stderr, _("Cannot begin SELinux transaction\n"));
|
||||
fprintf (shadow_logfd, _("Cannot begin SELinux transaction\n"));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -137,7 +115,7 @@ static int semanage_user_mod (semanage_handle_t *handle,
|
||||
|
||||
semanage_seuser_query (handle, key, &seuser);
|
||||
if (NULL == seuser) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("Could not query seuser for %s\n"), login_name);
|
||||
ret = 1;
|
||||
goto done;
|
||||
@@ -145,7 +123,7 @@ static int semanage_user_mod (semanage_handle_t *handle,
|
||||
|
||||
ret = semanage_seuser_set_mlsrange (handle, seuser, DEFAULT_SERANGE);
|
||||
if (ret != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("Could not set serange for %s\n"), login_name);
|
||||
ret = 1;
|
||||
goto done;
|
||||
@@ -153,7 +131,7 @@ static int semanage_user_mod (semanage_handle_t *handle,
|
||||
|
||||
ret = semanage_seuser_set_sename (handle, seuser, seuser_name);
|
||||
if (ret != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("Could not set sename for %s\n"),
|
||||
login_name);
|
||||
ret = 1;
|
||||
@@ -162,7 +140,7 @@ static int semanage_user_mod (semanage_handle_t *handle,
|
||||
|
||||
ret = semanage_seuser_modify_local (handle, key, seuser);
|
||||
if (ret != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("Could not modify login mapping for %s\n"),
|
||||
login_name);
|
||||
ret = 1;
|
||||
@@ -186,7 +164,7 @@ static int semanage_user_add (semanage_handle_t *handle,
|
||||
|
||||
ret = semanage_seuser_create (handle, &seuser);
|
||||
if (ret != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("Cannot create SELinux login mapping for %s\n"),
|
||||
login_name);
|
||||
ret = 1;
|
||||
@@ -195,14 +173,14 @@ static int semanage_user_add (semanage_handle_t *handle,
|
||||
|
||||
ret = semanage_seuser_set_name (handle, seuser, login_name);
|
||||
if (ret != 0) {
|
||||
fprintf (stderr, _("Could not set name for %s\n"), login_name);
|
||||
fprintf (shadow_logfd, _("Could not set name for %s\n"), login_name);
|
||||
ret = 1;
|
||||
goto done;
|
||||
}
|
||||
|
||||
ret = semanage_seuser_set_mlsrange (handle, seuser, DEFAULT_SERANGE);
|
||||
if (ret != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("Could not set serange for %s\n"),
|
||||
login_name);
|
||||
ret = 1;
|
||||
@@ -211,7 +189,7 @@ static int semanage_user_add (semanage_handle_t *handle,
|
||||
|
||||
ret = semanage_seuser_set_sename (handle, seuser, seuser_name);
|
||||
if (ret != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("Could not set SELinux user for %s\n"),
|
||||
login_name);
|
||||
ret = 1;
|
||||
@@ -220,7 +198,7 @@ static int semanage_user_add (semanage_handle_t *handle,
|
||||
|
||||
ret = semanage_seuser_modify_local (handle, key, seuser);
|
||||
if (ret != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("Could not add login mapping for %s\n"),
|
||||
login_name);
|
||||
ret = 1;
|
||||
@@ -248,21 +226,21 @@ int set_seuser (const char *login_name, const char *seuser_name)
|
||||
|
||||
handle = semanage_init ();
|
||||
if (NULL == handle) {
|
||||
fprintf (stderr, _("Cannot init SELinux management\n"));
|
||||
fprintf (shadow_logfd, _("Cannot init SELinux management\n"));
|
||||
ret = 1;
|
||||
goto done;
|
||||
}
|
||||
|
||||
ret = semanage_seuser_key_create (handle, login_name, &key);
|
||||
if (ret != 0) {
|
||||
fprintf (stderr, _("Cannot create SELinux user key\n"));
|
||||
fprintf (shadow_logfd, _("Cannot create SELinux user key\n"));
|
||||
ret = 1;
|
||||
goto done;
|
||||
}
|
||||
|
||||
ret = semanage_seuser_exists (handle, key, &seuser_exists);
|
||||
if (ret < 0) {
|
||||
fprintf (stderr, _("Cannot verify the SELinux user\n"));
|
||||
fprintf (shadow_logfd, _("Cannot verify the SELinux user\n"));
|
||||
ret = 1;
|
||||
goto done;
|
||||
}
|
||||
@@ -270,7 +248,7 @@ int set_seuser (const char *login_name, const char *seuser_name)
|
||||
if (0 != seuser_exists) {
|
||||
ret = semanage_user_mod (handle, key, login_name, seuser_name);
|
||||
if (ret != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("Cannot modify SELinux user mapping\n"));
|
||||
ret = 1;
|
||||
goto done;
|
||||
@@ -278,7 +256,7 @@ int set_seuser (const char *login_name, const char *seuser_name)
|
||||
} else {
|
||||
ret = semanage_user_add (handle, key, login_name, seuser_name);
|
||||
if (ret != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("Cannot add SELinux user mapping\n"));
|
||||
ret = 1;
|
||||
goto done;
|
||||
@@ -287,12 +265,13 @@ int set_seuser (const char *login_name, const char *seuser_name)
|
||||
|
||||
ret = semanage_commit (handle);
|
||||
if (ret < 0) {
|
||||
fprintf (stderr, _("Cannot commit SELinux transaction\n"));
|
||||
fprintf (shadow_logfd, _("Cannot commit SELinux transaction\n"));
|
||||
ret = 1;
|
||||
goto done;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
reset_selinux_handle();
|
||||
|
||||
done:
|
||||
semanage_seuser_key_free (key);
|
||||
@@ -310,28 +289,28 @@ int del_seuser (const char *login_name)
|
||||
|
||||
handle = semanage_init ();
|
||||
if (NULL == handle) {
|
||||
fprintf (stderr, _("Cannot init SELinux management\n"));
|
||||
fprintf (shadow_logfd, _("Cannot init SELinux management\n"));
|
||||
ret = 1;
|
||||
goto done;
|
||||
}
|
||||
|
||||
ret = semanage_seuser_key_create (handle, login_name, &key);
|
||||
if (ret != 0) {
|
||||
fprintf (stderr, _("Cannot create SELinux user key\n"));
|
||||
fprintf (shadow_logfd, _("Cannot create SELinux user key\n"));
|
||||
ret = 1;
|
||||
goto done;
|
||||
}
|
||||
|
||||
ret = semanage_seuser_exists (handle, key, &exists);
|
||||
if (ret < 0) {
|
||||
fprintf (stderr, _("Cannot verify the SELinux user\n"));
|
||||
fprintf (shadow_logfd, _("Cannot verify the SELinux user\n"));
|
||||
ret = 1;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (0 == exists) {
|
||||
fprintf (stderr,
|
||||
_("Login mapping for %s is not defined, OK if default mapping was used\n"),
|
||||
fprintf (shadow_logfd,
|
||||
_("Login mapping for %s is not defined, OK if default mapping was used\n"),
|
||||
login_name);
|
||||
ret = 0; /* probably default mapping */
|
||||
goto done;
|
||||
@@ -339,14 +318,14 @@ int del_seuser (const char *login_name)
|
||||
|
||||
ret = semanage_seuser_exists_local (handle, key, &exists);
|
||||
if (ret < 0) {
|
||||
fprintf (stderr, _("Cannot verify the SELinux user\n"));
|
||||
fprintf (shadow_logfd, _("Cannot verify the SELinux user\n"));
|
||||
ret = 1;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (0 == exists) {
|
||||
fprintf (stderr,
|
||||
_("Login mapping for %s is defined in policy, cannot be deleted\n"),
|
||||
fprintf (shadow_logfd,
|
||||
_("Login mapping for %s is defined in policy, cannot be deleted\n"),
|
||||
login_name);
|
||||
ret = 0; /* Login mapping defined in policy can't be deleted */
|
||||
goto done;
|
||||
@@ -354,7 +333,7 @@ int del_seuser (const char *login_name)
|
||||
|
||||
ret = semanage_seuser_del_local (handle, key);
|
||||
if (ret != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("Could not delete login mapping for %s"),
|
||||
login_name);
|
||||
ret = 1;
|
||||
@@ -363,7 +342,7 @@ int del_seuser (const char *login_name)
|
||||
|
||||
ret = semanage_commit (handle);
|
||||
if (ret < 0) {
|
||||
fprintf (stderr, _("Cannot commit SELinux transaction\n"));
|
||||
fprintf (shadow_logfd, _("Cannot commit SELinux transaction\n"));
|
||||
ret = 1;
|
||||
goto done;
|
||||
}
|
||||
|
||||
@@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 1990 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 1998, Marek Michałkiewicz
|
||||
* Copyright (c) 2005 , Tomasz Kłoczko
|
||||
* Copyright (c) 2008 , Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -136,7 +113,7 @@ struct group *sgetgrent (const char *buf)
|
||||
cp++;
|
||||
}
|
||||
}
|
||||
if (i < (NFIELDS - 1) || *grpfields[2] == '\0') {
|
||||
if (i < (NFIELDS - 1) || *grpfields[2] == '\0' || cp != NULL) {
|
||||
return (struct group *) 0;
|
||||
}
|
||||
grent.gr_name = grpfields[0];
|
||||
|
||||
@@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 1989 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 1998, Marek Michałkiewicz
|
||||
* Copyright (c) 2003 - 2005, Tomasz Kłoczko
|
||||
* Copyright (c) 2008 , Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1989 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -90,6 +67,11 @@ struct passwd *sgetpwent (const char *buf)
|
||||
}
|
||||
}
|
||||
|
||||
/* something at the end, columns over shot */
|
||||
if ( cp != NULL ) {
|
||||
return( NULL );
|
||||
}
|
||||
|
||||
/*
|
||||
* There must be exactly NFIELDS colon separated fields or
|
||||
* the entry is invalid. Also, the UID and GID must be non-blank.
|
||||
|
||||
@@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 1989 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 1998, Marek Michałkiewicz
|
||||
* Copyright (c) 2003 - 2005, Tomasz Kłoczko
|
||||
* Copyright (c) 2009 , Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1989 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2009 , Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -52,7 +29,6 @@ struct spwd *sgetspent (const char *string)
|
||||
static struct spwd spwd;
|
||||
char *fields[FIELDS];
|
||||
char *cp;
|
||||
char *cpp;
|
||||
int i;
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,34 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 1990 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 2000, Marek Michałkiewicz
|
||||
* Copyright (c) 2001 , Michał Moskal
|
||||
* Copyright (c) 2005 , Tomasz Kłoczko
|
||||
* Copyright (c) 2007 - 2013, Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2001 , Michał Moskal
|
||||
* SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2007 - 2013, Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -40,6 +17,7 @@
|
||||
#include "prototypes.h"
|
||||
#include "defines.h"
|
||||
#include "commonio.h"
|
||||
#include "getdef.h"
|
||||
#include "sgroupio.h"
|
||||
|
||||
/*@null@*/ /*@only@*/struct sgrp *__sgr_dup (const struct sgrp *sgent)
|
||||
@@ -237,7 +215,8 @@ static struct commonio_db gshadow_db = {
|
||||
false, /* changed */
|
||||
false, /* isopen */
|
||||
false, /* locked */
|
||||
false /* readonly */
|
||||
false, /* readonly */
|
||||
false /* setname */
|
||||
};
|
||||
|
||||
int sgr_setdbname (const char *filename)
|
||||
|
||||
@@ -1,34 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 1990 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 2000, Marek Michałkiewicz
|
||||
* Copyright (c) 2001 , Michał Moskal
|
||||
* Copyright (c) 2005 , Tomasz Kłoczko
|
||||
* Copyright (c) 2008 , Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2001 , Michał Moskal
|
||||
* SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
36
lib/shadow.c
36
lib/shadow.c
@@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 1989 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 1998, Marek Michałkiewicz
|
||||
* Copyright (c) 2003 - 2005, Tomasz Kłoczko
|
||||
* Copyright (c) 2009 , Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1989 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2009 , Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -130,7 +107,6 @@ static struct spwd *my_sgetspent (const char *string)
|
||||
static struct spwd spwd;
|
||||
char *fields[FIELDS];
|
||||
char *cp;
|
||||
char *cpp;
|
||||
int i;
|
||||
|
||||
/*
|
||||
@@ -389,7 +365,6 @@ struct spwd *getspent (void)
|
||||
#ifdef USE_NIS
|
||||
int nis_1_user = 0;
|
||||
struct spwd *val;
|
||||
char buf[BUFSIZ];
|
||||
#endif
|
||||
if (NULL == shadow) {
|
||||
setspent ();
|
||||
@@ -484,7 +459,6 @@ struct spwd *getspnam (const char *name)
|
||||
struct spwd *sp;
|
||||
|
||||
#ifdef USE_NIS
|
||||
char buf[BUFSIZ];
|
||||
static char save_name[16];
|
||||
bool nis_disabled = false;
|
||||
#endif
|
||||
|
||||
@@ -1,34 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 1990 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 2000, Marek Michałkiewicz
|
||||
* Copyright (c) 2001 , Michał Moskal
|
||||
* Copyright (c) 2005 , Tomasz Kłoczko
|
||||
* Copyright (c) 2007 - 2009, Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2001 , Michał Moskal
|
||||
* SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2007 - 2009, Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -40,6 +17,7 @@
|
||||
#include <shadow.h>
|
||||
#include <stdio.h>
|
||||
#include "commonio.h"
|
||||
#include "getdef.h"
|
||||
#include "shadowio.h"
|
||||
#ifdef WITH_TCB
|
||||
#include <tcb.h>
|
||||
@@ -113,7 +91,8 @@ static struct commonio_db shadow_db = {
|
||||
false, /* changed */
|
||||
false, /* isopen */
|
||||
false, /* locked */
|
||||
false /* readonly */
|
||||
false, /* readonly */
|
||||
false /* setname */
|
||||
};
|
||||
|
||||
int spw_setdbname (const char *filename)
|
||||
|
||||
@@ -1,38 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 1990 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 2000, Marek Michałkiewicz
|
||||
* Copyright (c) 2001 - 2005, Tomasz Kłoczko
|
||||
* Copyright (c) 2008 , Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2001 - 2005, Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
#ifndef _SHADOWIO_H
|
||||
#define _SHADOWIO_H
|
||||
#ifndef SHADOWIO_H
|
||||
#define SHADOWIO_H
|
||||
|
||||
#include "defines.h"
|
||||
|
||||
|
||||
31
lib/shadowlog.c
Normal file
31
lib/shadowlog.c
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "shadowlog.h"
|
||||
|
||||
#include "lib/shadowlog_internal.h"
|
||||
|
||||
const char *shadow_progname = "libshadow";
|
||||
FILE *shadow_logfd = NULL;
|
||||
|
||||
void log_set_progname(const char *progname)
|
||||
{
|
||||
shadow_progname = progname;
|
||||
}
|
||||
|
||||
const char *log_get_progname(void)
|
||||
{
|
||||
return shadow_progname;
|
||||
}
|
||||
|
||||
void log_set_logfd(FILE *fd)
|
||||
{
|
||||
if (NULL != fd)
|
||||
shadow_logfd = fd;
|
||||
else
|
||||
shadow_logfd = stderr;
|
||||
}
|
||||
|
||||
FILE *log_get_logfd(void)
|
||||
{
|
||||
if (shadow_logfd != NULL)
|
||||
return shadow_logfd;
|
||||
return stderr;
|
||||
}
|
||||
41
lib/shadowlog.h
Normal file
41
lib/shadowlog.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (c) 2021 , Serge Hallyn
|
||||
* All rights reserved.
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
#ifndef _LOG_H
|
||||
#define _LOG_H
|
||||
#include <stdio.h>
|
||||
|
||||
extern void log_set_progname(const char *);
|
||||
extern const char *log_get_progname(void);
|
||||
extern void log_set_logfd(FILE *fd);
|
||||
extern FILE *log_get_logfd(void);
|
||||
extern void log_dolog(char *, ...);
|
||||
|
||||
#endif
|
||||
2
lib/shadowlog_internal.h
Normal file
2
lib/shadowlog_internal.h
Normal file
@@ -0,0 +1,2 @@
|
||||
extern const char *shadow_progname; /* Program name showed in error messages */
|
||||
extern FILE *shadow_logfd; /* file descripter to which error messages are printed */
|
||||
@@ -1,34 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 1990 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 2000, Marek Michałkiewicz
|
||||
* Copyright (c) 2001 , Michał Moskal
|
||||
* Copyright (c) 2005 , Tomasz Kłoczko
|
||||
* Copyright (c) 2007 - 2013, Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2001 , Michał Moskal
|
||||
* SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2007 - 2013, Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -79,11 +56,13 @@
|
||||
|
||||
void spw_free (/*@out@*/ /*@only@*/struct spwd *spent)
|
||||
{
|
||||
free (spent->sp_namp);
|
||||
if (NULL != spent->sp_pwdp) {
|
||||
memzero (spent->sp_pwdp, strlen (spent->sp_pwdp));
|
||||
free (spent->sp_pwdp);
|
||||
if (spent != NULL) {
|
||||
free (spent->sp_namp);
|
||||
if (NULL != spent->sp_pwdp) {
|
||||
memzero (spent->sp_pwdp, strlen (spent->sp_pwdp));
|
||||
free (spent->sp_pwdp);
|
||||
}
|
||||
free (spent);
|
||||
}
|
||||
free (spent);
|
||||
}
|
||||
|
||||
|
||||
47
lib/spawn.c
47
lib/spawn.c
@@ -1,30 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2011 , Jonathan Nieder
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 2011 , Jonathan Nieder
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -38,6 +15,8 @@
|
||||
#include "exitcodes.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
#include "shadowlog_internal.h"
|
||||
|
||||
int run_command (const char *cmd, const char *argv[],
|
||||
/*@null@*/const char *envp[], /*@out@*/int *status)
|
||||
{
|
||||
@@ -48,7 +27,7 @@ int run_command (const char *cmd, const char *argv[],
|
||||
}
|
||||
|
||||
(void) fflush (stdout);
|
||||
(void) fflush (stderr);
|
||||
(void) fflush (shadow_logfd);
|
||||
|
||||
pid = fork ();
|
||||
if (0 == pid) {
|
||||
@@ -57,23 +36,25 @@ int run_command (const char *cmd, const char *argv[],
|
||||
if (ENOENT == errno) {
|
||||
exit (E_CMD_NOTFOUND);
|
||||
}
|
||||
fprintf (stderr, "%s: cannot execute %s: %s\n",
|
||||
Prog, cmd, strerror (errno));
|
||||
fprintf (shadow_logfd, "%s: cannot execute %s: %s\n",
|
||||
shadow_progname, cmd, strerror (errno));
|
||||
exit (E_CMD_NOEXEC);
|
||||
} else if ((pid_t)-1 == pid) {
|
||||
fprintf (stderr, "%s: cannot execute %s: %s\n",
|
||||
Prog, cmd, strerror (errno));
|
||||
fprintf (shadow_logfd, "%s: cannot execute %s: %s\n",
|
||||
shadow_progname, cmd, strerror (errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
do {
|
||||
wpid = waitpid (pid, status, 0);
|
||||
if ((pid_t)-1 == wpid && errno == ECHILD)
|
||||
break;
|
||||
} while ( ((pid_t)-1 == wpid && errno == EINTR)
|
||||
|| (wpid != pid));
|
||||
|| ((pid_t)-1 != wpid && wpid != pid));
|
||||
|
||||
if ((pid_t)-1 == wpid) {
|
||||
fprintf (stderr, "%s: waitpid (status: %d): %s\n",
|
||||
Prog, *status, strerror (errno));
|
||||
fprintf (shadow_logfd, "%s: waitpid (status: %d): %s\n",
|
||||
shadow_progname, *status, strerror (errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
75
lib/sssd.c
Normal file
75
lib/sssd.c
Normal file
@@ -0,0 +1,75 @@
|
||||
/* Author: Peter Vrabec <pvrabec@redhat.com> */
|
||||
|
||||
#include <config.h>
|
||||
#ifdef USE_SSSD
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/types.h>
|
||||
#include "exitcodes.h"
|
||||
#include "defines.h"
|
||||
#include "prototypes.h"
|
||||
#include "sssd.h"
|
||||
|
||||
#include "shadowlog_internal.h"
|
||||
|
||||
#define MSG_SSSD_FLUSH_CACHE_FAILED "%s: Failed to flush the sssd cache."
|
||||
|
||||
int sssd_flush_cache (int dbflags)
|
||||
{
|
||||
int status, code, rv;
|
||||
const char *cmd = "/usr/sbin/sss_cache";
|
||||
char *sss_cache_args = NULL;
|
||||
const char *spawnedArgs[] = {"sss_cache", NULL, NULL};
|
||||
const char *spawnedEnv[] = {NULL};
|
||||
int i = 0;
|
||||
|
||||
sss_cache_args = malloc(4);
|
||||
if (sss_cache_args == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
sss_cache_args[i++] = '-';
|
||||
if (dbflags & SSSD_DB_PASSWD) {
|
||||
sss_cache_args[i++] = 'U';
|
||||
}
|
||||
if (dbflags & SSSD_DB_GROUP) {
|
||||
sss_cache_args[i++] = 'G';
|
||||
}
|
||||
sss_cache_args[i++] = '\0';
|
||||
if (i == 2) {
|
||||
/* Neither passwd nor group, nothing to do */
|
||||
free(sss_cache_args);
|
||||
return 0;
|
||||
}
|
||||
spawnedArgs[1] = sss_cache_args;
|
||||
|
||||
rv = run_command (cmd, spawnedArgs, spawnedEnv, &status);
|
||||
free(sss_cache_args);
|
||||
if (rv != 0) {
|
||||
/* run_command writes its own more detailed message. */
|
||||
SYSLOG ((LOG_WARN, MSG_SSSD_FLUSH_CACHE_FAILED, shadow_progname));
|
||||
return -1;
|
||||
}
|
||||
|
||||
code = WEXITSTATUS (status);
|
||||
if (!WIFEXITED (status)) {
|
||||
SYSLOG ((LOG_WARN, "%s: sss_cache did not terminate normally (signal %d)",
|
||||
shadow_progname, WTERMSIG (status)));
|
||||
return -1;
|
||||
} else if (code == E_CMD_NOTFOUND) {
|
||||
/* sss_cache is not installed, or it is installed but uses an
|
||||
interpreter that is missing. Probably the former. */
|
||||
return 0;
|
||||
} else if (code != 0) {
|
||||
SYSLOG ((LOG_WARN, "%s: sss_cache exited with status %d", shadow_progname, code));
|
||||
SYSLOG ((LOG_WARN, MSG_SSSD_FLUSH_CACHE_FAILED, shadow_progname));
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else /* USE_SSSD */
|
||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
||||
#endif /* USE_SSSD */
|
||||
|
||||
17
lib/sssd.h
Normal file
17
lib/sssd.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef _SSSD_H_
|
||||
#define _SSSD_H_
|
||||
|
||||
#define SSSD_DB_PASSWD 0x001
|
||||
#define SSSD_DB_GROUP 0x002
|
||||
|
||||
/*
|
||||
* sssd_flush_cache - flush specified service buffer in sssd cache
|
||||
*/
|
||||
#ifdef USE_SSSD
|
||||
extern int sssd_flush_cache (int dbflags);
|
||||
#else
|
||||
#define sssd_flush_cache(service) (0)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012 - Eric Biederman
|
||||
* SPDX-FileCopyrightText: 2012 - Eric Biederman
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -11,16 +11,11 @@
|
||||
#include <stdio.h>
|
||||
#include "commonio.h"
|
||||
#include "subordinateio.h"
|
||||
#include "../libsubid/subid.h"
|
||||
#include <sys/types.h>
|
||||
#include <pwd.h>
|
||||
|
||||
struct subordinate_range {
|
||||
const char *owner;
|
||||
unsigned long start;
|
||||
unsigned long count;
|
||||
};
|
||||
|
||||
#define NFIELDS 3
|
||||
#include <ctype.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
/*
|
||||
* subordinate_dup: create a duplicate range
|
||||
@@ -58,7 +53,7 @@ static /*@null@*/ /*@only@*/void *subordinate_dup (const void *ent)
|
||||
static void subordinate_free (/*@out@*/ /*@only@*/void *ent)
|
||||
{
|
||||
struct subordinate_range *rangeent = ent;
|
||||
|
||||
|
||||
free ((void *)(rangeent->owner));
|
||||
free (rangeent);
|
||||
}
|
||||
@@ -78,7 +73,7 @@ static void *subordinate_parse (const char *line)
|
||||
static char rangebuf[1024];
|
||||
int i;
|
||||
char *cp;
|
||||
char *fields[NFIELDS];
|
||||
char *fields[SUBID_NFIELDS];
|
||||
|
||||
/*
|
||||
* Copy the string to a temporary buffer so the substrings can
|
||||
@@ -93,7 +88,7 @@ static void *subordinate_parse (const char *line)
|
||||
* field. The fields are converted into NUL terminated strings.
|
||||
*/
|
||||
|
||||
for (cp = rangebuf, i = 0; (i < NFIELDS) && (NULL != cp); i++) {
|
||||
for (cp = rangebuf, i = 0; (i < SUBID_NFIELDS) && (NULL != cp); i++) {
|
||||
fields[i] = cp;
|
||||
while (('\0' != *cp) && (':' != *cp)) {
|
||||
cp++;
|
||||
@@ -108,10 +103,10 @@ static void *subordinate_parse (const char *line)
|
||||
}
|
||||
|
||||
/*
|
||||
* There must be exactly NFIELDS colon separated fields or
|
||||
* There must be exactly SUBID_NFIELDS colon separated fields or
|
||||
* the entry is invalid. Also, fields must be non-blank.
|
||||
*/
|
||||
if (i != NFIELDS || *fields[0] == '\0' || *fields[1] == '\0' || *fields[2] == '\0')
|
||||
if (i != SUBID_NFIELDS || *fields[0] == '\0' || *fields[1] == '\0' || *fields[2] == '\0')
|
||||
return NULL;
|
||||
range.owner = fields[0];
|
||||
if (getulong (fields[1], &range.start) == 0)
|
||||
@@ -152,11 +147,6 @@ static struct commonio_ops subordinate_ops = {
|
||||
NULL, /* close_hook */
|
||||
};
|
||||
|
||||
static /*@observer@*/ /*@null*/const struct subordinate_range *subordinate_next(struct commonio_db *db)
|
||||
{
|
||||
return (const struct subordinate_range *)commonio_next (db);
|
||||
}
|
||||
|
||||
/*
|
||||
* range_exists: Check whether @owner owns any ranges
|
||||
*
|
||||
@@ -181,7 +171,7 @@ static const bool range_exists(struct commonio_db *db, const char *owner)
|
||||
* subuid @val.
|
||||
*
|
||||
* @db: database to query
|
||||
* @owner: owning uid being queuried
|
||||
* @owner: owning uid being queried
|
||||
* @val: subuid being searched for.
|
||||
*
|
||||
* Returns a range of subuids belonging to @owner and including the subuid
|
||||
@@ -221,7 +211,7 @@ static const struct subordinate_range *find_range(struct commonio_db *db,
|
||||
|
||||
/*
|
||||
* Search loop above did not produce any result. Let's rerun it,
|
||||
* but this time try to matcha actual UIDs. The first entry that
|
||||
* but this time try to match actual UIDs. The first entry that
|
||||
* matches is considered a success.
|
||||
* (It may be specified as literal UID or as another username which
|
||||
* has the same UID as the username we are looking for.)
|
||||
@@ -234,7 +224,7 @@ static const struct subordinate_range *find_range(struct commonio_db *db,
|
||||
/* Get UID of the username we are looking for */
|
||||
pwd = getpwnam(owner);
|
||||
if (NULL == pwd) {
|
||||
/* Username not defined in /etc/passwd, or error occured during lookup */
|
||||
/* Username not defined in /etc/passwd, or error occurred during lookup */
|
||||
return NULL;
|
||||
}
|
||||
owner_uid = pwd->pw_uid;
|
||||
@@ -306,7 +296,7 @@ static bool have_range(struct commonio_db *db,
|
||||
end = start + count - 1;
|
||||
range = find_range (db, owner, start);
|
||||
while (range) {
|
||||
unsigned long last;
|
||||
unsigned long last;
|
||||
|
||||
last = range->start + range->count - 1;
|
||||
if (last >= (start + count - 1))
|
||||
@@ -319,6 +309,35 @@ static bool have_range(struct commonio_db *db,
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool append_range(struct subid_range **ranges, const struct subordinate_range *new, int n)
|
||||
{
|
||||
if (!*ranges) {
|
||||
*ranges = malloc(sizeof(struct subid_range));
|
||||
if (!*ranges)
|
||||
return false;
|
||||
} else {
|
||||
struct subid_range *alloced;
|
||||
alloced = realloc(*ranges, (n + 1) * (sizeof(struct subid_range)));
|
||||
if (!alloced)
|
||||
return false;
|
||||
*ranges = alloced;
|
||||
}
|
||||
(*ranges)[n].start = new->start;
|
||||
(*ranges)[n].count = new->count;
|
||||
return true;
|
||||
}
|
||||
|
||||
void free_subordinate_ranges(struct subordinate_range **ranges, int count)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!ranges)
|
||||
return;
|
||||
for (i = 0; i < count; i++)
|
||||
subordinate_free(ranges[i]);
|
||||
free(ranges);
|
||||
}
|
||||
|
||||
/*
|
||||
* subordinate_range_cmp: compare uid ranges
|
||||
*
|
||||
@@ -418,7 +437,7 @@ fail:
|
||||
* @start: the first uid in the owned range
|
||||
* @count: the number of uids in the range
|
||||
*
|
||||
* Return 1 if the range is already present or on succcess. On error
|
||||
* Return 1 if the range is already present or on success. On error
|
||||
* return 0 and set errno appropriately.
|
||||
*/
|
||||
static int add_range(struct commonio_db *db,
|
||||
@@ -550,7 +569,8 @@ static struct commonio_db subordinate_uid_db = {
|
||||
false, /* changed */
|
||||
false, /* isopen */
|
||||
false, /* locked */
|
||||
false /* readonly */
|
||||
false, /* readonly */
|
||||
false /* setname */
|
||||
};
|
||||
|
||||
int sub_uid_setdbname (const char *filename)
|
||||
@@ -578,23 +598,37 @@ int sub_uid_open (int mode)
|
||||
return commonio_open (&subordinate_uid_db, mode);
|
||||
}
|
||||
|
||||
bool sub_uid_assigned(const char *owner)
|
||||
bool local_sub_uid_assigned(const char *owner)
|
||||
{
|
||||
return range_exists (&subordinate_uid_db, owner);
|
||||
}
|
||||
|
||||
bool have_sub_uids(const char *owner, uid_t start, unsigned long count)
|
||||
{
|
||||
struct subid_nss_ops *h;
|
||||
bool found;
|
||||
enum subid_status status;
|
||||
h = get_subid_nss_handle();
|
||||
if (h) {
|
||||
status = h->has_range(owner, start, count, ID_TYPE_UID, &found);
|
||||
if (status == SUBID_STATUS_SUCCESS && found)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
return have_range (&subordinate_uid_db, owner, start, count);
|
||||
}
|
||||
|
||||
int sub_uid_add (const char *owner, uid_t start, unsigned long count)
|
||||
{
|
||||
if (get_subid_nss_handle())
|
||||
return -EOPNOTSUPP;
|
||||
return add_range (&subordinate_uid_db, owner, start, count);
|
||||
}
|
||||
|
||||
int sub_uid_remove (const char *owner, uid_t start, unsigned long count)
|
||||
{
|
||||
if (get_subid_nss_handle())
|
||||
return -EOPNOTSUPP;
|
||||
return remove_range (&subordinate_uid_db, owner, start, count);
|
||||
}
|
||||
|
||||
@@ -631,7 +665,8 @@ static struct commonio_db subordinate_gid_db = {
|
||||
false, /* changed */
|
||||
false, /* isopen */
|
||||
false, /* locked */
|
||||
false /* readonly */
|
||||
false, /* readonly */
|
||||
false /* setname */
|
||||
};
|
||||
|
||||
int sub_gid_setdbname (const char *filename)
|
||||
@@ -661,21 +696,35 @@ int sub_gid_open (int mode)
|
||||
|
||||
bool have_sub_gids(const char *owner, gid_t start, unsigned long count)
|
||||
{
|
||||
struct subid_nss_ops *h;
|
||||
bool found;
|
||||
enum subid_status status;
|
||||
h = get_subid_nss_handle();
|
||||
if (h) {
|
||||
status = h->has_range(owner, start, count, ID_TYPE_GID, &found);
|
||||
if (status == SUBID_STATUS_SUCCESS && found)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
return have_range(&subordinate_gid_db, owner, start, count);
|
||||
}
|
||||
|
||||
bool sub_gid_assigned(const char *owner)
|
||||
bool local_sub_gid_assigned(const char *owner)
|
||||
{
|
||||
return range_exists (&subordinate_gid_db, owner);
|
||||
}
|
||||
|
||||
int sub_gid_add (const char *owner, gid_t start, unsigned long count)
|
||||
{
|
||||
if (get_subid_nss_handle())
|
||||
return -EOPNOTSUPP;
|
||||
return add_range (&subordinate_gid_db, owner, start, count);
|
||||
}
|
||||
|
||||
int sub_gid_remove (const char *owner, gid_t start, unsigned long count)
|
||||
{
|
||||
if (get_subid_nss_handle())
|
||||
return -EOPNOTSUPP;
|
||||
return remove_range (&subordinate_gid_db, owner, start, count);
|
||||
}
|
||||
|
||||
@@ -695,6 +744,308 @@ gid_t sub_gid_find_free_range(gid_t min, gid_t max, unsigned long count)
|
||||
start = find_free_range (&subordinate_gid_db, min, max, count);
|
||||
return start == ULONG_MAX ? (gid_t) -1 : start;
|
||||
}
|
||||
|
||||
/*
|
||||
* int list_owner_ranges(const char *owner, enum subid_type id_type, struct subordinate_range ***ranges)
|
||||
*
|
||||
* @owner: username
|
||||
* @id_type: UID or GUID
|
||||
* @ranges: pointer to array of ranges into which results will be placed.
|
||||
*
|
||||
* Fills in the subuid or subgid ranges which are owned by the specified
|
||||
* user. Username may be a username or a string representation of a
|
||||
* UID number. If id_type is UID, then subuids are returned, else
|
||||
* subgids are given.
|
||||
|
||||
* Returns the number of ranges found, or < 0 on error.
|
||||
*
|
||||
* The caller must free the subordinate range list.
|
||||
*/
|
||||
int list_owner_ranges(const char *owner, enum subid_type id_type, struct subid_range **in_ranges)
|
||||
{
|
||||
// TODO - need to handle owner being either uid or username
|
||||
struct subid_range *ranges = NULL;
|
||||
const struct subordinate_range *range;
|
||||
struct commonio_db *db;
|
||||
enum subid_status status;
|
||||
int count = 0;
|
||||
struct subid_nss_ops *h;
|
||||
|
||||
*in_ranges = NULL;
|
||||
|
||||
h = get_subid_nss_handle();
|
||||
if (h) {
|
||||
status = h->list_owner_ranges(owner, id_type, in_ranges, &count);
|
||||
if (status == SUBID_STATUS_SUCCESS)
|
||||
return count;
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch (id_type) {
|
||||
case ID_TYPE_UID:
|
||||
if (!sub_uid_open(O_RDONLY)) {
|
||||
return -1;
|
||||
}
|
||||
db = &subordinate_uid_db;
|
||||
break;
|
||||
case ID_TYPE_GID:
|
||||
if (!sub_gid_open(O_RDONLY)) {
|
||||
return -1;
|
||||
}
|
||||
db = &subordinate_gid_db;
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
||||
commonio_rewind(db);
|
||||
while ((range = commonio_next(db)) != NULL) {
|
||||
if (0 == strcmp(range->owner, owner)) {
|
||||
if (!append_range(&ranges, range, count++)) {
|
||||
free(ranges);
|
||||
ranges = NULL;
|
||||
count = -1;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
if (id_type == ID_TYPE_UID)
|
||||
sub_uid_close();
|
||||
else
|
||||
sub_gid_close();
|
||||
|
||||
*in_ranges = ranges;
|
||||
return count;
|
||||
}
|
||||
|
||||
static bool all_digits(const char *str)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; str[i] != '\0'; i++)
|
||||
if (!isdigit(str[i]))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
static int append_uids(uid_t **uids, const char *owner, int n)
|
||||
{
|
||||
uid_t owner_uid;
|
||||
uid_t *ret;
|
||||
int i;
|
||||
|
||||
if (all_digits(owner)) {
|
||||
i = sscanf(owner, "%d", &owner_uid);
|
||||
if (i != 1) {
|
||||
// should not happen
|
||||
free(*uids);
|
||||
*uids = NULL;
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
struct passwd *pwd = getpwnam(owner);
|
||||
if (NULL == pwd) {
|
||||
/* Username not defined in /etc/passwd, or error occurred during lookup */
|
||||
free(*uids);
|
||||
*uids = NULL;
|
||||
return -1;
|
||||
}
|
||||
owner_uid = pwd->pw_uid;
|
||||
}
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
if (owner_uid == (*uids)[i])
|
||||
return n;
|
||||
}
|
||||
|
||||
ret = realloc(*uids, (n + 1) * sizeof(uid_t));
|
||||
if (!ret) {
|
||||
free(*uids);
|
||||
return -1;
|
||||
}
|
||||
ret[n] = owner_uid;
|
||||
*uids = ret;
|
||||
return n+1;
|
||||
}
|
||||
|
||||
int find_subid_owners(unsigned long id, enum subid_type id_type, uid_t **uids)
|
||||
{
|
||||
const struct subordinate_range *range;
|
||||
struct subid_nss_ops *h;
|
||||
enum subid_status status;
|
||||
struct commonio_db *db;
|
||||
int n = 0;
|
||||
|
||||
h = get_subid_nss_handle();
|
||||
if (h) {
|
||||
status = h->find_subid_owners(id, id_type, uids, &n);
|
||||
// Several ways we could handle the error cases here.
|
||||
if (status != SUBID_STATUS_SUCCESS)
|
||||
return -1;
|
||||
return n;
|
||||
}
|
||||
|
||||
switch (id_type) {
|
||||
case ID_TYPE_UID:
|
||||
if (!sub_uid_open(O_RDONLY)) {
|
||||
return -1;
|
||||
}
|
||||
db = &subordinate_uid_db;
|
||||
break;
|
||||
case ID_TYPE_GID:
|
||||
if (!sub_gid_open(O_RDONLY)) {
|
||||
return -1;
|
||||
}
|
||||
db = &subordinate_gid_db;
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
||||
*uids = NULL;
|
||||
|
||||
commonio_rewind(db);
|
||||
while ((range = commonio_next(db)) != NULL) {
|
||||
if (id >= range->start && id < range->start + range-> count) {
|
||||
n = append_uids(uids, range->owner, n);
|
||||
if (n < 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (id_type == ID_TYPE_UID)
|
||||
sub_uid_close();
|
||||
else
|
||||
sub_gid_close();
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
bool new_subid_range(struct subordinate_range *range, enum subid_type id_type, bool reuse)
|
||||
{
|
||||
struct commonio_db *db;
|
||||
const struct subordinate_range *r;
|
||||
bool ret;
|
||||
|
||||
if (get_subid_nss_handle())
|
||||
return false;
|
||||
|
||||
switch (id_type) {
|
||||
case ID_TYPE_UID:
|
||||
if (!sub_uid_lock()) {
|
||||
printf("Failed loging subuids (errno %d)\n", errno);
|
||||
return false;
|
||||
}
|
||||
if (!sub_uid_open(O_CREAT | O_RDWR)) {
|
||||
printf("Failed opening subuids (errno %d)\n", errno);
|
||||
sub_uid_unlock();
|
||||
return false;
|
||||
}
|
||||
db = &subordinate_uid_db;
|
||||
break;
|
||||
case ID_TYPE_GID:
|
||||
if (!sub_gid_lock()) {
|
||||
printf("Failed loging subgids (errno %d)\n", errno);
|
||||
return false;
|
||||
}
|
||||
if (!sub_gid_open(O_CREAT | O_RDWR)) {
|
||||
printf("Failed opening subgids (errno %d)\n", errno);
|
||||
sub_gid_unlock();
|
||||
return false;
|
||||
}
|
||||
db = &subordinate_gid_db;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
commonio_rewind(db);
|
||||
if (reuse) {
|
||||
while ((r = commonio_next(db)) != NULL) {
|
||||
// TODO account for username vs uid_t
|
||||
if (0 != strcmp(r->owner, range->owner))
|
||||
continue;
|
||||
if (r->count >= range->count) {
|
||||
range->count = r->count;
|
||||
range->start = r->start;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
range->start = find_free_range(db, range->start, ULONG_MAX, range->count);
|
||||
|
||||
if (range->start == ULONG_MAX) {
|
||||
ret = false;
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = add_range(db, range->owner, range->start, range->count) == 1;
|
||||
|
||||
out:
|
||||
if (id_type == ID_TYPE_UID) {
|
||||
sub_uid_close();
|
||||
sub_uid_unlock();
|
||||
} else {
|
||||
sub_gid_close();
|
||||
sub_gid_unlock();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool release_subid_range(struct subordinate_range *range, enum subid_type id_type)
|
||||
{
|
||||
struct commonio_db *db;
|
||||
bool ret;
|
||||
|
||||
if (get_subid_nss_handle())
|
||||
return false;
|
||||
|
||||
switch (id_type) {
|
||||
case ID_TYPE_UID:
|
||||
if (!sub_uid_lock()) {
|
||||
printf("Failed loging subuids (errno %d)\n", errno);
|
||||
return false;
|
||||
}
|
||||
if (!sub_uid_open(O_CREAT | O_RDWR)) {
|
||||
printf("Failed opening subuids (errno %d)\n", errno);
|
||||
sub_uid_unlock();
|
||||
return false;
|
||||
}
|
||||
db = &subordinate_uid_db;
|
||||
break;
|
||||
case ID_TYPE_GID:
|
||||
if (!sub_gid_lock()) {
|
||||
printf("Failed loging subgids (errno %d)\n", errno);
|
||||
return false;
|
||||
}
|
||||
if (!sub_gid_open(O_CREAT | O_RDWR)) {
|
||||
printf("Failed opening subgids (errno %d)\n", errno);
|
||||
sub_gid_unlock();
|
||||
return false;
|
||||
}
|
||||
db = &subordinate_gid_db;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
ret = remove_range(db, range->owner, range->start, range->count) == 1;
|
||||
|
||||
if (id_type == ID_TYPE_UID) {
|
||||
sub_uid_close();
|
||||
sub_uid_unlock();
|
||||
} else {
|
||||
sub_gid_close();
|
||||
sub_gid_unlock();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#else /* !ENABLE_SUBIDS */
|
||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
||||
#endif /* !ENABLE_SUBIDS */
|
||||
|
||||
@@ -11,10 +11,12 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "../libsubid/subid.h"
|
||||
|
||||
extern int sub_uid_close(void);
|
||||
extern bool have_sub_uids(const char *owner, uid_t start, unsigned long count);
|
||||
extern bool sub_uid_file_present (void);
|
||||
extern bool sub_uid_assigned(const char *owner);
|
||||
extern bool local_sub_uid_assigned(const char *owner);
|
||||
extern int sub_uid_lock (void);
|
||||
extern int sub_uid_setdbname (const char *filename);
|
||||
extern /*@observer@*/const char *sub_uid_dbname (void);
|
||||
@@ -23,11 +25,16 @@ extern int sub_uid_unlock (void);
|
||||
extern int sub_uid_add (const char *owner, uid_t start, unsigned long count);
|
||||
extern int sub_uid_remove (const char *owner, uid_t start, unsigned long count);
|
||||
extern uid_t sub_uid_find_free_range(uid_t min, uid_t max, unsigned long count);
|
||||
extern int list_owner_ranges(const char *owner, enum subid_type id_type, struct subid_range **ranges);
|
||||
extern bool new_subid_range(struct subordinate_range *range, enum subid_type id_type, bool reuse);
|
||||
extern bool release_subid_range(struct subordinate_range *range, enum subid_type id_type);
|
||||
extern int find_subid_owners(unsigned long id, enum subid_type id_type, uid_t **uids);
|
||||
extern void free_subordinate_ranges(struct subordinate_range **ranges, int count);
|
||||
|
||||
extern int sub_gid_close(void);
|
||||
extern bool have_sub_gids(const char *owner, gid_t start, unsigned long count);
|
||||
extern bool sub_gid_file_present (void);
|
||||
extern bool sub_gid_assigned(const char *owner);
|
||||
extern bool local_sub_gid_assigned(const char *owner);
|
||||
extern int sub_gid_lock (void);
|
||||
extern int sub_gid_setdbname (const char *filename);
|
||||
extern /*@observer@*/const char *sub_gid_dbname (void);
|
||||
|
||||
151
lib/tcbfuncs.c
151
lib/tcbfuncs.c
@@ -1,21 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2001 Rafal Wojtczuk, Solar Designer
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-FileCopyrightText: 2001 Rafal Wojtczuk, Solar Designer
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
@@ -38,6 +23,8 @@
|
||||
#include "shadowio.h"
|
||||
#include "tcbfuncs.h"
|
||||
|
||||
#include "shadowlog_internal.h"
|
||||
|
||||
#define SHADOWTCB_HASH_BY 1000
|
||||
#define SHADOWTCB_LOCK_SUFFIX ".lock"
|
||||
|
||||
@@ -72,8 +59,8 @@ shadowtcb_status shadowtcb_gain_priv (void)
|
||||
* to exit soon.
|
||||
*/
|
||||
#define OUT_OF_MEMORY do { \
|
||||
fprintf (stderr, _("%s: out of memory\n"), Prog); \
|
||||
(void) fflush (stderr); \
|
||||
fprintf (shadow_logfd, _("%s: out of memory\n"), shadow_progname); \
|
||||
(void) fflush (shadow_logfd); \
|
||||
} while (false)
|
||||
|
||||
/* Returns user's tcb directory path relative to TCB_DIR. */
|
||||
@@ -116,9 +103,9 @@ static /*@null@*/ char *shadowtcb_path_rel_existing (const char *name)
|
||||
return NULL;
|
||||
}
|
||||
if (lstat (path, &st) != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Cannot stat %s: %s\n"),
|
||||
Prog, path, strerror (errno));
|
||||
shadow_progname, path, strerror (errno));
|
||||
free (path);
|
||||
return NULL;
|
||||
}
|
||||
@@ -132,26 +119,26 @@ static /*@null@*/ char *shadowtcb_path_rel_existing (const char *name)
|
||||
return rval;
|
||||
}
|
||||
if (!S_ISLNK (st.st_mode)) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: %s is neither a directory, nor a symlink.\n"),
|
||||
Prog, path);
|
||||
shadow_progname, path);
|
||||
free (path);
|
||||
return NULL;
|
||||
}
|
||||
ret = readlink (path, link, sizeof (link) - 1);
|
||||
if (-1 == ret) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Cannot read symbolic link %s: %s\n"),
|
||||
Prog, path, strerror (errno));
|
||||
shadow_progname, path, strerror (errno));
|
||||
free (path);
|
||||
return NULL;
|
||||
}
|
||||
free (path);
|
||||
if ((size_t)ret >= sizeof(link) - 1) {
|
||||
link[sizeof(link) - 1] = '\0';
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Suspiciously long symlink: %s\n"),
|
||||
Prog, link);
|
||||
shadow_progname, link);
|
||||
return NULL;
|
||||
}
|
||||
link[(size_t)ret] = '\0';
|
||||
@@ -207,9 +194,9 @@ static shadowtcb_status mkdir_leading (const char *name, uid_t uid)
|
||||
}
|
||||
ptr = path;
|
||||
if (stat (TCB_DIR, &st) != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Cannot stat %s: %s\n"),
|
||||
Prog, TCB_DIR, strerror (errno));
|
||||
shadow_progname, TCB_DIR, strerror (errno));
|
||||
goto out_free_path;
|
||||
}
|
||||
while ((ind = strchr (ptr, '/'))) {
|
||||
@@ -219,21 +206,21 @@ static shadowtcb_status mkdir_leading (const char *name, uid_t uid)
|
||||
return SHADOWTCB_FAILURE;
|
||||
}
|
||||
if ((mkdir (dir, 0700) != 0) && (errno != EEXIST)) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Cannot create directory %s: %s\n"),
|
||||
Prog, dir, strerror (errno));
|
||||
shadow_progname, dir, strerror (errno));
|
||||
goto out_free_dir;
|
||||
}
|
||||
if (chown (dir, 0, st.st_gid) != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Cannot change owner of %s: %s\n"),
|
||||
Prog, dir, strerror (errno));
|
||||
shadow_progname, dir, strerror (errno));
|
||||
goto out_free_dir;
|
||||
}
|
||||
if (chmod (dir, 0711) != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Cannot change mode of %s: %s\n"),
|
||||
Prog, dir, strerror (errno));
|
||||
shadow_progname, dir, strerror (errno));
|
||||
goto out_free_dir;
|
||||
}
|
||||
free (dir);
|
||||
@@ -261,9 +248,9 @@ static shadowtcb_status unlink_suffs (const char *user)
|
||||
return SHADOWTCB_FAILURE;
|
||||
}
|
||||
if ((unlink (tmp) != 0) && (errno != ENOENT)) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: unlink: %s: %s\n"),
|
||||
Prog, tmp, strerror (errno));
|
||||
shadow_progname, tmp, strerror (errno));
|
||||
free (tmp);
|
||||
return SHADOWTCB_FAILURE;
|
||||
}
|
||||
@@ -286,9 +273,9 @@ static shadowtcb_status rmdir_leading (char *path)
|
||||
}
|
||||
if (rmdir (dir) != 0) {
|
||||
if (errno != ENOTEMPTY) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Cannot remove directory %s: %s\n"),
|
||||
Prog, dir, strerror (errno));
|
||||
shadow_progname, dir, strerror (errno));
|
||||
ret = SHADOWTCB_FAILURE;
|
||||
}
|
||||
free (dir);
|
||||
@@ -315,9 +302,9 @@ static shadowtcb_status move_dir (const char *user_newname, uid_t user_newid)
|
||||
goto out_free_nomem;
|
||||
}
|
||||
if (stat (olddir, &oldmode) != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Cannot stat %s: %s\n"),
|
||||
Prog, olddir, strerror (errno));
|
||||
shadow_progname, olddir, strerror (errno));
|
||||
goto out_free;
|
||||
}
|
||||
old_uid = oldmode.st_uid;
|
||||
@@ -342,18 +329,18 @@ static shadowtcb_status move_dir (const char *user_newname, uid_t user_newid)
|
||||
goto out_free;
|
||||
}
|
||||
if (rename (real_old_dir, real_new_dir) != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Cannot rename %s to %s: %s\n"),
|
||||
Prog, real_old_dir, real_new_dir, strerror (errno));
|
||||
shadow_progname, real_old_dir, real_new_dir, strerror (errno));
|
||||
goto out_free;
|
||||
}
|
||||
if (rmdir_leading (real_old_dir_rel) == SHADOWTCB_FAILURE) {
|
||||
goto out_free;
|
||||
}
|
||||
if ((unlink (olddir) != 0) && (errno != ENOENT)) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Cannot remove %s: %s\n"),
|
||||
Prog, olddir, strerror (errno));
|
||||
shadow_progname, olddir, strerror (errno));
|
||||
goto out_free;
|
||||
}
|
||||
if (asprintf (&newdir, TCB_DIR "/%s", user_newname) == -1) {
|
||||
@@ -365,9 +352,9 @@ static shadowtcb_status move_dir (const char *user_newname, uid_t user_newid)
|
||||
}
|
||||
if ( (strcmp (real_new_dir, newdir) != 0)
|
||||
&& (symlink (real_new_dir_rel, newdir) != 0)) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Cannot create symbolic link %s: %s\n"),
|
||||
Prog, real_new_dir_rel, strerror (errno));
|
||||
shadow_progname, real_new_dir_rel, strerror (errno));
|
||||
goto out_free;
|
||||
}
|
||||
ret = SHADOWTCB_SUCCESS;
|
||||
@@ -464,53 +451,53 @@ shadowtcb_status shadowtcb_move (/*@NULL@*/const char *user_newname, uid_t user_
|
||||
return SHADOWTCB_FAILURE;
|
||||
}
|
||||
if (stat (tcbdir, &dirmode) != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Cannot stat %s: %s\n"),
|
||||
Prog, tcbdir, strerror (errno));
|
||||
shadow_progname, tcbdir, strerror (errno));
|
||||
goto out_free;
|
||||
}
|
||||
if (chown (tcbdir, 0, 0) != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Cannot change owners of %s: %s\n"),
|
||||
Prog, tcbdir, strerror (errno));
|
||||
shadow_progname, tcbdir, strerror (errno));
|
||||
goto out_free;
|
||||
}
|
||||
if (chmod (tcbdir, 0700) != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Cannot change mode of %s: %s\n"),
|
||||
Prog, tcbdir, strerror (errno));
|
||||
shadow_progname, tcbdir, strerror (errno));
|
||||
goto out_free;
|
||||
}
|
||||
if (lstat (shadow, &filemode) != 0) {
|
||||
if (errno != ENOENT) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Cannot lstat %s: %s\n"),
|
||||
Prog, shadow, strerror (errno));
|
||||
shadow_progname, shadow, strerror (errno));
|
||||
goto out_free;
|
||||
}
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Warning, user %s has no tcb shadow file.\n"),
|
||||
Prog, user_newname);
|
||||
shadow_progname, user_newname);
|
||||
} else {
|
||||
if (!S_ISREG (filemode.st_mode) ||
|
||||
filemode.st_nlink != 1) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Emergency: %s's tcb shadow is not a "
|
||||
"regular file with st_nlink=1.\n"
|
||||
"The account is left locked.\n"),
|
||||
Prog, user_newname);
|
||||
shadow_progname, user_newname);
|
||||
goto out_free;
|
||||
}
|
||||
if (chown (shadow, user_newid, filemode.st_gid) != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Cannot change owner of %s: %s\n"),
|
||||
Prog, shadow, strerror (errno));
|
||||
shadow_progname, shadow, strerror (errno));
|
||||
goto out_free;
|
||||
}
|
||||
if (chmod (shadow, filemode.st_mode & 07777) != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Cannot change mode of %s: %s\n"),
|
||||
Prog, shadow, strerror (errno));
|
||||
shadow_progname, shadow, strerror (errno));
|
||||
goto out_free;
|
||||
}
|
||||
}
|
||||
@@ -518,9 +505,15 @@ shadowtcb_status shadowtcb_move (/*@NULL@*/const char *user_newname, uid_t user_
|
||||
goto out_free;
|
||||
}
|
||||
if (chown (tcbdir, user_newid, dirmode.st_gid) != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Cannot change owner of %s: %s\n"),
|
||||
Prog, tcbdir, strerror (errno));
|
||||
shadow_progname, tcbdir, strerror (errno));
|
||||
goto out_free;
|
||||
}
|
||||
if (chmod (tcbdir, dirmode.st_mode & 07777) != 0) {
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Cannot change mode of %s: %s\n"),
|
||||
shadow_progname, tcbdir, strerror (errno));
|
||||
goto out_free;
|
||||
}
|
||||
ret = SHADOWTCB_SUCCESS;
|
||||
@@ -543,9 +536,9 @@ shadowtcb_status shadowtcb_create (const char *name, uid_t uid)
|
||||
return SHADOWTCB_SUCCESS;
|
||||
}
|
||||
if (stat (TCB_DIR, &tcbdir_stat) != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Cannot stat %s: %s\n"),
|
||||
Prog, TCB_DIR, strerror (errno));
|
||||
shadow_progname, TCB_DIR, strerror (errno));
|
||||
return SHADOWTCB_FAILURE;
|
||||
}
|
||||
shadowgid = tcbdir_stat.st_gid;
|
||||
@@ -563,41 +556,41 @@ shadowtcb_status shadowtcb_create (const char *name, uid_t uid)
|
||||
return SHADOWTCB_FAILURE;
|
||||
}
|
||||
if (mkdir (dir, 0700) != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: mkdir: %s: %s\n"),
|
||||
Prog, dir, strerror (errno));
|
||||
shadow_progname, dir, strerror (errno));
|
||||
goto out_free;
|
||||
}
|
||||
fd = open (shadow, O_RDWR | O_CREAT | O_TRUNC, 0600);
|
||||
if (fd < 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Cannot open %s: %s\n"),
|
||||
Prog, shadow, strerror (errno));
|
||||
shadow_progname, shadow, strerror (errno));
|
||||
goto out_free;
|
||||
}
|
||||
close (fd);
|
||||
if (chown (shadow, 0, authgid) != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Cannot change owner of %s: %s\n"),
|
||||
Prog, shadow, strerror (errno));
|
||||
shadow_progname, shadow, strerror (errno));
|
||||
goto out_free;
|
||||
}
|
||||
if (chmod (shadow, (mode_t) ((authgid == shadowgid) ? 0600 : 0640)) != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Cannot change mode of %s: %s\n"),
|
||||
Prog, shadow, strerror (errno));
|
||||
shadow_progname, shadow, strerror (errno));
|
||||
goto out_free;
|
||||
}
|
||||
if (chown (dir, 0, authgid) != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Cannot change owner of %s: %s\n"),
|
||||
Prog, dir, strerror (errno));
|
||||
shadow_progname, dir, strerror (errno));
|
||||
goto out_free;
|
||||
}
|
||||
if (chmod (dir, (mode_t) ((authgid == shadowgid) ? 02700 : 02710)) != 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (shadow_logfd,
|
||||
_("%s: Cannot change mode of %s: %s\n"),
|
||||
Prog, dir, strerror (errno));
|
||||
shadow_progname, dir, strerror (errno));
|
||||
goto out_free;
|
||||
}
|
||||
if ( (shadowtcb_set_user (name) == SHADOWTCB_FAILURE)
|
||||
|
||||
31
lib/utent.c
31
lib/utent.c
@@ -1,32 +1,9 @@
|
||||
/*
|
||||
* Copyright (c) 1993 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 1998, Marek Michałkiewicz
|
||||
* Copyright (c) 2005 , Tomasz Kłoczko
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1993 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
|
||||
EXTRA_DIST = .indent.pro xgetXXbyYY.c
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/lib
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_srcdir) $(ECONF_CPPFLAGS)
|
||||
|
||||
noinst_LIBRARIES = libmisc.a
|
||||
noinst_LTLIBRARIES = libmisc.la
|
||||
|
||||
libmisc_a_SOURCES = \
|
||||
libmisc_la_SOURCES = \
|
||||
addgrps.c \
|
||||
age.c \
|
||||
audit_help.c \
|
||||
@@ -19,6 +19,7 @@ libmisc_a_SOURCES = \
|
||||
cleanup_user.c \
|
||||
console.c \
|
||||
copydir.c \
|
||||
date_to_str.c \
|
||||
entry.c \
|
||||
env.c \
|
||||
failure.c \
|
||||
@@ -31,6 +32,7 @@ libmisc_a_SOURCES = \
|
||||
getdate.y \
|
||||
getgr_nam_gid.c \
|
||||
getrange.c \
|
||||
gettime.c \
|
||||
hushed.c \
|
||||
idmapping.h \
|
||||
idmapping.c \
|
||||
@@ -43,7 +45,8 @@ libmisc_a_SOURCES = \
|
||||
myname.c \
|
||||
obscure.c \
|
||||
pam_pass.c \
|
||||
pam_pass_non_interractive.c \
|
||||
pam_pass_non_interactive.c \
|
||||
prefix_flag.c \
|
||||
pwd2spwd.c \
|
||||
pwdcheck.c \
|
||||
pwd_init.c \
|
||||
@@ -70,3 +73,8 @@ libmisc_a_SOURCES = \
|
||||
xgetspnam.c \
|
||||
xmalloc.c \
|
||||
yesno.c
|
||||
|
||||
if WITH_BTRFS
|
||||
libmisc_la_SOURCES += btrfs.c
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 1989 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 1998, Marek Michałkiewicz
|
||||
* Copyright (c) 2001 - 2006, Tomasz Kłoczko
|
||||
* Copyright (c) 2007 - 2009, Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1989 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2001 - 2006, Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2007 - 2009, Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -40,6 +17,7 @@
|
||||
#include <stdio.h>
|
||||
#include <grp.h>
|
||||
#include <errno.h>
|
||||
#include "shadowlog.h"
|
||||
|
||||
#ident "$Id$"
|
||||
|
||||
@@ -57,6 +35,8 @@ int add_groups (const char *list)
|
||||
bool added;
|
||||
char *token;
|
||||
char buf[1024];
|
||||
int ret;
|
||||
FILE *shadow_logfd = log_get_logfd();
|
||||
|
||||
if (strlen (list) >= sizeof (buf)) {
|
||||
errno = EINVAL;
|
||||
@@ -93,7 +73,7 @@ int add_groups (const char *list)
|
||||
|
||||
grp = getgrnam (token); /* local, no need for xgetgrnam */
|
||||
if (NULL == grp) {
|
||||
fprintf (stderr, _("Warning: unknown group %s\n"),
|
||||
fprintf (shadow_logfd, _("Warning: unknown group %s\n"),
|
||||
token);
|
||||
continue;
|
||||
}
|
||||
@@ -105,7 +85,7 @@ int add_groups (const char *list)
|
||||
}
|
||||
|
||||
if (ngroups >= sysconf (_SC_NGROUPS_MAX)) {
|
||||
fputs (_("Warning: too many groups\n"), stderr);
|
||||
fputs (_("Warning: too many groups\n"), shadow_logfd);
|
||||
break;
|
||||
}
|
||||
tmp = (gid_t *) realloc (grouplist, (size_t)(ngroups + 1) * sizeof (GETGROUPS_T));
|
||||
@@ -120,9 +100,12 @@ int add_groups (const char *list)
|
||||
}
|
||||
|
||||
if (added) {
|
||||
return setgroups ((size_t)ngroups, grouplist);
|
||||
ret = setgroups ((size_t)ngroups, grouplist);
|
||||
free (grouplist);
|
||||
return ret;
|
||||
}
|
||||
|
||||
free (grouplist);
|
||||
return 0;
|
||||
}
|
||||
#else /* HAVE_SETGROUPS && !USE_PAM */
|
||||
|
||||
@@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 1989 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 1998, Marek Michałkiewicz
|
||||
* Copyright (c) 2001 - 2006, Tomasz Kłoczko
|
||||
* Copyright (c) 2008 - 2009, Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1989 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2001 - 2006, Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2008 - 2009, Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -1,32 +1,9 @@
|
||||
/*
|
||||
* Copyright (c) 2005 , Red Hat, Inc.
|
||||
* Copyright (c) 2005 , Tomasz Kłoczko
|
||||
* Copyright (c) 2008 , Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 2005 , Red Hat, Inc.
|
||||
* SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -45,6 +22,7 @@
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include "prototypes.h"
|
||||
#include "shadowlog.h"
|
||||
int audit_fd;
|
||||
|
||||
void audit_help_open (void)
|
||||
@@ -59,7 +37,7 @@ void audit_help_open (void)
|
||||
return;
|
||||
}
|
||||
(void) fputs (_("Cannot open audit interface - aborting.\n"),
|
||||
stderr);
|
||||
log_get_logfd());
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
@@ -68,7 +46,7 @@ void audit_help_open (void)
|
||||
* This function will log a message to the audit system using a predefined
|
||||
* message format. Parameter usage is as follows:
|
||||
*
|
||||
* type - type of message: AUDIT_USER_CHAUTHTOK for changing any account
|
||||
* type - type of message: AUDIT_USER_CHAUTHTOK for changing any account
|
||||
* attributes.
|
||||
* pgname - program's name
|
||||
* op - operation. "adding user", "changing finger info", "deleting group"
|
||||
|
||||
@@ -1,32 +1,9 @@
|
||||
/*
|
||||
* Copyright (c) 1990 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 1997, Marek Michałkiewicz
|
||||
* Copyright (c) 2003 - 2005, Tomasz Kłoczko
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 1997, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
110
libmisc/btrfs.c
Normal file
110
libmisc/btrfs.c
Normal file
@@ -0,0 +1,110 @@
|
||||
#include <linux/btrfs_tree.h>
|
||||
#include <linux/magic.h>
|
||||
#include <sys/statfs.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "prototypes.h"
|
||||
|
||||
static bool path_exists(const char *p)
|
||||
{
|
||||
struct stat sb;
|
||||
|
||||
return stat(p, &sb) == 0;
|
||||
}
|
||||
|
||||
static const char *btrfs_cmd(void)
|
||||
{
|
||||
const char *btrfs_paths[] = {"/sbin/btrfs",
|
||||
"/bin/btrfs", "/usr/sbin/btrfs", "/usr/bin/btrfs", NULL};
|
||||
const char *p;
|
||||
int i;
|
||||
|
||||
for (i = 0, p = btrfs_paths[i]; p; i++, p = btrfs_paths[i])
|
||||
if (path_exists(p))
|
||||
return p;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int run_btrfs_subvolume_cmd(const char *subcmd, const char *arg1, const char *arg2)
|
||||
{
|
||||
int status = 0;
|
||||
const char *cmd = btrfs_cmd();
|
||||
const char *argv[] = {
|
||||
"btrfs",
|
||||
"subvolume",
|
||||
subcmd,
|
||||
arg1,
|
||||
arg2,
|
||||
NULL
|
||||
};
|
||||
|
||||
if (access(cmd, X_OK)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (run_command(cmd, argv, NULL, &status))
|
||||
return -1;
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
int btrfs_create_subvolume(const char *path)
|
||||
{
|
||||
return run_btrfs_subvolume_cmd("create", path, NULL);
|
||||
}
|
||||
|
||||
|
||||
int btrfs_remove_subvolume(const char *path)
|
||||
{
|
||||
return run_btrfs_subvolume_cmd("delete", "-C", path);
|
||||
}
|
||||
|
||||
|
||||
/* Adapted from btrfsprogs */
|
||||
/*
|
||||
* This intentionally duplicates btrfs_util_is_subvolume_fd() instead of opening
|
||||
* a file descriptor and calling it, because fstat() and fstatfs() don't accept
|
||||
* file descriptors opened with O_PATH on old kernels (before v3.6 and before
|
||||
* v3.12, respectively), but stat() and statfs() can be called on a path that
|
||||
* the user doesn't have read or write permissions to.
|
||||
*
|
||||
* returns:
|
||||
* 1 - btrfs subvolume
|
||||
* 0 - not btrfs subvolume
|
||||
* -1 - error
|
||||
*/
|
||||
int btrfs_is_subvolume(const char *path)
|
||||
{
|
||||
struct stat st;
|
||||
int ret;
|
||||
|
||||
ret = is_btrfs(path);
|
||||
if (ret <= 0)
|
||||
return ret;
|
||||
|
||||
ret = stat(path, &st);
|
||||
if (ret == -1)
|
||||
return -1;
|
||||
|
||||
if (st.st_ino != BTRFS_FIRST_FREE_OBJECTID || !S_ISDIR(st.st_mode)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* Adapted from btrfsprogs */
|
||||
int is_btrfs(const char *path)
|
||||
{
|
||||
struct statfs sfs;
|
||||
int ret;
|
||||
|
||||
ret = statfs(path, &sfs);
|
||||
if (ret == -1)
|
||||
return -1;
|
||||
|
||||
return sfs.f_type == BTRFS_SUPER_MAGIC;
|
||||
}
|
||||
|
||||
@@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 1990 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 2000, Marek Michałkiewicz
|
||||
* Copyright (c) 2001 - 2005, Tomasz Kłoczko
|
||||
* Copyright (c) 2005 - 2008, Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2001 - 2005, Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2005 - 2008, Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -46,11 +23,18 @@
|
||||
#include "defines.h"
|
||||
#include "chkname.h"
|
||||
|
||||
int allow_bad_names = false;
|
||||
|
||||
static bool is_valid_name (const char *name)
|
||||
{
|
||||
if (allow_bad_names) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* User/group names must match [a-z_][a-z0-9_-]*[$]
|
||||
*/
|
||||
|
||||
if (('\0' == *name) ||
|
||||
!((('a' <= *name) && ('z' >= *name)) || ('_' == *name))) {
|
||||
return false;
|
||||
|
||||
@@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 1990 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1997 - 2000, Marek Michałkiewicz
|
||||
* Copyright (c) 2005 , Tomasz Kłoczko
|
||||
* Copyright (c) 2008 , Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1997 - 2000, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
@@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 1992 - 1993, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 2000, Marek Michałkiewicz
|
||||
* Copyright (c) 2003 - 2005, Tomasz Kłoczko
|
||||
* Copyright (c) 2010 - , Nicolas François
|
||||
* All rights reserved.
|
||||
* SPDX-FileCopyrightText: 1992 - 1993, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2010 - , Nicolas François
|
||||
*
|
||||
* 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. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||
* HOLDERS 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.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user