[BACK]Return to t_unpriv.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / tests / fs / vfs

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/tests/fs/vfs/t_unpriv.c between version 1.10 and 1.11

version 1.10, 2013/03/16 05:45:37 version 1.11, 2014/08/29 17:39:18
Line 31 
Line 31 
   
 #include <atf-c.h>  #include <atf-c.h>
 #include <libgen.h>  #include <libgen.h>
   #include <limits.h>
 #include <unistd.h>  #include <unistd.h>
   
 #include <rump/rump_syscalls.h>  #include <rump/rump_syscalls.h>
Line 127  times(const atf_tc_t *tc, const char *mp
Line 128  times(const atf_tc_t *tc, const char *mp
 {  {
         const char *name = "file.test";          const char *name = "file.test";
         int fd;          int fd;
           unsigned int i, j;
         struct timeval tmv[2];          struct timeval tmv[2];
           static struct timeval tmvs[] = {
                   { QUAD_MIN, 0 },
                   { 0, 0 },
                   { QUAD_MAX, 999999 }
           };
   
         FSTEST_ENTER();          FSTEST_ENTER();
   
Line 148  times(const atf_tc_t *tc, const char *mp
Line 155  times(const atf_tc_t *tc, const char *mp
         if (rump_sys_utimes(name, NULL) == -1)          if (rump_sys_utimes(name, NULL) == -1)
                 atf_tc_fail_errno("utimes");                  atf_tc_fail_errno("utimes");
   
         rump_pub_lwproc_rfork(RUMP_RFCFDG);          for (i = 0; i < sizeof(tmvs) / sizeof(tmvs[0]); i++) {
         if (rump_sys_setuid(1) == -1)                  for (j = 0; j < sizeof(tmvs) / sizeof(tmvs[0]); j++) {
                 atf_tc_fail_errno("setuid");                          tmv[0] = tmvs[i];
         if (rump_sys_utimes(name, tmv) != -1 || errno != EPERM)                          tmv[1] = tmvs[j];
                 atf_tc_fail_errno("utimes");                          rump_pub_lwproc_rfork(RUMP_RFCFDG);
         rump_pub_lwproc_releaselwp();                          if (rump_sys_setuid(1) == -1)
                                   atf_tc_fail_errno("setuid");
         if (rump_sys_utimes(name, tmv) == -1)                          if (rump_sys_utimes(name, tmv) != -1 || errno != EPERM)
                 atf_tc_fail_errno("utimes");                                  atf_tc_fail_errno("utimes");
                           rump_pub_lwproc_releaselwp();
   
                           if (rump_sys_utimes(name, tmv) == -1)
                                   atf_tc_fail_errno("utimes");
                   }
           }
   
         if (rump_sys_unlink(name) == -1)          if (rump_sys_unlink(name) == -1)
                 atf_tc_fail_errno("unlink");                  atf_tc_fail_errno("unlink");

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

CVSweb <webmaster@jp.NetBSD.org>