[uim-commit] r2952 - in trunk: doc uim
yamaken at freedesktop.org
yamaken at freedesktop.org
Fri Jan 20 15:56:03 PST 2006
Author: yamaken
Date: 2006-01-20 15:55:58 -0800 (Fri, 20 Jan 2006)
New Revision: 2952
Modified:
trunk/doc/COMPATIBILITY
trunk/uim/uim-helper.c
trunk/uim/uim-internal.h
trunk/uim/uim-ipc.c
trunk/uim/uim-util.c
trunk/uim/uim-util.h
trunk/uim/uim.c
Log:
* uim/uim-util.h
- (is_setugid): Removed
* uim/uim-internal.h
- (uim_issetugid): New function decl
* uim/uim-helper.c
- (is_setugid): Rename to uim_issetugid
- (uim_issetugid):
* Renamed from is_setugid()
* Change return type to uim_bool
* Simplify
- (uim_helper_get_pathname): Follow the renaming
* uim/uim-ipc.c
- (uim_ipc_open_command_with_option): Ditto
* uim/uim-util.c
- (is_setugidp): Ditto
* uim/uim.c
- (uim_init_scm): Ditto
* doc/COMPATIBILITY
- Add section "Hide unintentionally exposed is_setugid()"
Modified: trunk/doc/COMPATIBILITY
===================================================================
--- trunk/doc/COMPATIBILITY 2006-01-20 21:15:54 UTC (rev 2951)
+++ trunk/doc/COMPATIBILITY 2006-01-20 23:55:58 UTC (rev 2952)
@@ -57,6 +57,32 @@
The changes are described below in most recently updated order.
------------------------------------------------------------------------------
+Summary: Hide unintentionally exposed is_setugid()
+Affects: uim developers
+Updates: C API
+Version: 1.1.0
+Revision: ac2952
+Date: 2006-01-21
+Modifier: YamaKen
+Related:
+URL:
+ http://lists.sourceforge.jp/mailman/archives/anthy-dev/2006-January/002799.html (Japanese)
+Changes:
+ (removed) is_setugid
+Description:
+ is_setugid() was supposed to be an internal function, but was
+ exposed as global symbol in libuim unintentionally. The libtool
+ option -export-symbols-regex was expected to hide the symbol, but
+ did not.
+
+ And it was inappropriately listed in the public header file
+ uim-util.h. So the function has been hidden as internal function,
+ and prefixed with 'uim_' to avoid symbol conflict.
+
+ Although this is an API/ABI change, the libtool version is not
+ changed since it was virtually an internal function. The change does
+ not affect the compatibility.
+------------------------------------------------------------------------------
Summary: File type information of pathname custom type
Affects: IM developers, Helper program developers
Updates: Scheme API, C API (uim-custom)
Modified: trunk/uim/uim-helper.c
===================================================================
--- trunk/uim/uim-helper.c 2006-01-20 21:15:54 UTC (rev 2951)
+++ trunk/uim/uim-helper.c 2006-01-20 23:55:58 UTC (rev 2952)
@@ -127,7 +127,7 @@
char *login = NULL;
struct passwd *pw = NULL;
- if (is_setugid() == 0) {
+ if (!uim_issetugid()) {
login = getenv("LOGNAME");
}
@@ -210,23 +210,23 @@
return NULL;
}
-/* Interface function for is_setugid. */
+/* Public API for uim_issetugid(). */
+/* TODO: should be renamed to uim_helper_issetugid() */
uim_bool
uim_helper_is_setugid(void)
{
- return (is_setugid()) ? UIM_TRUE : UIM_FALSE;
+ return (uim_issetugid()) ? UIM_TRUE : UIM_FALSE;
}
-int
-is_setugid(void)
+/* For internal use only. libuim clients should use uim_helper_is_setugid()
+ * since this is not a core uim function. */
+uim_bool
+uim_issetugid(void)
{
uid_t ruid = getuid(); /* real uid */
gid_t rgid = getgid(); /* real gid */
uid_t euid = geteuid(); /* effective uid */
gid_t egid = getegid(); /* effective gid */
- if (ruid != euid || rgid != egid) {
- return 1;
- }
- return 0;
+ return (ruid != euid || rgid != egid);
}
Modified: trunk/uim/uim-internal.h
===================================================================
--- trunk/uim/uim-internal.h 2006-01-20 21:15:54 UTC (rev 2951)
+++ trunk/uim/uim-internal.h 2006-01-20 23:55:58 UTC (rev 2952)
@@ -264,6 +264,8 @@
void uim_release_preedit_segments(uim_context uc);
void uim_update_preedit_segments(uim_context uc);
+uim_bool uim_issetugid(void);
+
extern struct uim_im *uim_im_array;
extern int uim_nr_im;
extern char *uim_last_client_encoding;
Modified: trunk/uim/uim-ipc.c
===================================================================
--- trunk/uim/uim-ipc.c 2006-01-20 21:15:54 UTC (rev 2951)
+++ trunk/uim/uim-ipc.c 2006-01-20 23:55:58 UTC (rev 2952)
@@ -193,7 +193,7 @@
}
*ap = NULL;
}
- if (is_setugid() != 0) {
+ if (uim_issetugid()) {
int cmd_len = strlen(command) + 30;
char *fullpath_command = malloc(cmd_len);
char *cmd_name = strrchr(command, '/');
Modified: trunk/uim/uim-util.c
===================================================================
--- trunk/uim/uim-util.c 2006-01-20 21:15:54 UTC (rev 2951)
+++ trunk/uim/uim-util.c 2006-01-20 23:55:58 UTC (rev 2952)
@@ -617,7 +617,7 @@
static uim_lisp
is_setugidp(void)
{
- if (is_setugid()) {
+ if (uim_issetugid()) {
return uim_scm_t();
}
return uim_scm_f();
Modified: trunk/uim/uim-util.h
===================================================================
--- trunk/uim/uim-util.h 2006-01-20 21:15:54 UTC (rev 2951)
+++ trunk/uim/uim-util.h 2006-01-20 23:55:58 UTC (rev 2952)
@@ -55,9 +55,6 @@
const char *
uim_get_language_code_from_language_name(const char *language_name);
-int
-is_setugid(void);
-
/* uim's iconv_open wrapper */
void *uim_iconv_open(const char *tocode, const char *fromcode);
Modified: trunk/uim/uim.c
===================================================================
--- trunk/uim/uim.c 2006-01-20 21:15:54 UTC (rev 2951)
+++ trunk/uim/uim.c 2006-01-20 23:55:58 UTC (rev 2952)
@@ -631,7 +631,7 @@
char *scm_files = NULL;
char *env = NULL;
- /* if (is_setugid() == 0) {*/
+ /* if (!uim_issetugid()) {*/
env = getenv("LIBUIM_VERBOSE");
/* }*/
uim_scm_init(env); /* init Scheme interpreter */
@@ -645,7 +645,7 @@
uim_init_im_subrs();
uim_init_key_subrs();
- if (is_setugid() == 0) {
+ if (!uim_issetugid()) {
scm_files = getenv("LIBUIM_SCM_FILES");
}
uim_scm_set_lib_path((scm_files) ? scm_files : SCM_FILES);
More information about the uim-commit
mailing list