[Fakeroot-commits] [SCM] fakeroot branch, master, updated. debian/1.14.2-8-g2a03159

Clint Adams schizo at debian.org
Wed Oct 28 01:58:08 UTC 2009


The following commit has been merged in the master branch:
commit fa38a21855ebe6b48cccac12c00281a47c86d852
Author: Clint Adams <schizo at debian.org>
Date:   Tue Oct 27 21:17:08 2009 -0400

    Remove trailing whitespace.

diff --git a/communicate.c b/communicate.c
index 47d363e..2db0a9d 100644
--- a/communicate.c
+++ b/communicate.c
@@ -12,11 +12,11 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
- This file contains the code (wrapper functions) that gets linked with 
+ This file contains the code (wrapper functions) that gets linked with
  the programes run from inside fakeroot. These programes then communicate
- with the fakeroot daemon, that keeps information about the "fake" 
+ with the fakeroot daemon, that keeps information about the "fake"
  ownerships etc. of the files etc.
-    
+
  */
 
 #ifdef __APPLE__
@@ -88,9 +88,9 @@ static void fail(const char *msg)
 
 const char *env_var_set(const char *env){
   const char *s;
-  
+
   s=getenv(env);
-  
+
   if(s && *s)
     return s;
   else
@@ -102,7 +102,7 @@ void cpyfakemstat(struct fake_msg *f, const struct stat *st
 		, int ver
 #endif
 		){
-  
+
 #ifndef STUPID_ALPHA_HACK
   f->st.mode =st->st_mode;
   f->st.ino  =st->st_ino ;
@@ -355,7 +355,7 @@ void cpyfakefake(struct fakestat *dest,
 
 void stat64from32(struct stat64 *s64, const struct stat *s32)
 {
-  /* I've added st_size and st_blocks here. 
+  /* I've added st_size and st_blocks here.
      Don't know why they were missing -- joost*/
    s64->st_dev = s32->st_dev;
    s64->st_ino = s32->st_ino;
@@ -589,7 +589,7 @@ static size_t read_all(int fd,void *buf,size_t count) {
 		  else fail("partial read");
 	  } else {
 		  remaining-=rc;
-	  }  
+	  }
   }
   return count-remaining;
 }
@@ -653,7 +653,7 @@ static void get_fakem_nr(struct fake_msg *buf)
       continue;
    fail("read");
   }
- 
+
   buf->id = ntohl(buf->id);
   buf->st.uid = ntohl(buf->st.uid);
   buf->st.gid = ntohl(buf->st.gid);
