1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-30 03:26:23 -04:00
Commit Graph

29 Commits

Author SHA1 Message Date
Miciah Dashiel Butler Masters
40f5e23fb0 Secure file saving: restore umask after _all_ failure conditions
The secure file saving code plays some shenanigans with the umask.
Previously, the code could fail to restore the old umask when certain libc
calls failed: malloc, mkstemp, fdopen, and fopen. This resulted in
unrelated code creating files with the wrong umode. Specifically, the
download code's automatic directory creation was creating directories
without the execute permission bit.

Thanks to Quiznos for reporting and helping to track the problem down.

[ Backported from commit 7f0fb0440c in
  ELinks 0.12.GIT.  The general download code in 0.11.2.GIT does not
  automatically create directories but the BitTorrent code does.  --KON ]
2007-04-06 15:18:49 +03:00
Kalle Olavi Niemitalo
f135339a1a add_string_to_string: Don't fail if @from is empty.
Old versions of add_string_to_string returned the target string
unmodified if from->source pointed to a null character, which usually
meant that the source string was empty.  That was changed in commit
5e18576391f75ad84e04f9c8a30b93d08f0b92ab on 2004-11-03 so that
add_string_to_string instead returned NULL in that situation.  The
change seems to have been inadvertent.

I'm now reverting that change and also making add_string_to_string
check the emptiness of the source string based on the stored length
only, rather than on any null characters.  So the function can now
also be used with non-C strings containing embedded null characters.
Note that the previous version did not completely prevent embedded
null characters either, because it checked only the first character.

[ From commit 4a23d7fd82 in ELinks
  0.12.GIT.  --KON ]
2007-03-18 21:18:02 +02:00
Kalle Olavi Niemitalo
518cf082db add_html_to_string: If out of memory, roll back and return NULL.
[ Backported from commits 28645973e5
  and b7dddaa685 in ELinks 0.12.GIT.
  --KON ]
2007-03-18 12:38:19 +02:00
Kalle Olavi Niemitalo
2f4b3dae69 string_assert: First arg of elinks_internal is a format string.
[ Backported from commit a73d165fd7
  in ELinks 0.12.GIT.  --KON ]
2007-03-11 14:02:17 +02:00
Kalle Olavi Niemitalo
1f65dd2802 Bug 919, mem_mmap_realloc: Don't overflow the buffer when shrinking it.
The bug was possible only #ifndef HAVE_MREMAP, thus not on Linux.

Backported from ELinks 0.12.GIT (4ae90c798c).
2007-01-02 20:43:58 +02:00
Laurent MONIN
135a79a3c3 Include <sys/types.h> and fix compilation on an old PPC/Debian system
It should be included via elinks.h but apparently some other system header
can prevent this somehow on some systems.

Reported-by: Phillip Pi <ant@zimage.com>
2006-11-27 17:38:00 +01:00
Jonas Fonseca
081ab78a88 Revert 06eb3fa02abf12c6d2352af4288a6ad465a0e8c1 (in the historic repo)
This was reverted by zas in commit 2a71adda10
in current HEAD (elinks-0.12).

