sync with upstream
[util-vserver.git] / rev2883to2896.patch
1 Index: python/Makefile-files
2 ===================================================================
3 --- python/Makefile-files       (revision 2883)
4 +++ python/Makefile-files       (revision 2896)
5 @@ -1,22 +1,23 @@
6  ## $Id$
7  
8  ## Copyright (C) 2008 Daniel Hokka Zakrisson
9 -## 
10 +##
11  ## This program is free software; you can redistribute it and/or
12  ## modify it under the terms of the GNU General Public License
13  ## as published by the Free Software Foundation; either version 2
14  ## of the License, or (at your option) any later version.
15 -## 
16 +##
17  ## This program is distributed in the hope that it will be useful,
18  ## but WITHOUT ANY WARRANTY; without even the implied warranty of
19  ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  ## GNU General Public License for more details.
21 -## 
22 +##
23  ## You should have received a copy of the GNU General Public License
24  ## along with this program; if not, write to the Free Software
25  ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
26 -## 
27 +##
28  
29 +AM_INSTALLCHECK_STD_OPTIONS_EXEMPT += python/libvserver.py
30  pyexec_LTLIBRARIES             += python/_libvserver.la
31  pyexec_SCRIPTS                 += python/libvserver.py
32  python__libvserver_la_SOURCES  =  python/_libvserver.c
33 Index: src/testsuite/hashcalc-plain.c
34 ===================================================================
35 --- src/testsuite/hashcalc-plain.c      (revision 2883)
36 +++ src/testsuite/hashcalc-plain.c      (revision 2896)
37 @@ -1,16 +1,16 @@
38  // $Id$    --*- c -*--
39  
40  // Copyright (C) 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
41 -//  
42 +//
43  // This program is free software; you can redistribute it and/or modify
44  // it under the terms of the GNU General Public License as published by
45  // the Free Software Foundation; version 2 of the License.
46 -//  
47 +//
48  // This program is distributed in the hope that it will be useful,
49  // but WITHOUT ANY WARRANTY; without even the implied warranty of
50  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
51  // GNU General Public License for more details.
52 -//  
53 +//
54  // You should have received a copy of the GNU General Public License
55  // along with this program; if not, write to the Free Software
56  // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
57 @@ -24,6 +24,7 @@
58  #include <stdbool.h>
59  #include <unistd.h>
60  #include <fcntl.h>
61 +#include <sys/stat.h>
62  #include <sys/mman.h>
63  
64  #define ENSC_TESTSUITE
65 @@ -36,19 +37,19 @@
66  {
67    static char const            HEX_DIGIT[] = "0123456789abcdef";
68    size_t                       d_size   = ensc_crypto_hashctx_get_digestsize(h_ctx);
69 -    
70 +
71    unsigned char                        digest[d_size];
72    size_t                       out = 0;
73  
74    if (ensc_crypto_hashctx_get_digest(h_ctx, digest, NULL, d_size)==-1)
75      return false;
76 -  
77 +
78    for (size_t in=0; in<d_size; ++in) {
79      res[out++]  = HEX_DIGIT[digest[in] >>    4];
80      res[out++]  = HEX_DIGIT[digest[in] &  0x0f];
81    }
82    res[out++] = '\0';
83 -  
84 +
85    return true;
86  }
87  
88 @@ -81,13 +82,13 @@
89      assert(ensc_crypto_hashctx_update(&hash_context, buf, buf_size)!=-1);
90      munmap((void *)(buf), buf_size);
91    }
92 -    
93 +
94    assert(convertDigest(digest, &hash_context));
95 -  
96 +
97    Vwrite(1, digest, strlen(digest));
98    Vwrite(1, "\n", 1);
99 -  
100 +
101    ensc_crypto_hashctx_free(&hash_context);
102 -  
103 +
104    return 0;
105  }
106 Index: src/testsuite/Makefile-files
107 ===================================================================
108 --- src/testsuite/Makefile-files        (revision 2883)
109 +++ src/testsuite/Makefile-files        (revision 2896)
110 @@ -1,16 +1,16 @@
111  ## $Id$                --*- makefile -*--
112  
113  ## Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
114 -##  
115 +##
116  ## This program is free software; you can redistribute it and/or modify
117  ## it under the terms of the GNU General Public License as published by
118  ## the Free Software Foundation; version 2 of the License.
119 -##  
120 +##
121  ## This program is distributed in the hope that it will be useful,
122  ## but WITHOUT ANY WARRANTY; without even the implied warranty of
123  ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
124  ## GNU General Public License for more details.
125 -##  
126 +##
127  ## You should have received a copy of the GNU General Public License
128  ## along with this program; if not, write to the Free Software
129  ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
130 @@ -57,19 +57,22 @@
131                                         src/testsuite/hashcalc-plain.sh \
132                                         src/testsuite/vwait-test.sh
133  
134 +DIETPROGS +=                           src/testsuite/vunify-functest \
135 +                                       src/testsuite/chcontext-test \
136 +                                       src/testsuite/chbind-test \
137 +                                       src/testsuite/rpm-fake-test
138 +
139  src_testsuite_rpm_fake_test_SOURCES =  src/testsuite/rpm-fake-test.c
140  
141  src_testsuite_vunify_functest_SOURCES =        src/testsuite/vunify-functest.c
142  src_testsuite_vunify_functest_LDADD =  $(LIBINTERNAL)
143  src_testsuite_vunify_functest_CPPFLAGS=        $(AM_CPPFLAGS) $(src_testsuite_CPPFLAGS)
144  
145 -
146  src_testsuite_chcontext_test_SOURCES = src/testsuite/chcontext-test.c
147 -src_testsuite_chcontext_test_LDADD =   lib/libvserver.la $(LIBINTERNAL)
148 +src_testsuite_chcontext_test_LDADD =   $(VSERVER_LDADDS) $(LIBINTERNAL)
149  
150 -
151  src_testsuite_chbind_test_SOURCES =    src/testsuite/chbind-test.c
152 -src_testsuite_chbind_test_LDADD =      lib/libvserver.la
153 +src_testsuite_chbind_test_LDADD =      $(LIBVSERVER)
154  
155  src_testsuite_hashcalc_SOURCES =       src/testsuite/hashcalc.c
156  src_testsuite_hashcalc_plain_SOURCES = src/testsuite/hashcalc-plain.c
157 @@ -77,6 +80,9 @@
158  src_testsuite_hashcalc_plain_CFLAGS =  $(AM_CFLAGS) $(ENSC_CRYPTO_CFLAGS)
159  
160  if ENSC_CAN_CRYPTO_WITH_DIETLIBC
161 +DIETPROGS +=                           src/testsuite/hashcalc          \
162 +                                       src/testsuite/hashcalc-plain
163 +
164  src_testsuite_hashcalc_LDADD =         $(LIBINTERNAL) $(LIBENSCVECTOR) $(ENSC_CRYPTO_LIB) $(VSERVER_LDADDS)
165  src_testsuite_hashcalc_LDFLAGS =       $(VSERVER_LDFLGS)
166  
167 Index: src/vcontext.c
168 ===================================================================
169 --- src/vcontext.c      (revision 2883)
170 +++ src/vcontext.c      (revision 2896)
171 @@ -1,16 +1,16 @@
172  // $Id$    --*- c -*--
173  
174  // Copyright (C) 2004-2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
175 -//  
176 +//
177  // This program is free software; you can redistribute it and/or modify
178  // it under the terms of the GNU General Public License as published by
179  // the Free Software Foundation; version 2 of the License.
180 -//  
181 +//
182  // This program is distributed in the hope that it will be useful,
183  // but WITHOUT ANY WARRANTY; without even the implied warranty of
184  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
185  // GNU General Public License for more details.
186 -//  
187 +//
188  // You should have received a copy of the GNU General Public License
189  // along with this program; if not, write to the Free Software
190  // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
191 @@ -21,6 +21,7 @@
192  #endif
193  
194  #include "util.h"
195 +#include "compat-pivot_root.h"
196  #include "lib/internal.h"
197  #include "lib_internal/jail.h"
198  #include "lib_internal/sys_personality.h"
199 @@ -99,9 +100,9 @@
200    { "personality-flags", required_argument, 0, CMD_PERSFLAG },
201    { "vlogin",       no_argument,        0, CMD_VLOGIN },
202    { "pivot-root",   no_argument,        0, CMD_PIVOT_ROOT },
203 -#if 1  
204 +#if 1
205    { "fakeinit",     no_argument,               0, CMD_INITPID },       // compatibility
206 -#endif  
207 +#endif
208    { 0,0,0,0 },
209  };
210  
211 @@ -205,7 +206,7 @@
212  {
213    int                  fd;
214    struct sockaddr_un   addr;
215 -  
216 +
217    if (filename==0) return -1;
218  
219    ENSC_INIT_UNIX_SOCK(addr, filename);
220 @@ -237,7 +238,7 @@
221  doExternalSync(int fd, char const *msg)
222  {
223    char         c;
224 -  
225 +
226    if (fd==-1) return;
227  
228    if (msg) EsendAll(fd, msg, strlen(msg));
229 @@ -256,13 +257,13 @@
230  {
231    int                  p[2][2];
232    pid_t                        pid = initSync(p, args->do_disconnect);
233 -  
234 +
235    if (pid==0) {
236      xid_t                      xid;
237      int                                ext_sync_fd = connectExternalSync(args->sync_sock);
238  
239 -    doSyncStage0(p, args->do_disconnect);  
240 -    
241 +    doSyncStage0(p, args->do_disconnect);
242 +
243      if (args->do_create) {
244        xid = vc_ctx_create(args->xid, NULL);
245        if (xid==VC_NOCTX) {
246 @@ -378,7 +379,7 @@
247    }
248  
249    assert(args->do_disconnect);
250 -    
251 +
252    waitOnSync(pid, p, args->xid!=VC_DYNAMIC_XID && args->do_migrate);
253    return EXIT_SUCCESS;
254  }
255 @@ -430,11 +431,11 @@
256      .personality_flags = 0,
257      .sync_msg          = "ok",
258    };
259 -  
260 +
261    while (1) {
262      int                c = getopt_long(argc, argv, "+", CMDLINE_OPTIONS, 0);
263      if (c==-1) break;
264 -    
265 +
266      switch (c) {
267        case CMD_HELP            :  showHelp(1, argv[0], 0);
268        case CMD_VERSION         :  showVersion();
269 @@ -474,10 +475,10 @@
270    }
271  
272    signal(SIGCHLD, SIG_DFL);
273 -  
274 +
275    if (args.do_migrateself)
276      args.xid = Evc_get_task_xid(0);
277 -  
278 +
279    if (!args.do_create && !args.do_migrate)
280      WRITE_MSG(2, "Neither '--create' nor '--migrate' specified; try '--help' for more information\n");
281    else if (args.do_create  &&  args.do_migrate)
282 Index: scripts/vserver.suexec
283 ===================================================================
284 --- scripts/vserver.suexec      (revision 2883)
285 +++ scripts/vserver.suexec      (revision 2896)
286 @@ -40,7 +40,7 @@
287         "${CHBIND_CMD[@]}" \
288         $_EXEC_ULIMIT "$VSERVER_DIR/ulimits" \
289         ${USE_VNAMESPACE:+$_VNAMESPACE --enter "$S_CONTEXT" -- } \
290 -       $_VSPACE --enter "$S_CONTEXT" "${OPTS_VSPACE[@]}" -- \
291 +       $_VSPACE --enter "$S_CONTEXT" "${OPTS_VSPACE[@]}" "${OPTS_VSPACE_SHARED[@]}" -- \
292         $_VTAG --migrate "${OPTS_VTAG_ENTER[@]}" --silent -- \
293         $_VCONTEXT $SILENT_OPT --migrate $OPT_VCONTEXT_CHROOT \
294           --xid "$S_CONTEXT" --uid "$user" "${OPTS_VCONTEXT_ENTER[@]}" -- \
295 Index: scripts/vserver.stop
296 ===================================================================
297 --- scripts/vserver.stop        (revision 2883)
298 +++ scripts/vserver.stop        (revision 2896)
299 @@ -83,7 +83,7 @@
300      "${IONICE_CMD[@]}" \
301      "${NICE_CMD[@]}" \
302      "${CHBIND_CMD[@]}" \
303 -    "$_VSPACE" --enter "$S_CONTEXT" "${OPTS_VSPACE[@]}" -- \
304 +    "$_VSPACE" --enter "$S_CONTEXT" "${OPTS_VSPACE[@]}" "${OPTS_VSPACE_SHARED[@]}" -- \
305      "$_VTAG" --migrate "${OPTS_VTAG_ENTER[@]}" --silent -- \
306      $_VCONTEXT $SILENT_OPT --migrate $OPT_VCONTEXT_CHROOT --xid "$S_CONTEXT" -- \
307      "${INITCMD_STOP[@]}" || fail=1
308 Index: scripts/vserver.start
309 ===================================================================
310 --- scripts/vserver.start       (revision 2883)
311 +++ scripts/vserver.start       (revision 2896)
312 @@ -136,6 +136,7 @@
313  if $_VSERVER_INFO - FEATURE migrate; then
314      ${IONICE_CMD[@]} \
315      ${NICE_CMD[@]} \
316 +    "${VSPACE_SHARED_CMD[@]}" \
317      "${CHBIND_CMD[@]}" \
318      $_EXEC_ULIMIT "$VSERVER_DIR"/ulimits \
319      $_VTAG       --create "${OPTS_VTAG_CREATE[@]}" --silent -- \
320 @@ -143,7 +144,7 @@
321      $_VCONTEXT   --create "${OPTS_VCONTEXT_CREATE[@]}" -- \
322      ${OPTION_STRACE:+$_STRACE -fF -o /tmp/vserver-start.$$} \
323      ${USE_VNAMESPACE:+$_VNAMESPACE --set -- } \
324 -    $_VSPACE     --set "${OPTS_VSPACE[@]}" -- \
325 +    $_VSPACE     --set "${OPTS_VSPACE[@]}" "${OPTS_VSPACE_SHARED[@]}" -- \
326      $_EXEC_REMOUNT /proc /sys -- \
327      $_VLIMIT     --dir "$VSERVER_DIR"/rlimits --missingok -- \
328      $_VSCHED     --xid self --force "${OPTS_VSCHED[@]}" -- \
329 Index: scripts/vserver.functions
330 ===================================================================
331 --- scripts/vserver.functions   (revision 2883)
332 +++ scripts/vserver.functions   (revision 2896)
333 @@ -49,6 +49,8 @@
334  declare -a OPTS_VTAG_ENTER=()
335  declare -a OPTS_VMEMCTRL=()
336  declare -a OPTS_VSPACE=( --default )
337 +declare -a OPTS_VSPACE_SHARED=()
338 +declare -a VSPACE_SHARED_CMD=()
339  
340  declare -a STOPCMD_PREPARE=()
341  
342 @@ -787,16 +789,30 @@
343  {
344      local vdir="$1"
345      local d="$vdir"/spaces
346 +    local shared
347  
348 -    ( test ! -e "$d"/pid ) || \
349 -       OPTS_VSPACE=( "${OPTS_VSPACE[@]}" --pid )
350 +    if test -e "$d"/pid; then
351 +       getFileValue shared "$d"/pid
352 +       if test -z "$shared"; then
353 +           OPTS_VSPACE=( "${OPTS_VSPACE[@]}" --pid )
354 +       else
355 +           OPTS_VSPACE_SHARED=( "${OPTS_VSPACE_SHARED[@]}" --pid )
356 +           VSPACE_SHARED_CMD=( "${VSPACE_SHARED_CMD[@]}" $_VSPACE --enter "$shared" --pid -- )
357 +       fi
358 +    fi
359  
360 -    test ! -e "$d"/net || {
361 -       OPTS_VSPACE=( "${OPTS_VSPACE[@]}" --net )
362 +    if test -e "$d"/net; then
363 +       getFileValue shared "$d"/net
364         # network context and namespace don't make much sense
365         _HAVE_CHBIND_OPTIONS=1
366         CHBIND_CMD=()
367 -    }
368 +       if test -z "$shared"; then
369 +           OPTS_VSPACE=( "${OPTS_VSPACE[@]}" --net )
370 +       else
371 +           OPTS_VSPACE_SHARED=( "${OPTS_VSPACE_SHARED[@]}" --net )
372 +           VSPACE_SHARED_CMD=( "${VSPACE_SHARED_CMD[@]}" $_VSPACE --enter "$shared" --net -- )
373 +       fi
374 +    fi
375  
376      local mask
377      getFileValue mask "$d"/mask || \
378 Index: configure.ac
379 ===================================================================
380 --- configure.ac        (revision 2883)
381 +++ configure.ac        (revision 2896)
382 @@ -1,27 +1,27 @@
383  dnl $Id$
384  
385  dnl Copyright (C) 2003,2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
386 -dnl  
387 +dnl
388  dnl This program is free software; you can redistribute it and/or modify
389  dnl it under the terms of the GNU General Public License as published by
390  dnl the Free Software Foundation; either version 2, or (at your option)
391  dnl any later version.
392 -dnl  
393 +dnl
394  dnl This program is distributed in the hope that it will be useful,
395  dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
396  dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
397  dnl GNU General Public License for more details.
398 -dnl  
399 +dnl
400  dnl You should have received a copy of the GNU General Public License
401  dnl along with this program; if not, write to the Free Software
402  dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
403 -dnl  
404 -dnl  
405 +dnl
406 +dnl
407  dnl As a special exception to the GNU General Public License, if you
408  dnl distribute this file as part of a program that contains a configuration
409  dnl script generated by Autoconf, you may include it under the same
410  dnl distribution terms that you use for the rest of that program.
411 -dnl  
412 +dnl
413  
414  AC_PREREQ(2.57)
415  AC_INIT(util-vserver, 0.30.215, vserver@list.linux-vserver.org)
416 @@ -78,7 +78,7 @@
417  
418  if test x"$prefix" = x/; then
419         prefix=
420 -fi     
421 +fi
422  
423  ENSC_CHECK_CC_FLAG([-std=c99 -Wall -pedantic -W])
424  ENSC_CHECK_CXX_FLAG([-ansi   -Wall -pedantic -W -fmessage-length=0])
425 @@ -206,8 +206,8 @@
426                [AC_HELP_STRING([--disable-internal-headers],
427                                [use vserver specific headers from the kernel instead of the shipped versions (default: no)])],
428                [case "$enableval" in
429 -                 (yes|no) ;;
430 -                 (*)      AC_MSG_ERROR(['$i' is not a supported value for '--disable-internal-headers']);;
431 +                 (yes|no) ;;
432 +                 (*)      AC_MSG_ERROR(['$i' is not a supported value for '--disable-internal-headers']);;
433                esac],
434                [enable_internal_headers=yes])
435  
436 @@ -258,14 +258,14 @@
437                                 enable_api_oldproc=${enable_api_oldproc:-1}
438                                 enable_api_olduts=${enable_api_olduts:-1}
439                                 ;;
440 -               (v11)           AC_DEFINE(VC_ENABLE_API_V11,      1)
441 +               (v11)           AC_DEFINE(VC_ENABLE_API_V11,      1)
442                                 enable_api_oldproc=${enable_api_oldproc:-1}
443                                 enable_api_olduts=${enable_api_olduts:-1}
444                                 ;;
445                 (fscompat)      AC_DEFINE(VC_ENABLE_API_FSCOMPAT, 1);;
446                 (v13obs)        AC_DEFINE(VC_ENABLE_API_V13OBS,   1)
447                                 AC_DEFINE(VC_ENABLE_API_V13,      1);;
448 -               (v13)           AC_DEFINE(VC_ENABLE_API_V13,      1);;
449 +               (v13)           AC_DEFINE(VC_ENABLE_API_V13,      1);;
450                 (net)           AC_DEFINE(VC_ENABLE_API_NET,      1);;
451                 (v21)           AC_DEFINE(VC_ENABLE_API_V21,      1);;
452                 (v22)           AC_DEFINE(VC_ENABLE_API_V22,      1);;
453 @@ -340,7 +340,7 @@
454                 AC_CHECK_HEADER([beecrypt/beecrypt.h], [ : ],
455                                 [ ensc_have_beecrypt=no ])
456         fi
457 -                       
458 +
459         if test x"$ensc_have_beecrypt" = xyes; then
460                 AC_CHECK_LIB(beecrypt, hashFunctionContextInit, [ : ],
461                              [ ensc_have_beecrypt=no ])
462 @@ -532,7 +532,7 @@
463                 crypto api: $ensc_crypto_api
464            python bindings: $ensc_have_python
465     use library versioning: $ensc_have_versioning
466 -   
467 +
468  Paths:
469                     prefix: $prefix
470          sysconf-Directory: $sysconfdir
471 Index: lib/syscall_setiattr-fscompat.hc
472 ===================================================================
473 --- lib/syscall_setiattr-fscompat.hc    (revision 2883)
474 +++ lib/syscall_setiattr-fscompat.hc    (revision 2896)
475 @@ -1,16 +1,16 @@
476  // $Id$    --*- c -*--
477  
478  // Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
479 -//  
480 +//
481  // This program is free software; you can redistribute it and/or modify
482  // it under the terms of the GNU General Public License as published by
483  // the Free Software Foundation; version 2 of the License.
484 -//  
485 +//
486  // This program is distributed in the hope that it will be useful,
487  // but WITHOUT ANY WARRANTY; without even the implied warranty of
488  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
489  // GNU General Public License for more details.
490 -//  
491 +//
492  // You should have received a copy of the GNU General Public License
493  // along with this program; if not, write to the Free Software
494  // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
495 @@ -26,6 +26,7 @@
496  #include "ioctl-getxflg.hc"
497  
498  #include <fcntl.h>
499 +#include <sys/stat.h>
500  
501  static inline ALWAYSINLINE int
502  vc_set_iattr_fscompat(char const *filename,
503 @@ -38,7 +39,7 @@
504  
505    fd = open(filename, O_RDONLY|O_NONBLOCK);
506    if (fd==-1) return -1;
507 -    
508 +
509    stat_rc = fstat(fd, &st);
510    if (stat_rc==-1) goto err;
511  
512 @@ -60,7 +61,7 @@
513        if (vc_X_set_ext2flags(fd, 0, VC_IMMUTABLE_LINK_FL)==-1 ||
514           fchmod(fd, 0500))
515         goto err;
516 -    }      
517 +    }
518    }
519  
520    if ( (mask&VC_IATTR_XID) &&
521 Index: lib/syscall_getiattr-fscompat.hc
522 ===================================================================
523 --- lib/syscall_getiattr-fscompat.hc    (revision 2883)
524 +++ lib/syscall_getiattr-fscompat.hc    (revision 2896)
525 @@ -1,16 +1,16 @@
526  // $Id$    --*- c -*--
527  
528  // Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
529 -//  
530 +//
531  // This program is free software; you can redistribute it and/or modify
532  // it under the terms of the GNU General Public License as published by
533  // the Free Software Foundation; version 2 of the License.
534 -//  
535 +//
536  // This program is distributed in the hope that it will be useful,
537  // but WITHOUT ANY WARRANTY; without even the implied warranty of
538  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
539  // GNU General Public License for more details.
540 -//  
541 +//
542  // You should have received a copy of the GNU General Public License
543  // along with this program; if not, write to the Free Software
544  // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
545 @@ -25,6 +25,9 @@
546  #include "ioctl-getxflg.hc"
547  
548  #include <fcntl.h>
549 +#include <unistd.h>
550 +#include <sys/stat.h>
551 +
552  static inline ALWAYSINLINE int
553  vc_get_iattr_fscompat(char const *filename,
554                       xid_t    * /*@null@*/ xid,
555 @@ -65,7 +68,7 @@
556  
557    if ( (old_mask&VC_IATTR_BARRIER) && S_ISDIR(st.st_mode)) {
558      long               ext2_flags;
559 -    
560 +
561      *mask  |= VC_IATTR_BARRIER;
562      if ((st.st_mode&0777)==0 &&
563         vc_X_get_ext2flags(fd, &ext2_flags)!=-1 &&
564 @@ -91,5 +94,5 @@
565      close(fd);
566      errno = old_errno;
567      return -1;
568 -  } 
569 +  }
570  }
571 Index: lib_internal/matchlist-initrefserverlist.c
572 ===================================================================
573 --- lib_internal/matchlist-initrefserverlist.c  (revision 2883)
574 +++ lib_internal/matchlist-initrefserverlist.c  (revision 2896)
575 @@ -1,16 +1,16 @@
576  // $Id$    --*- c -*--
577  
578  // Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
579 -//  
580 +//
581  // This program is free software; you can redistribute it and/or modify
582  // it under the terms of the GNU General Public License as published by
583  // the Free Software Foundation; version 2 of the License.
584 -//  
585 +//
586  // This program is distributed in the hope that it will be useful,
587  // but WITHOUT ANY WARRANTY; without even the implied warranty of
588  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
589  // GNU General Public License for more details.
590 -//  
591 +//
592  // You should have received a copy of the GNU General Public License
593  // along with this program; if not, write to the Free Software
594  // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
595 @@ -26,6 +26,7 @@
596  #include <dirent.h>
597  #include <string.h>
598  #include <fcntl.h>
599 +#include <sys/stat.h>
600  
601  #define ENSC_WRAPPERS_FCNTL    1
602  #define ENSC_WRAPPERS_UNISTD   1
603 @@ -45,7 +46,7 @@
604    int                  cur_dir = Eopen(".", O_RDONLY, 0);
605    struct dirent                **entries;
606    int                  count,i;
607 -  
608 +
609    Echdir(dir);
610    count = scandir(".", &entries, selectRefserver, alphasort);
611    if (count==-1) {
612 @@ -61,7 +62,7 @@
613    *lst = Emalloc(sizeof(struct MatchList) * count);
614    *cnt = count;
615    for (i=0; i<count; ++i) {
616 -    char const                         *tmp   = entries[i]->d_name;
617 +    char const                 *tmp   = entries[i]->d_name;
618      size_t                     l      = strlen(tmp);
619      char                       vname[sizeof("./") + l];
620      struct MatchVserverInfo    vserver = {
621 @@ -71,7 +72,7 @@
622  
623      memcpy(vname,   "./", 2);
624      memcpy(vname+2, tmp,  l+1);
625 -    
626 +
627      if (!MatchVserverInfo_init(&vserver)) {
628        WRITE_MSG(2, "failed to initialize unification of reference vserver\n");
629        exit(1);
630 Index: ensc_vector/testsuite/Makefile-files
631 ===================================================================
632 --- ensc_vector/testsuite/Makefile-files        (revision 2883)
633 +++ ensc_vector/testsuite/Makefile-files        (revision 2896)
634 @@ -1,16 +1,16 @@
635  ## $Id$                --*- makefile -*--
636  
637  ## Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
638 -##  
639 +##
640  ## This program is free software; you can redistribute it and/or modify
641  ## it under the terms of the GNU General Public License as published by
642  ## the Free Software Foundation; version 2 of the License.
643 -##  
644 +##
645  ## This program is distributed in the hope that it will be useful,
646  ## but WITHOUT ANY WARRANTY; without even the implied warranty of
647  ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
648  ## GNU General Public License for more details.
649 -##  
650 +##
651  ## You should have received a copy of the GNU General Public License
652  ## along with this program; if not, write to the Free Software
653  ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
654 @@ -21,6 +21,9 @@
655  TESTS +=                       ensc_vector/testsuite/test1 \
656                                 ensc_vector/testsuite/test2
657  
658 +DIETPROGS +=                   ensc_vector/testsuite/test1 \
659 +                               ensc_vector/testsuite/test2
660 +
661  ensc_vector_testsuite_test1_SOURCES =  ensc_vector/testsuite/test1.c
662  ensc_vector_testsuite_test1_LDADD =    $(LIBENSCVECTOR)
663