@@ -802,7 +802,7 @@ key_t get_ipc_key(key_t new_key)
 
 int init_get_msg(){
   /* a msgget call generates a fstat() call. As fstat() is wrapped,
-     that call will in turn call semaphore_up(). So, before 
+     that call will in turn call semaphore_up(). So, before
      the semaphores are setup, we should make sure we already have
      the msg_get and msg_set id.
      This is why semaphore_up() calls this function.*/
diff --git a/communicate.h b/communicate.h
index 865d628..9979f81 100644
--- a/communicate.h
+++ b/communicate.h
@@ -23,21 +23,21 @@
 
 /* I've got a chicken-and-egg problem here. I want to have
    stat64 support, only running on glibc2.1 or later. To
-   find out what glibc we've got installed, I need to 
+   find out what glibc we've got installed, I need to
    #include <features.h>.
    But, before including that file, I have to define _LARGEFILE64_SOURCE
    etc, cause otherwise features.h will not define it's internal defines.
    As I assume that pre-2.1 libc's will just ignore those _LARGEFILE64_SOURCE
    defines, I hope I can get away with this approach:
 */
-  
+
 /*First, unconditionally define these, so that glibc 2.1 features.h defines
   the needed 64 bits defines*/
 #ifndef _LARGEFILE64_SOURCE
-# define _LARGEFILE64_SOURCE 
+# define _LARGEFILE64_SOURCE
 #endif
 #ifndef _LARGEFILE_SOURCE
-# define _LARGEFILE_SOURCE 
+# define _LARGEFILE_SOURCE
 #endif
 
 /* Then include features.h, to find out what glibc we run */
@@ -60,7 +60,7 @@
 # undef _LARGEFILE_SOURCE
 #endif
 
-/* Sparc glibc 2.0.100 is broken, dlsym segfaults on --fxstat64.. 
+/* Sparc glibc 2.0.100 is broken, dlsym segfaults on --fxstat64..
 #define STAT64_SUPPORT */
 
 #include <sys/types.h>
@@ -123,7 +123,7 @@
 
 enum {chown_func,
         /*2*/  chmod_func,
-        /*3*/  mknod_func, 
+        /*3*/  mknod_func,
                stat_func,
         /*5*/  unlink_func,
                debugdata_func,
@@ -167,7 +167,7 @@ extern void unlock_comm_sd(void);
 # endif
 #endif /* FAKEROOT_FAKENET */
 
-#ifdef STAT64_SUPPORT  
+#ifdef STAT64_SUPPORT
 #ifndef STUPID_ALPHA_HACK
 extern void send_stat64(const struct stat64 *st, func_id_t f);
 extern void send_get_stat64(struct stat64 *buf);
diff --git a/faked.c b/faked.c
index 173d71e..ca4d0c2 100644
--- a/faked.c
+++ b/faked.c
@@ -13,18 +13,18 @@
     GNU General Public License for more details.
 
   title       : fakeroot
-  description : create a "fake" root shell, by wrapping 
+  description : create a "fake" root shell, by wrapping
                 functions like chown, stat, etc. Useful for debian
                 packaging mechanism
 */
 
 /*
-  upon startup, the fakeroot script (/usr/bin/fakeroot) 
+  upon startup, the fakeroot script (/usr/bin/fakeroot)
   forks faked (this program), and the shell or user program that
   will run with the libtricks.so.0.0 wrapper.
-  
+
   These tree running programs have the following tasks:
-    
+
     fakeroot script
        starts the other two processes, waits for the user process to
        die, and then send a SIGTERM signal to faked, causing
@@ -33,13 +33,13 @@
     faked
        the ``main'' daemon, creates ipc message queues, and later
        receives ipc messages from the user program, maintains
-       fake inode<->ownership database (actually just a 
+       fake inode<->ownership database (actually just a
        lot of struct stat entries). Will clear ipc message ques
        upon receipt of a SIGTERM. Will show debug output upon
        receipt of a SIGUSR1 (if started with -d debug option)
 
     user program
-       Any shell or other programme, run with 
+       Any shell or other programme, run with
        LD_PRELOAD=libtricks.so.0.0, and FAKEROOT_DBKEY=ipc-key,
        thus the executed commands will communicate with
        faked. libtricks will wrap all file ownership etc modification
@@ -51,11 +51,11 @@
      getuid(), geteuid(), getgid(), getegid(),
      mknod()
      chown(), fchown() lchown()
-     chmod(), fchmod() 
+     chmod(), fchmod()
      mkdir(),
      lstat(), fstat(), stat() (actually, __xlstat, ...)
      unlink(), remove(), rmdir(), rename()
-    
+
   comments:
     I need to wrap unlink because of the following:
         install -o admin foo bar
@@ -67,16 +67,16 @@
     Same goes for all other ways to remove inodes form the filesystem,
     like rename(existing_file, any_file).
 
-    The communication between client (user progamme) and faked happens 
-    with inode/dev information, not filenames. This is 
+    The communication between client (user progamme) and faked happens
+    with inode/dev information, not filenames. This is
     needed, as the client is the only one who knows what cwd is,
     so it's much easier to stat in the client. Otherwise, the daemon
     needs to keep a list of client pids vs cwd, and I'd have to wrap
     fork e.d., as they inherit their parent's cwd. Very compilcated.
-    
+
     */
-/* ipc documentation bugs: msgsnd(2): MSGMAX=4056, not 4080 
-   (def in ./linux/msg.h, couldn't find other def in /usr/include/ 
+/* ipc documentation bugs: msgsnd(2): MSGMAX=4056, not 4080
+   (def in ./linux/msg.h, couldn't find other def in /usr/include/
    */
 
 #ifdef __APPLE__
@@ -232,7 +232,7 @@ static void data_insert(const struct fakestat *buf,
 			const uint32_t remote)
 {
   data_node_t *n, *last = NULL;
-  
+
   for (n = data_hash_table[data_hash_val(buf)]; n; last = n, n = n->next)
     if (fakestat_equal(&n->buf, buf) && n->remote == remote)
       break;
@@ -599,7 +599,7 @@ void debug_stat(const struct fakestat *st){
 void insert_or_overwrite(struct fakestat *st,
 			 const uint32_t remote){
   data_node_t *i;
-  
+
   i = data_find(st, remote);
   if (i == data_end()) {
     if(debug){
@@ -623,7 +623,7 @@ void process_chown(struct fake_msg *buf){
   struct fakestat *stptr;
   struct fakestat st;
   data_node_t *i;
-  
+
   if(debug){
     fprintf(stderr,"FAKEROOT: chown ");
     debug_stat(&buf->st);
@@ -631,11 +631,11 @@ void process_chown(struct fake_msg *buf){
   i = data_find(&buf->st, buf->remote);
   if (i != data_end()) {
     stptr = data_node_get(i);
-    /* From chown(2): If  the owner or group is specified as -1, 
-       then that ID is not changed. 
+    /* From chown(2): If  the owner or group is specified as -1,
+       then that ID is not changed.
        Cannot put that test in libtricks, as at that point it isn't
        known what the fake user/group is (so cannot specify `unchanged')
-       
+
        I typecast to (uint32_t), as st.uid may be bigger than uid_t.
        In that case, the msb in st.uid should be discarded.
        I don't typecaset to (uid_t), as the size of uid_t may vary
@@ -644,7 +644,7 @@ void process_chown(struct fake_msg *buf){
        concurrently. Yes, this does seem farfeched, but was
        actually the case with the libc5/6 transition.
     */
-    if ((uint32_t)buf->st.uid != (uint32_t)-1) 
+    if ((uint32_t)buf->st.uid != (uint32_t)-1)
       stptr->uid=buf->st.uid;
     if ((uint32_t)buf->st.gid != (uint32_t)-1)
       stptr->gid=buf->st.gid;
@@ -665,11 +665,11 @@ void process_chown(struct fake_msg *buf){
 void process_chmod(struct fake_msg *buf){
   struct fakestat *st;
   data_node_t *i;
-  
+
   if(debug)
     fprintf(stderr,"FAKEROOT: chmod, mode=%lo\n",
 	    (long)buf->st.mode);
-  
+
   i = data_find(&buf->st, buf->remote);
   if (i != data_end()) {
     st = data_node_get(i);
@@ -711,11 +711,11 @@ void process_chmod(struct fake_msg *buf){
 void process_mknod(struct fake_msg *buf){
   struct fakestat *st;
   data_node_t *i;
-  
+
   if(debug)
     fprintf(stderr,"FAKEROOT: mknod, mode=%lo\n",
 	    (long)buf->st.mode);
-  
+
   i = data_find(&buf->st, buf->remote);
   if (i != data_end()) {
     st = data_node_get(i);
@@ -750,7 +750,7 @@ void process_stat(struct fake_msg *buf){
     cpyfakefake(&buf->st, data_node_get(i));
     if(debug){
       fprintf(stderr,"FAKEROOT: (previously known): fake=");
-      debug_stat(&buf->st);      
+      debug_stat(&buf->st);
     }
 
   }
@@ -1112,10 +1112,10 @@ int main(int argc, char **argv){
 					 specially by libfake */
       msg_key=random();
   }
-    
+
   if(debug)
     fprintf(stderr,"using %li as msg key\n",(long)msg_key);
-  
+
   msg_get=msgget(msg_key,IPC_CREAT|0600);
   msg_snd=msgget(msg_key+1,IPC_CREAT|0600);
   sem_id=semget(msg_key+2,1,IPC_CREAT|0600);
@@ -1183,7 +1183,7 @@ int main(int argc, char **argv){
   sigemptyset(&sa_debug.sa_mask);
   sa_debug.sa_flags=0;
   //  sa_debug.sa_restorer=0;
-  
+
   sa_save.sa_handler=save;
   sigemptyset(&sa_save.sa_mask);
   sa_save.sa_flags=0;
@@ -1218,7 +1218,7 @@ int main(int argc, char **argv){
     if ((pid=fork()) == 0){
       int fl;
       int num_fds = getdtablesize();
-      
+
       fflush(stdout);
 
       /* This is the child closing its file descriptors. */
diff --git a/libfakeroot.c b/libfakeroot.c
index 4e3bbb0..1b4f63b 100644
--- a/libfakeroot.c
+++ b/libfakeroot.c
@@ -13,8 +13,8 @@
     GNU General Public License for more details.
 
 */
-/* #define _POSIX_C_SOURCE 199309L whatever that may mean...*/ 
-/* #define _BSD_SOURCE             I use strdup, S_IFDIR, etc */ 
+/* #define _POSIX_C_SOURCE 199309L whatever that may mean...*/
+/* #define _BSD_SOURCE             I use strdup, S_IFDIR, etc */
 
 /* Roderich Schupp writes (bug #79100):
    /usr/include/dlfcn.h from libc6 2.2-5 defines RTLD_NEXT only
@@ -28,7 +28,7 @@
    fakeroot
    always bombs. Simple fix:
 */
-#define _GNU_SOURCE 
+#define _GNU_SOURCE
 
 #define FAKEROOT_LIBFAKEROOT
 
@@ -40,7 +40,7 @@
 #define _DARWIN_NO_64_BIT_INODE
 
 #ifndef __LP64__
-/* 
+/*
    This file is for 32-bit symbols which do not have the "$UNIX2003" version.
 */
 #define _NONSTD_SOURCE
@@ -66,7 +66,7 @@
    These INT_* (which stands for internal) macros should always be used when
    the fakeroot library owns the storage of the stat variable.
 */
-#ifdef STAT64_SUPPORT 
+#ifdef STAT64_SUPPORT
 #define INT_STRUCT_STAT struct stat64
 #define INT_NEXT_STAT(a,b) NEXT_STAT64(_STAT_VER,a,b)
 #define INT_NEXT_LSTAT(a,b) NEXT_LSTAT64(_STAT_VER,a,b)
@@ -90,7 +90,7 @@
 #include <stdio.h>
 #include <stdarg.h>
 #include <dlfcn.h>
-#include <unistd.h> 
+#include <unistd.h>
 #include <dirent.h>
 #include <errno.h>
 #include <sys/types.h>
@@ -109,8 +109,8 @@ extern int unsetenv (const char *name);
 #endif
 
 
-/* 
-   Where are those shared libraries? 
+/*
+   Where are those shared libraries?
    If I knew of a configure/libtool way to find that out, I'd use it. Or
    any other way other than the method I'm using below. Does anybody know
    how I can get that location? (BTW, symply linking a programme, and running
@@ -118,7 +118,7 @@ extern int unsetenv (const char *name);
 */
 
 
-/* 
+/*
    Note that LIBCPATH isn't actually used on Linux or Solaris, as RTLD_NEXT
    is defined and we use that to get the `next_*' functions
 
@@ -141,17 +141,17 @@ extern int unsetenv (const char *name);
 // this structure is used in next_wrap, which is defined in
 // wrapstruct.h, included below
 */
- 
+
 struct next_wrap_st{
   void **doit;
   char *name;
 };
 
 void *get_libc(){
- 
+
 #ifndef RTLD_NEXT
  void *lib=0;
- if(!lib){ 
+ if(!lib){
    lib= dlopen(LIBCPATH,RTLD_LAZY);
  }
  if (NULL==lib) {
@@ -195,7 +195,7 @@ void load_library_symbols(void){
 
   int i;
   const char *msg;
-  
+
 #ifdef LIBFAKEROOT_DEBUGGING
   if (getenv("FAKEROOT_DEBUG")) {
     fakeroot_debug=1;
@@ -559,8 +559,8 @@ static int dont_try_chown(){
 /* The wrapped functions */
 
 
-int WRAP_LSTAT LSTAT_ARG(int ver, 
-		       const char *file_name, 
+int WRAP_LSTAT LSTAT_ARG(int ver,
+		       const char *file_name,
 		       struct stat *statbuf){
 
   int r;
@@ -578,8 +578,8 @@ int WRAP_LSTAT LSTAT_ARG(int ver,
 }
 
 
-int WRAP_STAT STAT_ARG(int ver, 
-		       const char *file_name, 
+int WRAP_STAT STAT_ARG(int ver,
+		       const char *file_name,
 		       struct stat *st){
   int r;
 
@@ -596,8 +596,8 @@ int WRAP_STAT STAT_ARG(int ver,
 }
 
 
-int WRAP_FSTAT FSTAT_ARG(int ver, 
-			int fd, 
+int WRAP_FSTAT FSTAT_ARG(int ver,
+			int fd,
 			struct stat *st){
 
 
@@ -635,8 +635,8 @@ int WRAP_FSTATAT FSTATAT_ARG(int ver,
 
 #ifdef STAT64_SUPPORT
 
-int WRAP_LSTAT64 LSTAT64_ARG (int ver, 
-			   const char *file_name, 
+int WRAP_LSTAT64 LSTAT64_ARG (int ver,
+			   const char *file_name,
 			   struct stat64 *st){
 
   int r;
@@ -656,8 +656,8 @@ int WRAP_LSTAT64 LSTAT64_ARG (int ver,
 }
 
 
-int WRAP_STAT64 STAT64_ARG(int ver, 
-			   const char *file_name, 
+int WRAP_STAT64 STAT64_ARG(int ver,
+			   const char *file_name,
 			   struct stat64 *st){
   int r;
 
@@ -674,8 +674,8 @@ int WRAP_STAT64 STAT64_ARG(int ver,
 }
 
 
-int WRAP_FSTAT64 FSTAT64_ARG(int ver, 
-			     int fd, 
+int WRAP_FSTAT64 FSTAT64_ARG(int ver,
+			     int fd,
 			     struct stat64 *st){
   int r;
 
@@ -715,7 +715,7 @@ int WRAP_FSTATAT64 FSTATAT64_ARG(int ver,
 /*************************************************************/
 /*
   Wrapped functions general info:
-  
+
   In general, the structure is as follows:
     - Then, if the function does things that (possibly) fail by
       other users than root, allow for `fake' root privileges.
@@ -734,7 +734,7 @@ int WRAP_FSTATAT64 FSTATAT64_ARG(int ver,
 
 
 /* chown, lchown, fchown, chmod, fchmod, mknod functions
-   
+
    quite general. See the `Wrapped functions general info:' above
    for more info.
  */
@@ -757,7 +757,7 @@ int chown(const char *path, uid_t owner, gid_t group){
   /*chown(sym-link) works on the symlink itself, use lstat: */
   r=INT_NEXT_LSTAT(path, &st);
 #endif
-  
+
   if(r)
     return r;
   st.st_uid=owner;
@@ -769,7 +769,7 @@ int chown(const char *path, uid_t owner, gid_t group){
     r=0;
   if(r&&(errno==EPERM))
     r=0;
-  
+
   return r;
 }
 
@@ -808,19 +808,19 @@ int fchown(int fd, uid_t owner, gid_t group){
   r=INT_NEXT_FSTAT(fd, &st);
   if(r)
     return r;
-  
+
   st.st_uid=owner;
   st.st_gid=group;
   INT_SEND_STAT(&st, chown_func);
-  
+
   if(!dont_try_chown())
     r=next_fchown(fd,owner,group);
   else
     r=0;
-  
+
   if(r&&(errno==EPERM))
     r=0;
-  
+
   return r;
 }
 
@@ -832,22 +832,22 @@ int fchownat(int dir_fd, const char *path, uid_t owner, gid_t group, int flags)
      be when we stat it. */
   INT_STRUCT_STAT st;
   r=INT_NEXT_FSTATAT(dir_fd, path, &st, (flags & AT_SYMLINK_NOFOLLOW));
-  
+
   if(r)
     return(r);
-  
+
   st.st_uid=owner;
   st.st_gid=group;
-  INT_SEND_STAT(&st,chown_func);  
-  
+  INT_SEND_STAT(&st,chown_func);
+
   if(!dont_try_chown())
     r=next_fchownat(dir_fd,path,owner,group,flags);
   else
     r=0;
-  
+
   if(r&&(errno==EPERM))
     r=0;
-  
+
   return r;
 }
 #endif /* HAVE_FCHOWNAT */
@@ -865,11 +865,11 @@ int chmod(const char *path, mode_t mode){
   r=INT_NEXT_STAT(path, &st);
   if(r)
     return r;
-  
+
   st.st_mode=(mode&ALLPERMS)|(st.st_mode&~ALLPERMS);
-    
+
   INT_SEND_STAT(&st, chmod_func);
-  
+
   /* if a file is unwritable, then root can still write to it
      (no matter who owns the file). If we are fakeroot, the only
      way to fake this is to always make the file writable, readable
@@ -881,7 +881,7 @@ int chmod(const char *path, mode_t mode){
   mode |= 0600;
   if(S_ISDIR(st.st_mode))
     mode |= 0100;
-  
+
   r=next_chmod(path, mode);
   if(r&&(errno==EPERM))
     r=0;
@@ -903,18 +903,18 @@ int fchmod(int fd, mode_t mode){
   }
 #endif /* LIBFAKEROOT_DEBUGGING */
   r=INT_NEXT_FSTAT(fd, &st);
-  
+
   if(r)
     return(r);
-  
+
   st.st_mode=(mode&ALLPERMS)|(st.st_mode&~ALLPERMS);
-  INT_SEND_STAT(&st,chmod_func);  
-  
+  INT_SEND_STAT(&st,chmod_func);
+
   /* see chmod() for comment */
   mode |= 0600;
   if(S_ISDIR(st.st_mode))
     mode |= 0100;
-  
+
   r=next_fchmod(fd, mode);
   if(r&&(errno==EPERM))
     r=0;
@@ -935,18 +935,18 @@ int fchmodat(int dir_fd, const char *path, mode_t mode, int flags) {
   /* If AT_SYMLINK_NOFOLLOW is set in the fchownat call it should
      be when we stat it. */
   r=INT_NEXT_FSTATAT(dir_fd, path, &st, flags & AT_SYMLINK_NOFOLLOW);
-  
+
   if(r)
     return(r);
-  
+
   st.st_mode=(mode&ALLPERMS)|(st.st_mode&~ALLPERMS);
-  INT_SEND_STAT(&st,chmod_func);  
-  
+  INT_SEND_STAT(&st,chmod_func);
+
   /* see chmod() for comment */
   mode |= 0600;
   if(S_ISDIR(st.st_mode))
     mode |= 0100;
-  
+
   r=next_fchmodat(dir_fd, path, mode, flags);
   if(r&&(errno==EPERM))
     r=0;
@@ -960,7 +960,7 @@ int fchmodat(int dir_fd, const char *path, mode_t mode, int flags) {
 #endif /* HAVE_FSTATAT */
 
 int WRAP_MKNOD MKNOD_ARG(int ver UNUSED,
-			 const char *pathname, 
+			 const char *pathname,
 			 mode_t mode, dev_t XMKNOD_FRTH_ARG dev)
 {
   INT_STRUCT_STAT st;
@@ -968,16 +968,16 @@ int WRAP_MKNOD MKNOD_ARG(int ver UNUSED,
   int fd,r;
 
   umask(old_mask);
-  
+
   /*Don't bother to mknod the file, that probably doesn't work.
     just create it as normal file, and leave the premissions
     to the fakemode.*/
-  
+
   fd=open(pathname, O_WRONLY|O_CREAT|O_TRUNC, 00644);
 
   if(fd==-1)
     return -1;
-  
+
   close(fd);
   /* get the inode, to communicate with faked */
 
@@ -985,12 +985,12 @@ int WRAP_MKNOD MKNOD_ARG(int ver UNUSED,
 
   if(r)
     return -1;
-  
+
   st.st_mode= mode & ~old_mask;
   st.st_rdev= XMKNOD_FRTH_ARG dev;
-  
+
   INT_SEND_STAT(&st,mknod_func);
-    
+
   return 0;
 }
 
@@ -998,7 +998,7 @@ int WRAP_MKNOD MKNOD_ARG(int ver UNUSED,
 #ifdef HAVE_MKNODAT
 int WRAP_MKNODAT MKNODAT_ARG(int ver UNUSED,
 			     int dir_fd,
-			     const char *pathname, 
+			     const char *pathname,
 			     mode_t mode, dev_t XMKNODAT_FIFTH_ARG dev)
 {
   INT_STRUCT_STAT st;
@@ -1006,7 +1006,7 @@ int WRAP_MKNODAT MKNODAT_ARG(int ver UNUSED,
   int fd,r;
 
   umask(old_mask);
-  
+
   /*Don't bother to mknod the file, that probably doesn't work.
     just create it as normal file, and leave the permissions
     to the fakemode.*/
@@ -1015,7 +1015,7 @@ int WRAP_MKNODAT MKNODAT_ARG(int ver UNUSED,
 
   if(fd==-1)
     return -1;
-  
+
   close(fd);
   /* get the inode, to communicate with faked */
 
@@ -1025,12 +1025,12 @@ int WRAP_MKNODAT MKNODAT_ARG(int ver UNUSED,
 
   if(r)
     return -1;
-  
+
   st.st_mode= mode & ~old_mask;
   st.st_rdev= XMKNODAT_FIFTH_ARG dev;
-  
+
   INT_SEND_STAT(&st,mknod_func);
-    
+
   return 0;
 }
 #endif /* HAVE_MKNODAT */
@@ -1053,15 +1053,15 @@ int mkdir(const char *path, mode_t mode){
     fprintf(stderr, "mkdir path %s\n", path);
   }
 #endif /* LIBFAKEROOT_DEBUGGING */
-  r=next_mkdir(path, mode|0700); 
+  r=next_mkdir(path, mode|0700);
   /* mode|0700: see comment in the chown() function above */
   if(r)
     return -1;
   r=INT_NEXT_STAT(path, &st);
-  
+
   if(r)
     return -1;
-  
+
   st.st_mode=(mode&~old_mask&ALLPERMS)|(st.st_mode&~ALLPERMS)|S_IFDIR;
 
   INT_SEND_STAT(&st, chmod_func);
@@ -1083,7 +1083,7 @@ int mkdirat(int dir_fd, const char *path, mode_t mode){
      to communicate with faked we need a struct stat, so we now
      do a stat of the new directory (just for the inode/dev) */
 
-  r=next_mkdirat(dir_fd, path, mode|0700); 
+  r=next_mkdirat(dir_fd, path, mode|0700);
   /* mode|0700: see comment in the chown() function above */
   if(r)
     return -1;
@@ -1091,7 +1091,7 @@ int mkdirat(int dir_fd, const char *path, mode_t mode){
 
   if(r)
     return -1;
-  
+
   st.st_mode=(mode&~old_mask&ALLPERMS)|(st.st_mode&~ALLPERMS)|S_IFDIR;
 
   INT_SEND_STAT(&st, chmod_func);
@@ -1101,19 +1101,19 @@ int mkdirat(int dir_fd, const char *path, mode_t mode){
 #endif /* HAVE_MKDIRAT */
 #endif /* HAVE_FSTATAT */
 
-/* 
+/*
    The remove funtions: unlink, rmdir, rename.
    These functions can all remove inodes from the system.
    I need to inform faked about the removal of these inodes because
    of the following:
     # rm -f file
-    # touch file 
+    # touch file
     # chown admin file
     # rm file
     # touch file
    In the above example, assuming that for both touch-es, the same
    inode is generated, faked will still report the owner of `file'
-   as `admin', unless it's informed about the removal of the inode.   
+   as `admin', unless it's informed about the removal of the inode.
 */
 
 int unlink(const char *pathname){
@@ -1125,13 +1125,13 @@ int unlink(const char *pathname){
   if(r)
     return -1;
 
-  r=next_unlink(pathname);  
+  r=next_unlink(pathname);
 
   if(r)
     return -1;
-  
+
   INT_SEND_STAT(&st, unlink_func);
-  
+
   return 0;
 }
 
@@ -1148,9 +1148,9 @@ int unlinkat(int dir_fd, const char *pathname, int flags){
 
   if(r)
     return -1;
-  
+
   INT_SEND_STAT(&st, unlink_func);
-  
+
   return 0;
 }
 #endif /* HAVE_UNLINKAT */
@@ -1167,11 +1167,11 @@ int rmdir(const char *pathname){
   r=INT_NEXT_LSTAT(pathname, &st);
   if(r)
     return -1;
-  r=next_rmdir(pathname);  
+  r=next_rmdir(pathname);
   if(r)
     return -1;
 
-  INT_SEND_STAT(&st,unlink_func);  
+  INT_SEND_STAT(&st,unlink_func);
 
   return 0;
 }
@@ -1187,11 +1187,11 @@ int remove(const char *pathname){
   r=INT_NEXT_LSTAT(pathname, &st);
   if(r)
     return -1;
-  r=next_remove(pathname);  
+  r=next_remove(pathname);
   if(r)
     return -1;
-  INT_SEND_STAT(&st,unlink_func);  
-  
+  INT_SEND_STAT(&st,unlink_func);
+
   return r;
 }
 
@@ -1206,9 +1206,9 @@ int remove(const char *pathname){
 
 int rename(const char *oldpath, const char *newpath){
   int r,s;
-  INT_STRUCT_STAT st;     
+  INT_STRUCT_STAT st;
 
-  /* If newpath points to an existing file, that file will be 
+  /* If newpath points to an existing file, that file will be
      unlinked.   Make sure we tell the faked daemon about this! */
 
   /* we need the st_new struct in order to inform faked about the
@@ -1230,9 +1230,9 @@ int rename(const char *oldpath, const char *newpath){
 int renameat(int olddir_fd, const char *oldpath,
              int newdir_fd, const char *newpath){
   int r,s;
-  INT_STRUCT_STAT st;     
+  INT_STRUCT_STAT st;
 
-  /* If newpath points to an existing file, that file will be 
+  /* If newpath points to an existing file, that file will be
      unlinked.   Make sure we tell the faked daemon about this! */
 
   /* we need the st_new struct in order to inform faked about the
diff --git a/libfakeroot_unix2003.c b/libfakeroot_unix2003.c
index 44d12d3..af4dbbe 100644
--- a/libfakeroot_unix2003.c
+++ b/libfakeroot_unix2003.c
@@ -45,7 +45,7 @@
    These INT_* (which stands for internal) macros should always be used when
    the fakeroot library owns the storage of the stat variable.
 */
-#ifdef STAT64_SUPPORT 
+#ifdef STAT64_SUPPORT
 #define INT_STRUCT_STAT struct stat64
 #define INT_NEXT_STAT(a,b) NEXT_STAT64(_STAT_VER,a,b)
 #define INT_NEXT_LSTAT(a,b) NEXT_LSTAT64(_STAT_VER,a,b)
@@ -62,7 +62,7 @@
 #endif
 
 #include <stdio.h>
-#include <unistd.h> 
+#include <unistd.h>
 #include <errno.h>
 #ifdef HAVE_SYS_ACL_H
 #include <sys/acl.h>
@@ -115,11 +115,11 @@ int chmod(const char *path, mode_t mode){
   r=INT_NEXT_STAT(path, &st);
   if(r)
     return r;
-  
+
   st.st_mode=(mode&ALLPERMS)|(st.st_mode&~ALLPERMS);
-    
+
   INT_SEND_STAT(&st, chmod_func);
-  
+
   /* if a file is unwritable, then root can still write to it
      (no matter who owns the file). If we are fakeroot, the only
      way to fake this is to always make the file writable, readable
@@ -131,7 +131,7 @@ int chmod(const char *path, mode_t mode){
   mode |= 0600;
   if(S_ISDIR(st.st_mode))
     mode |= 0100;
-  
+
   r=next_chmod$UNIX2003(path, mode);
   if(r&&(errno==EPERM))
     r=0;
@@ -153,18 +153,18 @@ int fchmod(int fd, mode_t mode){
   }
 #endif /* LIBFAKEROOT_DEBUGGING */
   r=INT_NEXT_FSTAT(fd, &st);
-  
+
   if(r)
     return(r);
-  
+
   st.st_mode=(mode&ALLPERMS)|(st.st_mode&~ALLPERMS);
-  INT_SEND_STAT(&st,chmod_func);  
-  
+  INT_SEND_STAT(&st,chmod_func);
+
   /* see chmod() for comment */
   mode |= 0600;
   if(S_ISDIR(st.st_mode))
     mode |= 0100;
-  
+
   r=next_fchmod$UNIX2003(fd, mode);
   if(r&&(errno==EPERM))
     r=0;
diff --git a/simple.c b/simple.c
index 5de11cc..d56cea9 100644
--- a/simple.c
+++ b/simple.c
@@ -1,5 +1,5 @@
 /* Dummy C program; we use this in the package build process to construct a
- * proper shlibs file for libfakeroot 
+ * proper shlibs file for libfakeroot
  */
 int main(void) {
 	return(0);	

-- 
fakeroot



More information about the Fakeroot-commits mailing list