The original commit message reads: Anchors with '#' didn't "work" for
libstdc++ local documentation due to encoded filenames. This change fixes
it and hopefully has no impact for other parts of ELinks.
2006-01-29 12:28:43 +01:00
Jonas Fonseca
1b999c9b6a Remove .vimrc files; use the Vim ftplugin instead 2006-01-29 10:45:22 +01:00
Jonas Fonseca
f19aa38e1f Fix typo 2006-01-29 10:25:18 +01:00
Laurent MONIN
1c95d6c2af Simplify secure_open() call, make it a wrapper around secure_open_umask(). 2006-01-29 10:02:46 +01:00
Laurent MONIN
347b3530a1 Use mode_t and mode macros everywhere. 2006-01-29 09:59:09 +01:00
Kalle Olavi Niemitalo
63797ae9b3 Don't include <sys/param.h> in util/math for MAX/MIN
<sys/param.h> includes <linux/param.h>, which includes <asm/param.h>, which
includes <asm-i486/param.h>, which includes <linux/config.h>, which
includes <linux/autoconf.h>, which includes <asm-i486/autoconf.h>, which
undefines CONFIG_IPV6.
2006-01-10 16:06:09 +01:00
Laurent MONIN
9d287c24ae Add missing b flag to fopen() call. 2006-01-10 14:01:46 +01:00
Jonas Fonseca
3d0fc33785 set_mem_comment(): Use memcpy() + NUL assignment instead of safe_strncpy()
... so as not to depend on util/string stuff.
2005-12-28 23:06:23 +01:00
Miciah Dashiel Butler Masters
a33547d8ad Add memory-leak tracing to intdup. 2005-12-26 11:22:05 +00:00
Miciah Dashiel Butler Masters
1602bd5d29 Factor intdup out of smjs_get_keymap_object. 2005-12-26 11:07:15 +00:00
Miciah Dashiel Butler Masters
517bb03da4 Add routine add_file_to_string and use it in load_textarea_file. 2005-12-18 15:56:59 +00:00
Jonas Fonseca
5dffe2e8ac Fix various sparse warnings
Mostly non-ANSI function declarations, using 0 as NULL and inline
function prototypes. Also removed unused S_HTTP_100 network state
enum type, which text message contained unknown escape sequence: '\?'.
2005-11-24 15:38:47 +01:00
Jonas Fonseca
acf2ec806b Remove empty lines in start of header files
A left over from the CVS Id removal. Also, for a few files, normalize the
order in which things are declared in headers.
2005-11-15 11:33:27 +01:00
Laurent MONIN
df065ead80 Remove now useless $Id: lines. 2005-10-21 09:14:07 +02:00
Jonas Fonseca
c88afeb1c2 path_to_top -> top_builddir 2005-10-20 04:00:35 +02:00
Jonas Fonseca
e39a4342d6 Include $(top_srcdir)/Makefile.lib instead of $(path_to_top)/Makefile.lib
A step towards out of tree builds ...
2005-10-20 01:11:47 +02:00
Marti Raudsepp
e31a66745a Fix a bug in the KiB and MiB computation in add_xnum_to_string
where the fractional part overflowed to 0 before the integer part
was incremented.

Thanks to Marti Raudsepp for finding this bug and Marti and pasky
for the fix.
2005-10-16 01:53:06 +00:00
Jonas Fonseca
94ed6fa754 Finalize and cleanup the denser Makefile format
Convert remaining conditional file building to use

	OBJS-$(CONFIG_FOO) += foo.o

one problem with reverse meaining (in util/) fixed with local 'hack'.

Cleanup and remove stuff which is now default targets.
2005-09-28 12:38:17 +02:00
Jonas Fonseca
1efab31581 Simplify building of and linking with directories
Ditch the building of an archive (.a) in favour of linking all objects in a
directory into a lib.o file. This makes it easy to link in subdirectories
and more importantly keeps the build logic in the local subdirectories.

Note: after updating you will have to rm **/*.a if you do not make clean
before updating.
2005-09-27 21:38:58 +02:00
Jonas Fonseca
b30064c0d0 Rename targets: *-l -> *-local 2005-09-27 21:11:28 +02:00
Petr Baudis
18f85bec14 ELBuildized util/. 2005-09-16 13:27:27 +02:00
Jonas Fonseca
7462f22635 Remove now obsolete .cvsignore files. 2005-09-15 18:33:20 +02:00
Petr Baudis
0f6d4310ad Initial commit of the HEAD branch of the ELinks CVS repository, as of
Thu Sep 15 15:57:07 CEST 2005. The previous history can be added to this
by grafting.
2005-09-15 15:58:31 +02:00