# HG changeset patch # User Timo Sirainen # Date 1061932696 -10800 # Node ID 9df02b1533b3b1346c5552f6cee3bd9e4617ac9e # Parent 219b6e9e82f131787fad9ddd712adc3d287a6620 Removed most of the license comments from src/lib/*.c. It's just fine to keep them in a single COPYING.MIT file. Changed a few other comments as well. diff -r 219b6e9e82f1 -r 9df02b1533b3 COPYING --- a/COPYING Wed Aug 27 00:06:44 2003 +0300 +++ b/COPYING Wed Aug 27 00:18:16 2003 +0300 @@ -1,7 +1,10 @@ -Everything is LGPLv2.1 (see COPYING.LGPL) unless otherwise mentioned at the -beginning of the file. Almost everything in src/lib/ is with MIT license. +Everything in src/lib/ is under MIT license (see COPYING.MIT) unless +otherwise mentioned at the beginning of the file. -The exceptions are: +Everything else is LGPLv2.1 (see COPYING.LGPL) unless otherwise mentioned +at the beginning of the file. + +Current exceptions are: src/lib/ - md5.c : Public Domain diff -r 219b6e9e82f1 -r 9df02b1533b3 COPYING.MIT --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/COPYING.MIT Wed Aug 27 00:18:16 2003 +0300 @@ -0,0 +1,17 @@ +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/alarm-hup.c --- a/src/lib/alarm-hup.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/alarm-hup.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - alarm-hup.c - Send SIGHUP once in a while to avoid infinitely blocking calls - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "alarm-hup.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/buffer.c --- a/src/lib/buffer.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/buffer.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,25 +1,4 @@ -/* - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ /* @UNSAFE: whole file */ diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/compat.c --- a/src/lib/compat.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/compat.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - compat.c : Compatibility functions for OSes not having them - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/data-stack.c --- a/src/lib/data-stack.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/data-stack.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - data-stack.c : Data stack implementation - - Copyright (c) 2001-2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ /* @UNSAFE: whole file */ diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/env-util.c --- a/src/lib/env-util.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/env-util.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - env-util.c : Environment variable handling - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "env-util.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/failures.c --- a/src/lib/failures.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/failures.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,28 +1,4 @@ -/* - failures.c : Failure manager - - Copyright (c) 2001-2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "fd-close-on-exec.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/fd-close-on-exec.c --- a/src/lib/fd-close-on-exec.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/fd-close-on-exec.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,25 +1,4 @@ -/* - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "network.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/file-lock.c --- a/src/lib/file-lock.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/file-lock.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - file-lock.c - Simple way to lock whole file descriptor - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "alarm-hup.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/file-set-size.c --- a/src/lib/file-set-size.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/file-set-size.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - file-set-size.c - portable way to grow/shrink file size - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "write-full.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/hash.c --- a/src/lib/hash.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/hash.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,25 +1,4 @@ -/* - Copyright (c) 2003 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ /* @UNSAFE: whole file */ diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/hex-binary.c --- a/src/lib/hex-binary.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/hex-binary.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - hex-binary.c : hex translations - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "buffer.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/hostpid.c --- a/src/lib/hostpid.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/hostpid.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - hostpid.c : Easy way to get our own hostname and pid - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "hostpid.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/imem.c --- a/src/lib/imem.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/imem.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - imem.c : Wrappers for allocating memory from default memory pool - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/ioloop-poll.c --- a/src/lib/ioloop-poll.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/ioloop-poll.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - ioloop-poll.c : I/O loop handler using poll() - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ /* @UNSAFE: whole file */ diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/ioloop-select.c --- a/src/lib/ioloop-select.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/ioloop-select.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - ioloop-select.c : I/O loop handler using select() - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "ioloop-internal.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/ioloop.c --- a/src/lib/ioloop.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/ioloop.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - ioloop.c : I/O loop - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "ioloop-internal.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/iostream.c --- a/src/lib/iostream.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/iostream.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - iostream.c : Input/output stream common handling - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "iostream-internal.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/istream-data.c --- a/src/lib/istream-data.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/istream-data.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - istream-data.c : Input stream interface for reading from data buffer - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "istream-internal.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/istream-file.c --- a/src/lib/istream-file.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/istream-file.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - istream-file.c : Input stream handling for files - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ /* @UNSAFE: whole file */ diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/istream-mmap.c --- a/src/lib/istream-mmap.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/istream-mmap.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - istream-mmap.c : Input stream handling for mmap()ed files - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "mmap-util.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/istream.c --- a/src/lib/istream.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/istream.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - istream.c : Input stream handling - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "istream-internal.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/lib-signals.c --- a/src/lib/lib-signals.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/lib-signals.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - lib-signals.c : Handling of commonly used signals - - Copyright (c) 2001-2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2001-2003 Timo Sirainen */ #include "lib.h" #include "lib-signals.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/lib.c --- a/src/lib/lib.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/lib.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - lib.c : Initialize the library functions - - Copyright (c) 2001-2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2001-2003 Timo Sirainen */ #include "lib.h" #include "alarm-hup.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/mempool-alloconly.c --- a/src/lib/mempool-alloconly.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/mempool-alloconly.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,28 +1,4 @@ -/* - mempool-alloconly.c : Memory pool for fast allocation of memory without - need to free it in small blocks - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ /* @UNSAFE: whole file */ diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/mempool-datastack.c --- a/src/lib/mempool-datastack.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/mempool-datastack.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - mempool-data-stack.c : Memory pool wrapper for data stack - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "mempool.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/mempool-system.c --- a/src/lib/mempool-system.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/mempool-system.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - mempool-system.c : Memory pool wrapper for malloc() + realloc() + free() - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ /* @UNSAFE: whole file */ diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/mmap-anon.c --- a/src/lib/mmap-anon.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/mmap-anon.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,25 +1,4 @@ -/* - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ /* @UNSAFE: whole file */ diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/mmap-util.c --- a/src/lib/mmap-util.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/mmap-util.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - mmap-util.c - Memory mapping utilities - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "mmap-util.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/network.c --- a/src/lib/network.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/network.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - network.c : Network stuff with IPv6 support - - Copyright (c) 1999-2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 1999-2003 Timo Sirainen */ #include "lib.h" #include "network.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/ostream-file.c --- a/src/lib/ostream-file.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/ostream-file.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - ostream-file.c : Output stream handling for files - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ /* @UNSAFE: whole file */ diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/ostream.c --- a/src/lib/ostream.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/ostream.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - ostream.c : Output stream handling - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "istream.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/process-title.c --- a/src/lib/process-title.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/process-title.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,8 @@ -/* - Copyright (c) 2002 Timo Sirainen - - LINUX_PROCTITLE_HACK code from: - http://lightconsulting.com/~thalakan/process-title-notes.html +/* Copyright (c) 2002-2003 Timo Sirainen */ - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + LINUX_PROCTITLE_HACK code from: + http://lightconsulting.com/~thalakan/process-title-notes.html */ #include "lib.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/randgen.c --- a/src/lib/randgen.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/randgen.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - randgen.c : Random generator - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "randgen.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/restrict-access.c --- a/src/lib/restrict-access.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/restrict-access.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,25 +1,4 @@ -/* - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "restrict-access.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/restrict-process-size.c --- a/src/lib/restrict-process-size.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/restrict-process-size.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,25 +1,4 @@ -/* - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "restrict-process-size.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/safe-memset.c --- a/src/lib/safe-memset.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/safe-memset.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,25 +1,4 @@ -/* - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "safe-memset.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/safe-mkdir.c --- a/src/lib/safe-mkdir.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/safe-mkdir.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,25 +1,4 @@ -/* - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "safe-mkdir.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/sendfile-util.c --- a/src/lib/sendfile-util.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/sendfile-util.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,3 +1,5 @@ +/* Copyright (c) 2002-2003 Timo Sirainen */ + /* kludge a bit to remove _FILE_OFFSET_BITS definition from config.h. It's required to be able to include sys/sendfile.h with Linux. */ #include "../../config.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/str.c --- a/src/lib/str.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/str.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,25 +1,4 @@ -/* - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "buffer.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/strescape.c --- a/src/lib/strescape.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/strescape.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,25 +1,4 @@ -/* - Copyright (c) 2003 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2003 Timo Sirainen */ #include "lib.h" #include "str.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/strfuncs.c --- a/src/lib/strfuncs.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/strfuncs.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - strfuncs.c : String manipulation functions - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ /* @UNSAFE: whole file */ diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/unlink-directory.c --- a/src/lib/unlink-directory.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/unlink-directory.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,26 +1,33 @@ +/* Copyright (c) 2002-2003 Timo Sirainen */ + /* - unlink-directory.c : Safely unlink directory with everything under it. + There's a bit tricky race condition with recursive deletion. + Suppose this happens: - Copyright (c) 2002-2003 Timo Sirainen + lstat(dir, ..) -> OK, it's a directory + // attacker deletes dir, replaces it with symlink to / + opendir(dir) -> it actually opens / + + Most portable solution is to lstat() the dir, chdir() there, then check + that "." points to same device/inode as we originally lstat()ed. This + assumes that the device has usable inodes, most should except for some NFS + implementations. - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: + Filesystems may also reassign a deleted inode to another file + immediately after it's deleted. That in theory makes it possible to exploit + this race to delete the new directory. However, the new inode is quite + unlikely to be any important directory, and attacker is quite unlikely to + find out which directory even got the inode. Maybe with some setuid program + or daemon interaction something could come out of it though. - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. + Another less portable solution is to fchdir(open(dir, O_NOFOLLOW)). + This should be completely safe. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + The actual file deletion also has to be done relative to current + directory, to make sure that the whole directory structure isn't replaced + with another one while we're deleting it. Going back to parent directory + isn't too easy either - safest (and easiest) way again is to open() the + directory and fchdir() back there. */ #define _GNU_SOURCE /* for O_NOFOLLOW with Linux */ @@ -47,36 +54,6 @@ struct stat st; int dir_fd, old_errno; - /* There's a bit tricky race condition with recursive deletion. - Suppose this happens: - - lstat(dir, ..) -> OK, it's a directory - // attacker deletes dir, replaces it with symlink to / - opendir(dir) -> it actually opens / - - Most portable solution is to lstat() the dir, chdir() there, then - check that "." points to same device/inode as we originally - lstat()ed. This assumes that the device has usable inodes, most - should except for some NFS implementations. - - Filesystems may also reassign a deleted inode to another file - immediately after it's deleted. That in theory makes it possible to - exploit this race to delete the new directory. However, the new - inode is quite unlikely to be any important directory, and attacker - is quite unlikely to find out which directory even got the inode. - Maybe with some setuid program or daemon interaction something could - come out of it though. - - Another less portable solution is to fchdir(open(dir, O_NOFOLLOW)). - This should be completely safe. - - The actual file deletion also has to be done relative to current - directory, to make sure that the whole directory structure isn't - replaced with another one while we're deleting it. Going back to - parent directory isn't too easy either - safest (and easiest) way - again is to open() the directory and fchdir() back there. - */ - #ifdef O_NOFOLLOW dir_fd = open(dir, O_RDONLY | O_NOFOLLOW); if (dir_fd == -1) diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/unlink-lockfiles.c --- a/src/lib/unlink-lockfiles.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/unlink-lockfiles.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - unlink-lockfiles.c : Utility function for easier deletion of lock files. - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "unlink-lockfiles.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/utc-mktime.c --- a/src/lib/utc-mktime.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/utc-mktime.c Wed Aug 27 00:18:16 2003 +0300 @@ -116,6 +116,9 @@ ** Calculate the number of magnitude bits in a time_t ** (this works regardless of whether time_t is ** signed or unsigned, though lint complains if unsigned). + ** + ** We check TIME_T_MAX_BITS beforehand since gmtime() may fail + ** with large 64bit values in some systems. */ for (bits = 0, t = 1; t > 0 && bits < TIME_T_MAX_BITS-1; bits++) t <<= 1; diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/utc-offset.c --- a/src/lib/utc-offset.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/utc-offset.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,25 +1,4 @@ -/* - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "utc-offset.h" diff -r 219b6e9e82f1 -r 9df02b1533b3 src/lib/write-full.c --- a/src/lib/write-full.c Wed Aug 27 00:06:44 2003 +0300 +++ b/src/lib/write-full.c Wed Aug 27 00:18:16 2003 +0300 @@ -1,27 +1,4 @@ -/* - write-full.c - Simpler API to write to file - - Copyright (c) 2002 Timo Sirainen - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ +/* Copyright (c) 2002-2003 Timo Sirainen */ #include "lib.h" #include "write-full.h"