--- installwatch.c.orig 2004-12-01 22:36:45.000000000 +0100 +++ installwatch.c 2004-12-28 14:58:48.000000000 +0100 @@ -90,6 +90,10 @@ static int (*true_truncate)(const char *, TRUNCATE_T); static int (*true_unlink)(const char *); static int (*true_utime)(const char *,const struct utimbuf *); +static int (*true_utimes)(char *, struct timeval *); +static int (*true_setxattr)(const char *,const char *,const void *, + size_t, int); +static int (*true_removexattr)(const char *,const char *); #if(GLIBC_MINOR >= 1) @@ -314,6 +318,9 @@ true_truncate = dlsym(libc_handle, "truncate"); true_unlink = dlsym(libc_handle, "unlink"); true_utime = dlsym(libc_handle, "utime"); + true_utimes = dlsym(libc_handle, "utimes"); + true_setxattr = dlsym(libc_handle, "setxattr"); + true_removexattr = dlsym(libc_handle, "removexattr"); #if(GLIBC_MINOR >= 1) true_creat64 = dlsym(libc_handle, "creat64"); @@ -3071,6 +3078,122 @@ return result; } +int utimes (char *pathname, struct timeval *tvp) { + int result; + instw_t instw; + + if (!libc_handle) + initialize(); + +#if DEBUG + debug(2,"utimes(%s)\n",pathname); +#endif + + /* We were asked to work in "real" mode */ + if( !(__instw.gstatus & INSTW_INITIALIZED) || + !(__instw.gstatus & INSTW_OKWRAP) ) { + result=true_utimes(pathname,tvp); + return result; + } + + instw_new(&instw); + instw_setpath(&instw,pathname); + +#if DEBUG + instw_print(&instw); +#endif + + backup(instw.truepath); + instw_apply(&instw); + + result=true_utimes(instw.translpath,tvp); + log("%d\tutimes\t%s\t#%s\n",result,instw.reslvpath,error(result)); + + instw_delete(&instw); + + return result; +} + +int setxattr (const char *pathname, const char *name, + const void *value, size_t size, int flags) +{ + int result; + instw_t instw; + + REFCOUNT; + + if (!libc_handle) + initialize(); + +#if DEBUG + debug(2,"setxattr(%s,%s)\n",pathname,name); +#endif + + /* We were asked to work in "real" mode */ + if( !(__instw.gstatus & INSTW_INITIALIZED) || + !(__instw.gstatus & INSTW_OKWRAP) ) { + result=true_setxattr(pathname,name, + value,size,flags); + return result; + } + + instw_new(&instw); + instw_setpath(&instw,pathname); + +#if DEBUG + instw_print(&instw); +#endif + + backup(instw.truepath); + instw_apply(&instw); + + result=true_setxattr(instw.translpath,name,value,size,flags); + log("%d\tsetxattr\t%s\t#%s\n",result,instw.reslvpath,error(result)); + + instw_delete(&instw); + + return result; +} + +int removexattr (const char *pathname, const char *name) +{ + int result; + instw_t instw; + + REFCOUNT; + + if (!libc_handle) + initialize(); + +#if DEBUG + debug(2,"removexattr(%s,%s)\n",pathname,name); +#endif + + /* We were asked to work in "real" mode */ + if( !(__instw.gstatus & INSTW_INITIALIZED) || + !(__instw.gstatus & INSTW_OKWRAP) ) { + result=true_removexattr(pathname,name); + return result; + } + + instw_new(&instw); + instw_setpath(&instw,pathname); + +#if DEBUG + instw_print(&instw); +#endif + + backup(instw.truepath); + instw_apply(&instw); + + result=true_removexattr(instw.translpath,name); + log("%d\tremovexattr\t%s\t#%s\n",result,instw.reslvpath,error(result)); + + instw_delete(&instw); + + return result; +} + #if(GLIBC_MINOR >= 1) int creat64(const char *pathname, __mode_t mode) {