| Commit message (Collapse) | Author | Files | Lines |
|
* src/gpg-error.h.in (gpgrt_access): New.
* src/gpg-error.vers. src/gpg-error.def.in: Add new function.
* src/sysutils.c (any8bitchar): New.
(_gpgrt_access): New.
* src/visibility.c (gpgrt_access): New.
* src/spawn-w32.c (_gpgrt_spawn_process_detached): Use it.
* src/argparse.c (try_versioned_conffile): Use it.
* tests/t-stringutils.c (check_access): New simple test.
--
This is basically a wrapper to allow handling of utf8 encoded file
names on Windows. This also fixes the case for versioned config files
in directories with non-ascii characters.
The new test needs to be run manually on Windows using a directory
with Unicode characters.
GnuPG-bug-id: 5098
|
|
* src/sysutils.c (_gpgrt_getcwd) [W32]: Implement utf-8 support.
* src/w32-gettext.c (wchar_to_native): Factor some code out to ..
(wchar_to_cp): new.
(_gpgrt_wchar_to_utf8): New.
* tests/t-stringutils.c: Include windows.h.
(utf8_to_wchar): New.
(wchar_to_utf8): New.
(mygetcwd): Use wchar version for Windows.
(main): New option --pwd.
|
|
* src/protos.h: New.
* src/Makefile.am (libgpg_error_la_SOURCES): Add file.
* src/gpgrt-int.h: Include protos.h.
* src/sysutils.c (_gpgrt_mkdir) [W32]: Make UTF-8 aware.
(_gpgrt_chdir) [W32]: Ditto.
* src/w32-gettext.c: Include protos.h.
(utf8_to_wchar): Allow for strings.
(_gpgrt_utf8_to_wchar): New.
(_gpgrt_free_wchar): New.
* src/estream.c (map_w32_to_errno): Add more error codes.
(_gpgrt_w32_set_errno): New.
(any8bitchar) [W32]: New helper.
(func_file_create) [W32]: Convert file name and use _wopen.
--
GnuPG-bug-id: 4083
Signed-off-by: Werner Koch <[email protected]>
|
|
* src/argparse.c (initialize): Clear username.
* src/sysutils.c (_gpgrt_getusername): Implement for Windows.
--
This also fixes a missing intialization
Signed-off-by: Werner Koch <[email protected]>
|
|
* src/sysutils.c (_gpgrt_getusername): New.
* src/argparse.c (struct _gpgrt_argparse_internal_s): New flags user_*
and store the current user.
(initialize): Free new malloced field. Clear new flags.
(handle_meta_user): Implement.
(handle_metacmd): Implement user sections. Remove "group" meta
command.
(_gpgrt_argparse): Implement user sections.
(finish_read_sys): Reset new vars.
--
Implementing group would be somewhat complicated and it is doubtful
whether this really makes sense and is manageable for the admin.
Note that we have not yet implemented this for Windows.
Signed-off-by: Werner Koch <[email protected]>
|
|
* src/gpg-error.h.in (gpgrt_fnameconcat): New.
(gpgrt_absfnameconcat): New.
* src/visibility.c (gpgrt_fnameconcat, gpgrt_absfnameconcat): New.
* src/stringutils.c: New file.
(_gpgrt_vfnameconcat): New.
(_gpgrt_fnameconcat, _gpgrt_absfnameconcat): New.
* src/gpg-error.def.in: Add new functions.
* src/gpg-error.vers: Ditto.
* src/sysutils.c: Include pwd.h.
(_gpgrt_getpwdir): New.
* configure.ac: Test for pwd.h, getpwnam, getpwuid, and their _r
variants.
* src/Makefile.am (libgpg_error_la_SOURCES): Add new file.
* tests/t-stringutils.c: New.
* tests/t-common.h (xmalloc, xstrdup, xfree): New.
(die): Kludge to avoid compiler warnings.
--
The new functions are based on the code of make_filename from GnuPG.
They have been written by me ages ago with only minor modifications by
David Shaw. I re-license them from LGPL-3.0+ OR GPL-2.0+ to
LGPL-2.1-or-later.
Signed-off-by: Werner Koch <[email protected]>
|
|
* src/sysutils.c (_gpgrt_setenv): Avoid call with value=NULL.
GnuPG-bug-id: 4698
Signed-off-by: NIIBE Yutaka <[email protected]>
|
|
--
We may need to change the API and thus we better wait before
publishing this new interface.
Signed-off-by: Werner Koch <[email protected]>
|
|
* src/gpg-error.h.in (gpgrt_sentenv, gpgrt_mkdir, gpgrt_chdir): Change
return type to gpg_err_code_t.
* src/sysutils.c (_gpgrt_setenv): Implement that.
(_gpgrt_mkdir): Ditto.
(_gpgrt_chdir): Ditto.
* gpgscm/ffi.c (do_setenv, do_mkdir): Adjust for this change.
--
The functions are already a bit different and thus it is useful to let
them return a gpg-error style error code and don't let the user
implement that for each call.
Signed-off-by: Werner Koch <[email protected]>
|
|
* src/gpg-error.h.in (gpgrt_mkdir, gpgrt_chdir, gpgrt_getcwd): New.
* src/visibility.c, src/visibility.h: Add wrappers.
* src/gpg-error.vers, src/gpg-error.def.in: Add them.
* src/sysutils.c (modestr_to_mode): New.
(_gpgrt_mkdir, _gpgrt_chdir, _gpgrt_getcwd): New.
* m4/gnupg-misc.m4: New.
* m4/Makefile.am (EXTRA_DIST): Add new M4 file.
* configure.ac: Call new GNUPG_FUNC_MKDIR_TAKES_ONE_ARG.
(AC_CHECK_FUNCS): Add stat.
--
The code has been taken from GnuPG. _gpgrt_mkdir was originally
written by me as gnupg_mkdir and here relicensed to LGPLv2.1+.
_gpgrt_getcwd was originally written by in 2007 and also here
relicensed to LGPLv2.1. The new M4 macro was also written by me for
use in in GnuPG; it has been taken from GnUPG's acinclude.m4, moved to
its own file here, and relicensed to FSFULLR.
Signed-off-by: Werner Koch <[email protected]>
|
|
* src/gpg-error.h.in (gpgrt_getenv, gpgrt_setenv): New.
(gpgrt_unsetenv): New macro.
* src/gpg-error.vers, src/gpg-error.def.in: Add them.
* src/visibility.c (gpgrt_getenv, gpgrt_setenv): New.
* src/visibility.h: Add them.
* src/sysutils.c: Include string.h and on Windows windows.h.
(_gpgrt_getenv): New.
(_gpgrt_setenv): New.
--
These functions are wrappers to cope with Windows problems. The code
is similar to what we have in GnuPG but not identical.
Requires better testing.
Signed-off-by: Werner Koch <[email protected]>
|
|
* configure.ac: Add option --enable-log-clock.
* configure.ac: Add option --enable-werror.
* src/sysutils.c: New.
* src/Makefile.am (libgpg_error_la_SOURCES): Add sysutils.c
* src/gpgrt-int.h: Add internal i18n macros and hacks to make working
with sockets easier.
(es_stdin, es_stdout, es_stderr): New internal macros.
(snprintf): New macro.
Signed-off-by: Werner Koch <[email protected]>
|
|
* src/estream.c (_gpgrt_es_init): Rename to _gpgrt_estream_init.
(es_fill): Rename to fill_stream.
(es_fflush): Rename to flush_stream.
(es_deinitialize): Rename to deinit_stream_obj.
(es_create): Rename to create_stream
(es_read_nbf): Rename to do_read_nbf.
(es_read_lbf): Rename to do_read_lbf.
(es_read_fbf): Rename to do_read_fbf.
(es_peek): Rename to peek_stream.
(es_skip): Rename to skip_stream.
(es_print): Rename to do_print_stream.
--
The use of the "es_" was confusing. Avoid that.
Signed-off-by: Werner Koch <[email protected]>
|
|
--
* use https for bug reporting
* in comments and docs, use https to refer to:
- www.gnu.org
- creativecommons.org
- translationproject.org
- mail.gnome.org
- www.perl.org
- www.ctan.org
- www.cl.cam.ac.uk
- www.ntg.nl
- cygwin.com
- www.ethnologue.com
|
|
* configure.ac: New option --enable-ld-version-script.
(GPGRT_USE_VISIBILITY): New ac_define.
(HAVE_LD_VERSION_SCRIPT): New am_conditional.
* src/gpg-error.vers: New.
* src/gpgrt-int.h: New.
* src/visibility.c, src/visibility.h: New. Lot of changes to symbold
names.
--
This is only doe for the old API. The estream API needs to be added.
|
|
* configure.ac (AH_BOTTOM): Define GPGRT_ENABLE_ES_MACROS.
* src/gpg-error.h.in: include stdio.h. Include most of the estream
functions and rename structures and types.
* src/estream.h: Rewrite. Include only gpg-error.h and local
prototypes.
* src/estream.c: Rename types and macros.
* src/estream-printf.c (_gpgrt_estream_snprintf): Prefix public
functions with _gpgrt_.
|
|
|
|
* src/estream-printf.c, src/estream-printf.h: New.
* src/estream.c, src/estream.h: New.
* m4/estream.m4: New.
* src/Makefile.am (libgpg_error_la_SOURCES): Add new files.
* configure.ac (AH_BOTTOM): Define estream prefix.
<gcc>: Add useful gcc warning options.
(estream_INIT): Call.
--
This is the base line patch to move the estream code from GnuPG to
libgpg-error. The code has been taken from the GnuPG repository at
commit cb680c5ea540738692a5c74951802b0fdc658e85.
Signed-off-by: Werner Koch <[email protected]>
|