Disabled.
* glibtop_server.h: * procopenfiles.c: (get_socket_endpoint): Disabled. (glibtop_get_proc_open_files_s): Secured -> g_snprintf.
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
2005-01-10 Benoît Dejean <TazForEver@dlfp.org>
|
||||||
|
|
||||||
|
* glibtop_server.h:
|
||||||
|
* procopenfiles.c: (get_socket_endpoint): Disabled.
|
||||||
|
|
||||||
|
(glibtop_get_proc_open_files_s): Secured -> g_snprintf.
|
||||||
|
|
||||||
2004-12-23 Benoît Dejean <tazforever@dlfp.org>
|
2004-12-23 Benoît Dejean <tazforever@dlfp.org>
|
||||||
|
|
||||||
* fsusage.c: (_glibtop_linux_get_fsusage_read_write):
|
* fsusage.c: (_glibtop_linux_get_fsusage_read_write):
|
||||||
|
@@ -44,5 +44,6 @@
|
|||||||
#define GLIBTOP_SUID_PROC_MAP 0
|
#define GLIBTOP_SUID_PROC_MAP 0
|
||||||
#define GLIBTOP_SUID_NETLOAD 0
|
#define GLIBTOP_SUID_NETLOAD 0
|
||||||
#define GLIBTOP_SUID_PPP 0
|
#define GLIBTOP_SUID_PPP 0
|
||||||
|
#define GLIBTOP_SUID_PROC_FILE 0
|
||||||
|
|
||||||
#endif /* __LINUX__GLIBTOP_SERVER_H__ */
|
#endif /* __LINUX__GLIBTOP_SERVER_H__ */
|
||||||
|
@@ -65,12 +65,13 @@ get_socket_endpoint(char *buf, int *prmtport, int s)
|
|||||||
while(fgets(l, sizeof l, f))
|
while(fgets(l, sizeof l, f))
|
||||||
{
|
{
|
||||||
unsigned int loc, locport, rmt;
|
unsigned int loc, locport, rmt;
|
||||||
int sock = -1;
|
int sock = -42;
|
||||||
sscanf(l, " %*d: %8x:%4x %8x:%4x %*d %*x:%*x %*x:%*x %*d %*d %*d %d",
|
/* FIXME
|
||||||
&loc, &locport, &rmt, prmtport, &sock);
|
sscanf(l, "%*d: %8x:%4x %8x:%4x %*x %*x:%*x %*x:%*x %*d %*d %*d %d",
|
||||||
|
&loc, &locport, &rmt, prmtport, &sock); */
|
||||||
if(sock == s)
|
if(sock == s)
|
||||||
{
|
{
|
||||||
inet_ntop(AF_INET, &rmt, buf, INET_ADDRSTRLEN);
|
inet_ntop(AF_INET, &rmt, buf, GLIBTOP_OPEN_DEST_HOST_LEN);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -104,15 +105,15 @@ glibtop_get_proc_open_files_s (glibtop *server, glibtop_proc_open_files *buf, pi
|
|||||||
char tgt [BUFSIZ];
|
char tgt [BUFSIZ];
|
||||||
glibtop_open_files_entry entry = {0};
|
glibtop_open_files_entry entry = {0};
|
||||||
|
|
||||||
|
|
||||||
if(direntry->d_name[0] == '.')
|
if(direntry->d_name[0] == '.')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
sprintf(fn, "/proc/%d/fd/%s", pid, direntry->d_name);
|
g_snprintf(fn, sizeof fn, "/proc/%d/fd/%s",
|
||||||
|
pid, direntry->d_name);
|
||||||
|
|
||||||
rv = readlink(fn, tgt, sizeof(tgt) - 1);
|
rv = readlink(fn, tgt, sizeof(tgt) - 1);
|
||||||
|
if(rv < 0) continue;
|
||||||
if(rv < 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
tgt[rv] = '\0';
|
tgt[rv] = '\0';
|
||||||
|
|
||||||
entry.fd = atoi(direntry->d_name);
|
entry.fd = atoi(direntry->d_name);
|
||||||
|
Reference in New Issue
Block a user