Группа :: Разработка/Прочее
Пакет: fakechroot
Главная Изменения Спек Патчи Загрузить Bugs and FR
Патч: fakechroot-0.2.6.1+1.1.5-glob.patch
diff -urN fakechroot-0.2.6.1+1.1.5.orig/libfakeroot.c fakechroot-0.2.6.1+1.1.5/libfakeroot.c
--- fakechroot-0.2.6.1+1.1.5.orig/libfakeroot.c 2004-11-24 13:20:30 +0300
+++ fakechroot-0.2.6.1+1.1.5/libfakeroot.c 2005-03-30 18:02:17 +0400
@@ -33,6 +33,7 @@
#include <dirent.h>
#include <errno.h>
#include <utime.h>
+#include <glob.h>
#define MAXPATH 2048
static char *fakechroot_ptr;
@@ -1637,6 +1638,32 @@
return next_dlopen(filename, flag);
}
+int glob(const char *pattern, int flags, int (*errfunc) (__const char *, int), glob_t *pglob)
+{
+ int rc,i;
+ char tmp[MAXPATH], *tmpptr;
+
+ expand_chroot_path(pattern);
+ rc = next_glob(pattern,flags,errfunc,pglob);
+ if (rc < 0)
+ return rc;
+ for(i = 0;i < pglob->gl_pathc;i++)
+ {
+ strcpy(tmp,pglob->gl_pathv[i]);
+ fakechroot_path = getenv("FAKECHROOT");
+ if (fakechroot_path != NULL) {
+ fakechroot_ptr = strstr(tmp, fakechroot_path);
+ if (fakechroot_ptr != tmp) {
+ tmpptr = tmp;
+ } else {
+ tmpptr = tmp + strlen(fakechroot_path);
+ }
+ strcpy(pglob->gl_pathv[i], tmpptr);
+ }
+ }
+ return rc;
+}
+
int __open(const char *pathname, int flags, ...) {
int mode = 0;
expand_chroot_path(pathname);
diff -urN fakechroot-0.2.6.1+1.1.5.orig/wrapfunc.inp fakechroot-0.2.6.1+1.1.5/wrapfunc.inp
--- fakechroot-0.2.6.1+1.1.5.orig/wrapfunc.inp 2004-11-23 18:17:33 +0300
+++ fakechroot-0.2.6.1+1.1.5/wrapfunc.inp 2005-03-30 18:02:06 +0400
@@ -89,6 +89,7 @@
setgroups;int;(SETGROUPS_SIZE_TYPE size, const gid_t *list);(size, list)
/* for chroot */
+glob;int;(const char *pattern, int flags, int (*errfunc) (__const char *, int), glob_t *pglob);(pattern,flags,errfunc,pglob)
readlink;int;(const char *path, READLINK_BUF_TYPE *buf, READLINK_BUFSIZE_TYPE bufsize);(path, buf, bufsize)
opendir;DIR *;(const char *name);(name)
chroot;int;(const char *path);(path)