change log for rtems (2010-07-01)
rtems-vc at rtems.org
rtems-vc at rtems.org
Thu Jul 1 18:14:46 UTC 2010
*joel*:
2010-07-01 Vinu Rajashekhar <vinutheraj at gmail.com>
PR 1597/cpukit
* libcsupport/Makefile.am, libcsupport/src/chown.c: Add lchown() and
utimes().
* libcsupport/src/lchown.c, libcsupport/src/utimes.c: New files.
M 1.2484 cpukit/ChangeLog
M 1.124 cpukit/libcsupport/Makefile.am
M 1.14 cpukit/libcsupport/src/chown.c
A 1.1 cpukit/libcsupport/src/lchown.c
A 1.1 cpukit/libcsupport/src/utimes.c
diff -u rtems/cpukit/ChangeLog:1.2483 rtems/cpukit/ChangeLog:1.2484
--- rtems/cpukit/ChangeLog:1.2483 Thu Jul 1 11:29:16 2010
+++ rtems/cpukit/ChangeLog Thu Jul 1 12:22:00 2010
@@ -1,5 +1,12 @@
2010-07-01 Vinu Rajashekhar <vinutheraj at gmail.com>
+ PR 1597/cpukit
+ * libcsupport/Makefile.am, libcsupport/src/chown.c: Add lchown() and
+ utimes().
+ * libcsupport/src/lchown.c, libcsupport/src/utimes.c: New files.
+
+2010-07-01 Vinu Rajashekhar <vinutheraj at gmail.com>
+
PR 1529/cpukit
* utime.c: Change file access time and modified time to
current time if pointer to struct utimbuf is NULL.
diff -u rtems/cpukit/libcsupport/Makefile.am:1.123 rtems/cpukit/libcsupport/Makefile.am:1.124
--- rtems/cpukit/libcsupport/Makefile.am:1.123 Wed Jun 30 10:36:47 2010
+++ rtems/cpukit/libcsupport/Makefile.am Thu Jul 1 12:22:02 2010
@@ -62,7 +62,7 @@
src/link.c src/unlink.c src/umask.c src/ftruncate.c src/utime.c src/fstat.c \
src/fcntl.c src/fpathconf.c src/getdents.c src/fsync.c src/fdatasync.c \
src/pipe.c src/dup.c src/dup2.c src/symlink.c src/readlink.c src/creat.c \
- src/chroot.c src/sync.c src/_rename_r.c src/statvfs.c
+ src/chroot.c src/sync.c src/_rename_r.c src/statvfs.c src/utimes.c src/lchown.c
## Until sys/uio.h is moved to libcsupport, we have to have networking
## enabled to compile these. Hopefully this is a temporary situation.
diff -u rtems/cpukit/libcsupport/src/chown.c:1.13 rtems/cpukit/libcsupport/src/chown.c:1.14
--- rtems/cpukit/libcsupport/src/chown.c:1.13 Thu Jul 1 10:12:36 2010
+++ rtems/cpukit/libcsupport/src/chown.c Thu Jul 1 12:22:03 2010
@@ -24,16 +24,17 @@
#include <rtems/libio_.h>
#include <rtems/seterr.h>
-int chown(
+int _chown_helper(
const char *path,
uid_t owner,
- gid_t group
+ gid_t group,
+ int follow_link
)
{
rtems_filesystem_location_info_t loc;
int result;
- if ( rtems_filesystem_evaluate_path( path, strlen( path ), 0x00, &loc, true ) )
+ if ( rtems_filesystem_evaluate_path( path, strlen( path ), 0x00, &loc, follow_link ) )
return -1;
result = (*loc.ops->chown_h)( &loc, owner, group );
@@ -42,3 +43,12 @@
return result;
}
+
+int chown(
+ const char *path,
+ uid_t owner,
+ gid_t group
+)
+{
+ return _chown_helper( path, owner, group, true );
+}
diff -u /dev/null rtems/cpukit/libcsupport/src/lchown.c:1.1
--- /dev/null Thu Jul 1 13:14:43 2010
+++ rtems/cpukit/libcsupport/src/lchown.c Thu Jul 1 12:22:03 2010
@@ -0,0 +1,31 @@
+/*
+ * lchown() - POSIX 1003.1b 5.6.5 - Change Owner and Group of a File
+ * But Do Not Follow a Symlink
+ *
+ * Written by: Vinu Rajashekhar <vinutheraj at gmail.com>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <sys/stat.h>
+
+#include <rtems.h>
+
+int _chown_helper( const char *path, uid_t owner, gid_t group, int follow_link);
+
+int lchown(
+ const char *path,
+ uid_t owner,
+ gid_t group
+)
+{
+ return _chown_helper( path, owner, group, false );
+}
diff -u /dev/null rtems/cpukit/libcsupport/src/utimes.c:1.1
--- /dev/null Thu Jul 1 13:14:43 2010
+++ rtems/cpukit/libcsupport/src/utimes.c Thu Jul 1 12:22:03 2010
@@ -0,0 +1,33 @@
+/*
+ * Written by: Vinu Rajashekhar <vinutheraj at gmail.com>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <sys/types.h>
+#include <utime.h>
+#include <sys/time.h>
+
+int utimes(
+ const char *path,
+ const struct timeval times[2]
+)
+{
+ struct utimbuf timeinsecs;
+
+ if ( times == NULL )
+ return utime( path, NULL );
+
+ timeinsecs.actime = (time_t) times[0].tv_sec;
+ timeinsecs.modtime = (time_t) times[1].tv_sec;
+
+ return utime( path, &timeinsecs );
+}
*joel*:
2010-07-01 Vinu Rajashekhar <vinutheraj at gmail.com>
PR 1597/cpukit
* psx13/psx13.scn, psx13/test.c, psxstat/psxstat.scn,
psxstat/test.c: Add lchown() and utimes().
M 1.279 testsuites/psxtests/ChangeLog
M 1.7 testsuites/psxtests/psx13/psx13.scn
M 1.14 testsuites/psxtests/psx13/test.c
M 1.10 testsuites/psxtests/psxstat/psxstat.scn
M 1.27 testsuites/psxtests/psxstat/test.c
diff -u rtems/testsuites/psxtests/ChangeLog:1.278 rtems/testsuites/psxtests/ChangeLog:1.279
--- rtems/testsuites/psxtests/ChangeLog:1.278 Thu Jul 1 09:40:08 2010
+++ rtems/testsuites/psxtests/ChangeLog Thu Jul 1 12:24:35 2010
@@ -1,3 +1,9 @@
+2010-07-01 Vinu Rajashekhar <vinutheraj at gmail.com>
+
+ PR 1597/cpukit
+ * psx13/psx13.scn, psx13/test.c, psxstat/psxstat.scn,
+ psxstat/test.c: Add lchown() and utimes().
+
2010-07-01 Joel Sherrill <joel.sherrill at oarcorp.com>
* Makefile.am, configure.ac: Add tests for file lock stubs as well as
diff -u rtems/testsuites/psxtests/psx13/psx13.scn:1.6 rtems/testsuites/psxtests/psx13/psx13.scn:1.7
--- rtems/testsuites/psxtests/psx13/psx13.scn:1.6 Mon Dec 28 10:43:10 2009
+++ rtems/testsuites/psxtests/psx13/psx13.scn Thu Jul 1 12:23:47 2010
@@ -7,6 +7,7 @@
Testing fdatasync()...... Success.
Testing umask().......... Success.
Testing utime().......... Success.
+Testing utimes().......... Success.
Testing pipe()........... Success.
Testing pipe() with NULL........... Failed!!!
Testing fsync().......... Success.
diff -u rtems/testsuites/psxtests/psx13/test.c:1.13 rtems/testsuites/psxtests/psx13/test.c:1.14
--- rtems/testsuites/psxtests/psx13/test.c:1.13 Mon Dec 28 10:43:10 2009
+++ rtems/testsuites/psxtests/psx13/test.c Thu Jul 1 12:23:47 2010
@@ -14,6 +14,7 @@
* pipe - test implemented
* umask - test implemented
* utime - test implemented
+ * utimes - test implemented
*
* COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
@@ -44,6 +45,7 @@
int FDataSyncTest(void);
int UMaskTest(void);
int UTimeTest(void);
+int UTimesTest(void);
int PipeTest(void);
int PipeTestNull(void);
int PathConfTest(void);
@@ -427,6 +429,66 @@
}
/* ---------------------------------------------------------------
+ * UTimesTest function
+ *
+ * Hits the utimes code. Does NOT test the functionality of the underlying utime
+ * entry in the IMFS op table.
+ *
+ * arguments: none
+ * assumptions: utimes function available.
+ * actions: set utimes for an invalid filename.
+ * set utimes for a valid filename.
+ *
+ * returns: TRUE if time on valid file is set correctly and utimes failed on
+ * an invalid filename.
+ * FALSE otherwise.
+ *
+ * ---------------------------------------------------------------
+ */
+
+int UTimesTest (void)
+{
+ int error = 0, retval = FALSE;
+ struct timeval time[2];
+ struct stat fstat;
+
+ /* First, an invalid filename. */
+ error = utimes("!This is an =invalid p at thname!!! :)", NULL);
+
+ if (error == -1)
+ retval = TRUE;
+ else
+ retval = FALSE;
+
+ /* Now, the success test. */
+ if (retval == TRUE) {
+
+ time[0].tv_sec = 12345;
+ time[1].tv_sec = 54321;
+
+ error = utimes("testfile1.tst", &time);
+
+ if (error == 0) {
+
+ /* But, did it set the time? */
+ stat ("testfile1.tst", &fstat);
+
+ if ((fstat.st_atime == 12345) && (fstat.st_mtime == 54321 ))
+ retval = TRUE;
+ else
+ retval = FALSE;
+ }
+
+ else
+ retval = FALSE;
+ }
+
+ /* assert (retval == TRUE);*/
+
+ return (retval);
+}
+
+/* ---------------------------------------------------------------
* PipeTest function
*
* Hits the pipe code.
@@ -663,6 +725,12 @@
else
printf ("Failed!!!\n");
+ printf ("Testing utimes().......... ");
+ if (UTimesTest() == TRUE)
+ printf ("Success.\n");
+ else
+ printf ("Failed!!!\n");
+
printf ("Testing pipe()........... ");
if (PipeTest() == TRUE)
printf ("Success.\n");
diff -u rtems/testsuites/psxtests/psxstat/psxstat.scn:1.9 rtems/testsuites/psxtests/psxstat/psxstat.scn:1.10
--- rtems/testsuites/psxtests/psxstat/psxstat.scn:1.9 Thu Jun 18 11:19:53 2009
+++ rtems/testsuites/psxtests/psxstat/psxstat.scn Thu Jul 1 12:23:47 2010
@@ -1,5 +1,5 @@
*** STAT TEST 01 ***
---->Current Time: - rtems_clock_get - 09:00:00 12/31/1988
+--->Current Time: - rtems_clock_get_tod - 09:00:00 12/31/1988
Making directory /my_mount_point/dir1
Making directory /my_mount_point/dir2
Making directory /my_mount_point/dir3
@@ -60,8 +60,10 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:00 1988
+...st_blksize 0
+...st_blocks 0
stat( ////my_mount_point/dir1/\//file1\\// ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino b
...st_mode 100004
...st_nlink 3
@@ -72,8 +74,10 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:10 1988
+...st_blksize 0
+...st_blocks 0
stat( /my_mount_point/dir1/\\/file2 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino c
...st_mode 100004
...st_nlink 3
@@ -84,8 +88,10 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:10 1988
+...st_blksize 0
+...st_blocks 0
stat( /my_mount_point/dir1/file3/////\\\ ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino d
...st_mode 100004
...st_nlink 3
@@ -96,8 +102,10 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:10 1988
+...st_blksize 0
+...st_blocks 0
stat( /my_mount_point/dir1/file4 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino e
...st_mode 100004
...st_nlink 3
@@ -108,8 +116,10 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:10 1988
+...st_blksize 0
+...st_blocks 0
stat( /my_mount_point/dir1/dir1/file1 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino f
...st_mode 100004
...st_nlink 3
@@ -120,8 +130,10 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:10 1988
+...st_blksize 0
+...st_blocks 0
stat( /my_mount_point/dir1/dir1/ file1 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino 10
...st_mode 100004
...st_nlink 3
@@ -132,6 +144,8 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:10 1988
+...st_blksize 0
+...st_blocks 0
stat( /my_mount_point/dir1 ) returned
...st_dev (0x0:0x0)
...st_ino 3
@@ -140,10 +154,12 @@
...st_uid 0
...st_gid 0
...st_rdev (0x0:0x0)
-...st_size 1608
+...st_size 3140
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( /my_mount_point/dir2//////\ ) returned
...st_dev (0x0:0x0)
...st_ino 4
@@ -156,6 +172,8 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( /my_mount_point/dir3 ) returned
...st_dev (0x0:0x0)
...st_ino 5
@@ -168,6 +186,8 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( /my_mount_point/dir4 ) returned
...st_dev (0x0:0x0)
...st_ino 6
@@ -180,6 +200,8 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( /my_mount_point/dir1/dir1 ) returned
...st_dev (0x0:0x0)
...st_ino 7
@@ -188,10 +210,12 @@
...st_uid 0
...st_gid 0
...st_rdev (0x0:0x0)
-...st_size 536
+...st_size 1040
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( /my_mount_point/dir1/ dir1///\\ ) returned
...st_dev (0x0:0x0)
...st_ino 8
@@ -204,6 +228,8 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( /my_mount_point/\/\/\/\/\/\/links\/\/\/\/\/\ ) returned
...st_dev (0x0:0x0)
...st_ino 9
@@ -212,10 +238,12 @@
...st_uid 0
...st_gid 0
...st_rdev (0x0:0x0)
-...st_size 6968
+...st_size 15640
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
Doing the stat() on all the good relative paths
stat( dev ) returned
@@ -230,8 +258,10 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:00 1988
+...st_blksize 0
+...st_blocks 0
stat( dir1/\//file1\\// ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino b
...st_mode 100004
...st_nlink 3
@@ -242,8 +272,10 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:10 1988
+...st_blksize 0
+...st_blocks 0
stat( dir1/\\/file2 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino c
...st_mode 100004
...st_nlink 3
@@ -254,8 +286,10 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:10 1988
+...st_blksize 0
+...st_blocks 0
stat( dir1/file3/////\\\ ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino d
...st_mode 100004
...st_nlink 3
@@ -266,8 +300,10 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:10 1988
+...st_blksize 0
+...st_blocks 0
stat( dir1/file4 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino e
...st_mode 100004
...st_nlink 3
@@ -278,8 +314,10 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:10 1988
+...st_blksize 0
+...st_blocks 0
stat( dir1/dir1/file1 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino f
...st_mode 100004
...st_nlink 3
@@ -290,8 +328,10 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:10 1988
+...st_blksize 0
+...st_blocks 0
stat( dir1/dir1/ file1 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino 10
...st_mode 100004
...st_nlink 3
@@ -302,6 +342,8 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:10 1988
+...st_blksize 0
+...st_blocks 0
stat( dir1 ) returned
...st_dev (0x0:0x0)
...st_ino 3
@@ -310,10 +352,12 @@
...st_uid 0
...st_gid 0
...st_rdev (0x0:0x0)
-...st_size 1608
+...st_size 3140
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( dir2//////\ ) returned
...st_dev (0x0:0x0)
...st_ino 4
@@ -326,6 +370,8 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( dir3 ) returned
...st_dev (0x0:0x0)
...st_ino 5
@@ -338,6 +384,8 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( dir4 ) returned
...st_dev (0x0:0x0)
...st_ino 6
@@ -350,6 +398,8 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( dir1/dir1 ) returned
...st_dev (0x0:0x0)
...st_ino 7
@@ -358,10 +408,12 @@
...st_uid 0
...st_gid 0
...st_rdev (0x0:0x0)
-...st_size 536
+...st_size 1040
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( dir1/ dir1///\\ ) returned
...st_dev (0x0:0x0)
...st_ino 8
@@ -374,8 +426,10 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( main.c ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino 11
...st_mode 100004
...st_nlink 1
@@ -386,6 +440,8 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:00 1988
+...st_blksize 0
+...st_blocks 0
chdir to dev
@@ -416,10 +472,12 @@
...st_uid 0
...st_gid 0
...st_rdev (0x0:0x0)
-...st_size 1608
+...st_size 3140
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( links/dir2 ) returned
...st_dev (0x0:0x0)
...st_ino 4
@@ -432,6 +490,8 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( links/dir3 ) returned
...st_dev (0x0:0x0)
...st_ino 5
@@ -444,6 +504,8 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( links/dir4 ) returned
...st_dev (0x0:0x0)
...st_ino 6
@@ -456,6 +518,8 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( links/dir1_dir1 ) returned
...st_dev (0x0:0x0)
...st_ino 7
@@ -464,10 +528,12 @@
...st_uid 0
...st_gid 0
...st_rdev (0x0:0x0)
-...st_size 536
+...st_size 1040
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( links/dir1_ dir1 ) returned
...st_dev (0x0:0x0)
...st_ino 8
@@ -480,6 +546,8 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( links/../links/../links/links ) returned
...st_dev (0x0:0x0)
...st_ino 9
@@ -488,12 +556,14 @@
...st_uid 0
...st_gid 0
...st_rdev (0x0:0x0)
-...st_size 6968
+...st_size 15640
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( links/dir1_file1 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino b
...st_mode 100004
...st_nlink 3
@@ -504,8 +574,10 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:10 1988
+...st_blksize 0
+...st_blocks 0
stat( links/dir1_file2 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino c
...st_mode 100004
...st_nlink 3
@@ -516,8 +588,10 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:10 1988
+...st_blksize 0
+...st_blocks 0
stat( links/dir1_file3 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino d
...st_mode 100004
...st_nlink 3
@@ -528,8 +602,10 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:10 1988
+...st_blksize 0
+...st_blocks 0
stat( links/dir1_file4 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino e
...st_mode 100004
...st_nlink 3
@@ -540,8 +616,10 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:10 1988
+...st_blksize 0
+...st_blocks 0
stat( links/dir1_dir1_f1 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino f
...st_mode 100004
...st_nlink 3
@@ -552,8 +630,10 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:10 1988
+...st_blksize 0
+...st_blocks 0
stat( links/dir1_dir1 f1 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino 10
...st_mode 100004
...st_nlink 3
@@ -564,6 +644,8 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:10 1988
+...st_blksize 0
+...st_blocks 0
stat( links/links/links/links_dir1 ) returned
...st_dev (0x0:0x0)
...st_ino 3
@@ -572,10 +654,12 @@
...st_uid 0
...st_gid 0
...st_rdev (0x0:0x0)
-...st_size 1608
+...st_size 3140
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( links//links_dir2 ) returned
...st_dev (0x0:0x0)
...st_ino 4
@@ -588,6 +672,8 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( links//links_dir3 ) returned
...st_dev (0x0:0x0)
...st_ino 5
@@ -600,6 +686,8 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( links//links_dir4 ) returned
...st_dev (0x0:0x0)
...st_ino 6
@@ -612,6 +700,8 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( links//links_dir1_d1 ) returned
...st_dev (0x0:0x0)
...st_ino 7
@@ -620,10 +710,12 @@
...st_uid 0
...st_gid 0
...st_rdev (0x0:0x0)
-...st_size 536
+...st_size 1040
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( links//links_dir1 d1 ) returned
...st_dev (0x0:0x0)
...st_ino 8
@@ -636,6 +728,8 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( links//links_links ) returned
...st_dev (0x0:0x0)
...st_ino 9
@@ -644,12 +738,14 @@
...st_uid 0
...st_gid 0
...st_rdev (0x0:0x0)
-...st_size 6968
+...st_size 15640
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
stat( links///links_d1_file1 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino b
...st_mode 100004
...st_nlink 3
@@ -660,8 +756,10 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:10 1988
+...st_blksize 0
+...st_blocks 0
stat( links///links_d1_file2 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino c
...st_mode 100004
...st_nlink 3
@@ -672,8 +770,10 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:10 1988
+...st_blksize 0
+...st_blocks 0
stat( links///links_d1_file3 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino d
...st_mode 100004
...st_nlink 3
@@ -684,8 +784,10 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:10 1988
+...st_blksize 0
+...st_blocks 0
stat( links///links_d1_file4 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino e
...st_mode 100004
...st_nlink 3
@@ -696,8 +798,10 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:10 1988
+...st_blksize 0
+...st_blocks 0
stat( links///links_d1_d1_f1 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino f
...st_mode 100004
...st_nlink 3
@@ -708,8 +812,10 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:10 1988
+...st_blksize 0
+...st_blocks 0
stat( links///links_r1_d1 f1 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino 10
...st_mode 100004
...st_nlink 3
@@ -720,6 +826,8 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:10 1988
+...st_blksize 0
+...st_blocks 0
chmod of /my_mount_point/dir1/dir1 to Read/Write
Doing the stat() on all the bad paths
@@ -744,7 +852,7 @@
Making file /my_mount_point/symlinks/links
Verify with readlink
stat( /my_mount_point/symlinks/a_file_symlink ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino b
...st_mode 100004
...st_nlink 3
@@ -755,6 +863,22 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:10 1988
+...st_blksize 0
+...st_blocks 0
+lstat( /my_mount_point/symlinks/a_file_symlink ) returned
+...st_dev (0xfffe:0x1)
+...st_ino 2c
+...st_mode 120755
+...st_nlink 1
+...st_uid 0
+...st_gid 0
+...st_rdev (0x0:0x0)
+...st_size 0
+...st_atime Sat Dec 31 09:00:15 1988
+...st_mtime Sat Dec 31 09:00:15 1988
+...st_ctime Sat Dec 31 09:00:15 1988
+...st_blksize 0
+...st_blocks 0
stat( /my_mount_point/symlinks/a_dir_symlink ) returned
...st_dev (0x0:0x0)
...st_ino 3
@@ -763,10 +887,26 @@
...st_uid 0
...st_gid 0
...st_rdev (0x0:0x0)
-...st_size 1876
+...st_size 3560
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
+lstat( /my_mount_point/symlinks/a_dir_symlink ) returned
+...st_dev (0xfffe:0x1)
+...st_ino 2d
+...st_mode 120755
+...st_nlink 1
+...st_uid 0
+...st_gid 0
+...st_rdev (0x0:0x0)
+...st_size 0
+...st_atime Sat Dec 31 09:00:15 1988
+...st_mtime Sat Dec 31 09:00:15 1988
+...st_ctime Sat Dec 31 09:00:15 1988
+...st_blksize 0
+...st_blocks 0
stat( /my_mount_point/symlinks/a_link_symlink ) returned
...st_dev (0x0:0x0)
...st_ino 3
@@ -775,11 +915,41 @@
...st_uid 0
...st_gid 0
...st_rdev (0x0:0x0)
-...st_size 1876
+...st_size 3560
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
+lstat( /my_mount_point/symlinks/a_link_symlink ) returned
+...st_dev (0xfffe:0x1)
+...st_ino 2e
+...st_mode 120755
+...st_nlink 1
+...st_uid 0
+...st_gid 0
+...st_rdev (0x0:0x0)
+...st_size 0
+...st_atime Sat Dec 31 09:00:15 1988
+...st_mtime Sat Dec 31 09:00:15 1988
+...st_ctime Sat Dec 31 09:00:15 1988
+...st_blksize 0
+...st_blocks 0
stat( ../symlinks/no_file ) returned : No such file or directory
+lstat( ../symlinks/no_file ) returned
+...st_dev (0xfffe:0x1)
+...st_ino 2f
+...st_mode 120755
+...st_nlink 1
+...st_uid 0
+...st_gid 0
+...st_rdev (0x0:0x0)
+...st_size 0
+...st_atime Sat Dec 31 09:00:15 1988
+...st_mtime Sat Dec 31 09:00:15 1988
+...st_ctime Sat Dec 31 09:00:15 1988
+...st_blksize 0
+...st_blocks 0
stat( /my_mount_point/symlinks/a_dir_symlink/a_file_symlink ) returned
...st_dev (0x0:0x0)
...st_ino 3
@@ -788,10 +958,26 @@
...st_uid 0
...st_gid 0
...st_rdev (0x0:0x0)
-...st_size 1876
+...st_size 3560
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:05 1988
+...st_blksize 0
+...st_blocks 0
+lstat( /my_mount_point/symlinks/a_dir_symlink/a_file_symlink ) returned
+...st_dev (0xfffe:0x1)
+...st_ino 30
+...st_mode 120755
+...st_nlink 1
+...st_uid 0
+...st_gid 0
+...st_rdev (0x0:0x0)
+...st_size 0
+...st_atime Sat Dec 31 09:00:15 1988
+...st_mtime Sat Dec 31 09:00:15 1988
+...st_ctime Sat Dec 31 09:00:15 1988
+...st_blksize 0
+...st_blocks 0
Making file 1
Verify with readlink
Making file 2
@@ -811,14 +997,140 @@
Making file 9
Verify with readlink
stat( 1 ) returned : No such file or directory
+lstat( 1 ) returned
+...st_dev (0xfffe:0x1)
+...st_ino 32
+...st_mode 120755
+...st_nlink 1
+...st_uid 0
+...st_gid 0
+...st_rdev (0x0:0x0)
+...st_size 0
+...st_atime Sat Dec 31 09:00:15 1988
+...st_mtime Sat Dec 31 09:00:15 1988
+...st_ctime Sat Dec 31 09:00:15 1988
+...st_blksize 0
+...st_blocks 0
stat( 2 ) returned : No such file or directory
+lstat( 2 ) returned
+...st_dev (0xfffe:0x1)
+...st_ino 33
+...st_mode 120755
+...st_nlink 1
+...st_uid 0
+...st_gid 0
+...st_rdev (0x0:0x0)
+...st_size 0
+...st_atime Sat Dec 31 09:00:15 1988
+...st_mtime Sat Dec 31 09:00:15 1988
+...st_ctime Sat Dec 31 09:00:15 1988
+...st_blksize 0
+...st_blocks 0
stat( 3 ) returned : No such file or directory
+lstat( 3 ) returned
+...st_dev (0xfffe:0x1)
+...st_ino 34
+...st_mode 120755
+...st_nlink 1
+...st_uid 0
+...st_gid 0
+...st_rdev (0x0:0x0)
+...st_size 0
+...st_atime Sat Dec 31 09:00:15 1988
+...st_mtime Sat Dec 31 09:00:15 1988
+...st_ctime Sat Dec 31 09:00:15 1988
+...st_blksize 0
+...st_blocks 0
stat( 4 ) returned : No such file or directory
+lstat( 4 ) returned
+...st_dev (0xfffe:0x1)
+...st_ino 35
+...st_mode 120755
+...st_nlink 1
+...st_uid 0
+...st_gid 0
+...st_rdev (0x0:0x0)
+...st_size 0
+...st_atime Sat Dec 31 09:00:15 1988
+...st_mtime Sat Dec 31 09:00:15 1988
+...st_ctime Sat Dec 31 09:00:15 1988
+...st_blksize 0
+...st_blocks 0
stat( 5 ) returned : No such file or directory
+lstat( 5 ) returned
+...st_dev (0xfffe:0x1)
+...st_ino 36
+...st_mode 120755
+...st_nlink 1
+...st_uid 0
+...st_gid 0
+...st_rdev (0x0:0x0)
+...st_size 0
+...st_atime Sat Dec 31 09:00:15 1988
+...st_mtime Sat Dec 31 09:00:15 1988
+...st_ctime Sat Dec 31 09:00:15 1988
+...st_blksize 0
+...st_blocks 0
stat( 6 ) returned : Too many symbolic links
+lstat( 6 ) returned
+...st_dev (0xfffe:0x1)
+...st_ino 37
+...st_mode 120755
+...st_nlink 1
+...st_uid 0
+...st_gid 0
+...st_rdev (0x0:0x0)
+...st_size 0
+...st_atime Sat Dec 31 09:00:15 1988
+...st_mtime Sat Dec 31 09:00:15 1988
+...st_ctime Sat Dec 31 09:00:15 1988
+...st_blksize 0
+...st_blocks 0
stat( 7 ) returned : Too many symbolic links
+lstat( 7 ) returned
+...st_dev (0xfffe:0x1)
+...st_ino 38
+...st_mode 120755
+...st_nlink 1
+...st_uid 0
+...st_gid 0
+...st_rdev (0x0:0x0)
+...st_size 0
+...st_atime Sat Dec 31 09:00:15 1988
+...st_mtime Sat Dec 31 09:00:15 1988
+...st_ctime Sat Dec 31 09:00:15 1988
+...st_blksize 0
+...st_blocks 0
stat( 8 ) returned : Too many symbolic links
+lstat( 8 ) returned
+...st_dev (0xfffe:0x1)
+...st_ino 39
+...st_mode 120755
+...st_nlink 1
+...st_uid 0
+...st_gid 0
+...st_rdev (0x0:0x0)
+...st_size 0
+...st_atime Sat Dec 31 09:00:15 1988
+...st_mtime Sat Dec 31 09:00:15 1988
+...st_ctime Sat Dec 31 09:00:15 1988
+...st_blksize 0
+...st_blocks 0
stat( 9 ) returned : Too many symbolic links
+lstat( 9 ) returned
+...st_dev (0xfffe:0x1)
+...st_ino 3a
+...st_mode 120755
+...st_nlink 1
+...st_uid 0
+...st_gid 0
+...st_rdev (0x0:0x0)
+...st_size 0
+...st_atime Sat Dec 31 09:00:15 1988
+...st_mtime Sat Dec 31 09:00:15 1988
+...st_ctime Sat Dec 31 09:00:15 1988
+...st_blksize 0
+...st_blocks 0
chdir to a file should fail with ENOTDIR
Verify RWX permission on /my_mount_point/dir1 via access
chmod of /my_mount_point/dir1 to Read/Write
@@ -855,6 +1167,8 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:20 1988
+...st_blksize 0
+...st_blocks 0
stat( links//links_dir1 d1 ) returned
...st_dev (0x0:0x0)
...st_ino 8
@@ -867,6 +1181,8 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:20 1988
+...st_blksize 0
+...st_blocks 0
Chdir to links/dir1_ dir1
Chdir to .. should fail with ENOENT
mkdir ../t should fail with ENOENT
@@ -897,7 +1213,7 @@
chdir to /my_mount_point
Change group of /////my_mount_point/dir1/\//file1\\//
stat( /////my_mount_point/dir1/\//file1\\// ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino b
...st_mode 100011
...st_nlink 3
@@ -908,9 +1224,11 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:25 1988
+...st_blksize 0
+...st_blocks 0
Change owner of /////my_mount_point/dir1/\//file1\\//
stat( /////my_mount_point/dir1/\//file1\\// ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino b
...st_mode 100011
...st_nlink 3
@@ -921,9 +1239,11 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:25 1988
+...st_blksize 0
+...st_blocks 0
Change group of /my_mount_point/dir1/file2
stat( /my_mount_point/dir1/file2 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino c
...st_mode 100004
...st_nlink 3
@@ -934,9 +1254,11 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:25 1988
+...st_blksize 0
+...st_blocks 0
Change owner of /my_mount_point/dir1/file2
stat( /my_mount_point/dir1/file2 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino c
...st_mode 100004
...st_nlink 3
@@ -947,9 +1269,11 @@
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
...st_ctime Sat Dec 31 09:00:25 1988
+...st_blksize 0
+...st_blocks 0
Change group of /my_mount_point/dir1/file3
stat( /my_mount_point/dir1/file3 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino d
...st_mode 100004
...st_nlink 3
@@ -959,10 +1283,12 @@
...st_size 0
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
-...st_ctime Sat Dec 31 09:00:26 1988
+...st_ctime Sat Dec 31 09:00:25 1988
+...st_blksize 0
+...st_blocks 0
Change owner of /my_mount_point/dir1/file3
stat( /my_mount_point/dir1/file3 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino d
...st_mode 100004
...st_nlink 3
@@ -972,10 +1298,12 @@
...st_size 0
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
-...st_ctime Sat Dec 31 09:00:26 1988
+...st_ctime Sat Dec 31 09:00:25 1988
+...st_blksize 0
+...st_blocks 0
Change group of /my_mount_point/dir1/file4
stat( /my_mount_point/dir1/file4 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino e
...st_mode 100004
...st_nlink 3
@@ -985,10 +1313,12 @@
...st_size 0
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
-...st_ctime Sat Dec 31 09:00:26 1988
+...st_ctime Sat Dec 31 09:00:25 1988
+...st_blksize 0
+...st_blocks 0
Change owner of /my_mount_point/dir1/file4
stat( /my_mount_point/dir1/file4 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino e
...st_mode 100004
...st_nlink 3
@@ -998,10 +1328,12 @@
...st_size 0
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
-...st_ctime Sat Dec 31 09:00:26 1988
+...st_ctime Sat Dec 31 09:00:25 1988
+...st_blksize 0
+...st_blocks 0
Change group of /my_mount_point/dir1/dir1/file1
stat( /my_mount_point/dir1/dir1/file1 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino f
...st_mode 100004
...st_nlink 3
@@ -1011,10 +1343,12 @@
...st_size 0
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
-...st_ctime Sat Dec 31 09:00:26 1988
+...st_ctime Sat Dec 31 09:00:25 1988
+...st_blksize 0
+...st_blocks 0
Change owner of /my_mount_point/dir1/dir1/file1
stat( /my_mount_point/dir1/dir1/file1 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino f
...st_mode 100004
...st_nlink 3
@@ -1024,10 +1358,12 @@
...st_size 0
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
-...st_ctime Sat Dec 31 09:00:26 1988
+...st_ctime Sat Dec 31 09:00:25 1988
+...st_blksize 0
+...st_blocks 0
Change group of ../../..//my_mount_point/dir1/./././dir1/ file1
stat( ../../..//my_mount_point/dir1/./././dir1/ file1 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino 10
...st_mode 100004
...st_nlink 3
@@ -1037,10 +1373,12 @@
...st_size 0
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
-...st_ctime Sat Dec 31 09:00:26 1988
+...st_ctime Sat Dec 31 09:00:25 1988
+...st_blksize 0
+...st_blocks 0
Change owner of ../../..//my_mount_point/dir1/./././dir1/ file1
stat( ../../..//my_mount_point/dir1/./././dir1/ file1 ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino 10
...st_mode 100004
...st_nlink 3
@@ -1050,10 +1388,12 @@
...st_size 0
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
-...st_ctime Sat Dec 31 09:00:26 1988
+...st_ctime Sat Dec 31 09:00:25 1988
+...st_blksize 0
+...st_blocks 0
Change group of main.c
stat( main.c ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino 11
...st_mode 100004
...st_nlink 1
@@ -1063,10 +1403,12 @@
...st_size 0
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
-...st_ctime Sat Dec 31 09:00:26 1988
+...st_ctime Sat Dec 31 09:00:25 1988
+...st_blksize 0
+...st_blocks 0
Change owner of main.c
stat( main.c ) returned
-...st_dev (0x0:0x0)
+...st_dev (0xfffe:0x1)
...st_ino 11
...st_mode 100004
...st_nlink 1
@@ -1076,7 +1418,9 @@
...st_size 0
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
-...st_ctime Sat Dec 31 09:00:26 1988
+...st_ctime Sat Dec 31 09:00:25 1988
+...st_blksize 0
+...st_blocks 0
Change group of dir1/dir1/../../links/dir1
stat( dir1/dir1/../../links/dir1 ) returned
...st_dev (0x0:0x0)
@@ -1086,10 +1430,12 @@
...st_uid 0
...st_gid 1
...st_rdev (0x0:0x0)
-...st_size 1876
+...st_size 3560
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
-...st_ctime Sat Dec 31 09:00:31 1988
+...st_ctime Sat Dec 31 09:00:30 1988
+...st_blksize 0
+...st_blocks 0
Change owner of dir1/dir1/../../links/dir1
stat( dir1/dir1/../../links/dir1 ) returned : Permission denied
Change group of links/dir2
@@ -1104,7 +1450,9 @@
...st_size 0
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
-...st_ctime Sat Dec 31 09:00:31 1988
+...st_ctime Sat Dec 31 09:00:30 1988
+...st_blksize 0
+...st_blocks 0
Change owner of links/dir2
stat( links/dir2 ) returned
...st_dev (0x0:0x0)
@@ -1117,7 +1465,9 @@
...st_size 0
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
-...st_ctime Sat Dec 31 09:00:31 1988
+...st_ctime Sat Dec 31 09:00:30 1988
+...st_blksize 0
+...st_blocks 0
Change group of links/dir3
stat( links/dir3 ) returned
...st_dev (0x0:0x0)
@@ -1130,7 +1480,9 @@
...st_size 0
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
-...st_ctime Sat Dec 31 09:00:31 1988
+...st_ctime Sat Dec 31 09:00:30 1988
+...st_blksize 0
+...st_blocks 0
Change owner of links/dir3
stat( links/dir3 ) returned
...st_dev (0x0:0x0)
@@ -1143,7 +1495,9 @@
...st_size 0
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
-...st_ctime Sat Dec 31 09:00:31 1988
+...st_ctime Sat Dec 31 09:00:30 1988
+...st_blksize 0
+...st_blocks 0
Change group of links/dir4
stat( links/dir4 ) returned
...st_dev (0x0:0x0)
@@ -1156,7 +1510,9 @@
...st_size 0
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
-...st_ctime Sat Dec 31 09:00:31 1988
+...st_ctime Sat Dec 31 09:00:30 1988
+...st_blksize 0
+...st_blocks 0
Change owner of links/dir4
stat( links/dir4 ) returned
...st_dev (0x0:0x0)
@@ -1169,7 +1525,9 @@
...st_size 0
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
-...st_ctime Sat Dec 31 09:00:31 1988
+...st_ctime Sat Dec 31 09:00:30 1988
+...st_blksize 0
+...st_blocks 0
Change group of links/dir1_dir1
stat( links/dir1_dir1 ) returned
...st_dev (0x0:0x0)
@@ -1179,10 +1537,12 @@
...st_uid 0
...st_gid 1
...st_rdev (0x0:0x0)
-...st_size 536
+...st_size 1040
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
-...st_ctime Sat Dec 31 09:00:31 1988
+...st_ctime Sat Dec 31 09:00:30 1988
+...st_blksize 0
+...st_blocks 0
Change owner of links/dir1_dir1
stat( links/dir1_dir1 ) returned
...st_dev (0x0:0x0)
@@ -1192,10 +1552,12 @@
...st_uid 1
...st_gid 0
...st_rdev (0x0:0x0)
-...st_size 536
+...st_size 1040
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
-...st_ctime Sat Dec 31 09:00:31 1988
+...st_ctime Sat Dec 31 09:00:30 1988
+...st_blksize 0
+...st_blocks 0
Change group of links/dir1_ dir1
stat( links/dir1_ dir1 ) returned : No such file or directory
Change owner of links/dir1_ dir1
@@ -1209,12 +1571,138 @@
...st_uid 0
...st_gid 1
...st_rdev (0x0:0x0)
-...st_size 8844
+...st_size 21420
...st_atime Sat Dec 31 09:00:00 1988
...st_mtime Sat Dec 31 09:00:00 1988
-...st_ctime Sat Dec 31 09:00:31 1988
+...st_ctime Sat Dec 31 09:00:30 1988
+...st_blksize 0
+...st_blocks 0
Change owner of links/../links/../links/links
stat( links/../links/../links/links ) returned : Permission denied
+Change group of /my_mount_point/symlinks/a_file_symlink
+lstat( /my_mount_point/symlinks/a_file_symlink ) returned
+...st_dev (0xfffe:0x1)
+...st_ino 2c
+...st_mode 120755
+...st_nlink 1
+...st_uid 0
+...st_gid 1
+...st_rdev (0x0:0x0)
+...st_size 0
+...st_atime Sat Dec 31 09:00:15 1988
+...st_mtime Sat Dec 31 09:00:15 1988
+...st_ctime Sat Dec 31 09:00:35 1988
+...st_blksize 0
+...st_blocks 0
+Change owner of /my_mount_point/symlinks/a_file_symlink
+lstat( /my_mount_point/symlinks/a_file_symlink ) returned
+...st_dev (0xfffe:0x1)
+...st_ino 2c
+...st_mode 120755
+...st_nlink 1
+...st_uid 1
+...st_gid 0
+...st_rdev (0x0:0x0)
+...st_size 0
+...st_atime Sat Dec 31 09:00:15 1988
+...st_mtime Sat Dec 31 09:00:15 1988
+...st_ctime Sat Dec 31 09:00:35 1988
+...st_blksize 0
+...st_blocks 0
+Change group of /my_mount_point/symlinks/a_dir_symlink
+lstat( /my_mount_point/symlinks/a_dir_symlink ) returned
+...st_dev (0xfffe:0x1)
+...st_ino 2d
+...st_mode 120755
+...st_nlink 1
+...st_uid 0
+...st_gid 1
+...st_rdev (0x0:0x0)
+...st_size 0
+...st_atime Sat Dec 31 09:00:15 1988
+...st_mtime Sat Dec 31 09:00:15 1988
+...st_ctime Sat Dec 31 09:00:35 1988
+...st_blksize 0
+...st_blocks 0
+Change owner of /my_mount_point/symlinks/a_dir_symlink
+lstat( /my_mount_point/symlinks/a_dir_symlink ) returned
+...st_dev (0xfffe:0x1)
+...st_ino 2d
+...st_mode 120755
+...st_nlink 1
+...st_uid 1
+...st_gid 0
+...st_rdev (0x0:0x0)
+...st_size 0
+...st_atime Sat Dec 31 09:00:15 1988
+...st_mtime Sat Dec 31 09:00:15 1988
+...st_ctime Sat Dec 31 09:00:35 1988
+...st_blksize 0
+...st_blocks 0
+Change group of /my_mount_point/symlinks/a_link_symlink
+lstat( /my_mount_point/symlinks/a_link_symlink ) returned
+...st_dev (0xfffe:0x1)
+...st_ino 2e
+...st_mode 120755
+...st_nlink 1
+...st_uid 0
+...st_gid 1
+...st_rdev (0x0:0x0)
+...st_size 0
+...st_atime Sat Dec 31 09:00:15 1988
+...st_mtime Sat Dec 31 09:00:15 1988
+...st_ctime Sat Dec 31 09:00:35 1988
+...st_blksize 0
+...st_blocks 0
+Change owner of /my_mount_point/symlinks/a_link_symlink
+lstat( /my_mount_point/symlinks/a_link_symlink ) returned
+...st_dev (0xfffe:0x1)
+...st_ino 2e
+...st_mode 120755
+...st_nlink 1
+...st_uid 1
+...st_gid 0
+...st_rdev (0x0:0x0)
+...st_size 0
+...st_atime Sat Dec 31 09:00:15 1988
+...st_mtime Sat Dec 31 09:00:15 1988
+...st_ctime Sat Dec 31 09:00:35 1988
+...st_blksize 0
+...st_blocks 0
+Change group of ../symlinks/no_file
+lstat( ../symlinks/no_file ) returned : No such file or directory
+Change owner of ../symlinks/no_file
+lstat( ../symlinks/no_file ) returned : No such file or directory
+Change group of /my_mount_point/symlinks/a_dir_symlink/a_file_symlink
+lstat( /my_mount_point/symlinks/a_dir_symlink/a_file_symlink ) returned
+...st_dev (0xfffe:0x1)
+...st_ino 30
+...st_mode 120755
+...st_nlink 1
+...st_uid 0
+...st_gid 1
+...st_rdev (0x0:0x0)
+...st_size 0
+...st_atime Sat Dec 31 09:00:15 1988
+...st_mtime Sat Dec 31 09:00:15 1988
+...st_ctime Sat Dec 31 09:00:35 1988
+...st_blksize 0
+...st_blocks 0
+Change owner of /my_mount_point/symlinks/a_dir_symlink/a_file_symlink
+lstat( /my_mount_point/symlinks/a_dir_symlink/a_file_symlink ) returned
+...st_dev (0xfffe:0x1)
+...st_ino 30
+...st_mode 120755
+...st_nlink 1
+...st_uid 1
+...st_gid 0
+...st_rdev (0x0:0x0)
+...st_size 0
+...st_atime Sat Dec 31 09:00:15 1988
+...st_mtime Sat Dec 31 09:00:15 1988
+...st_ctime Sat Dec 31 09:00:35 1988
+...st_blksize 0
+...st_blocks 0
*** END OF STAT TEST 01 ***
diff -u rtems/testsuites/psxtests/psxstat/test.c:1.26 rtems/testsuites/psxtests/psxstat/test.c:1.27
--- rtems/testsuites/psxtests/psxstat/test.c:1.26 Tue Jun 1 19:50:37 2010
+++ rtems/testsuites/psxtests/psxstat/test.c Thu Jul 1 12:23:47 2010
@@ -2,6 +2,9 @@
* This test exercises stat() via fstat() and generates as many of the
* path evaluation cases as possible.
*
+ * This test also exercises lstat() and lchown() when symlinks are
+ * involved.
+ *
* COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
@@ -164,11 +167,12 @@
};
/*
- * Do a stat on a single file and report the status.
+ * Do a stat/lstat on a single file and report the status.
*/
-void stat_a_file(
- const char *file
+void stat_a_file_helper(
+ const char *file,
+ int follow_link
)
{
int status;
@@ -181,10 +185,15 @@
rtems_test_assert( file );
- printf( "stat( %s ) returned ", file );
- fflush( stdout );
-
- status = stat( file, &statbuf );
+ if ( follow_link ) {
+ printf( "stat( %s ) returned ", file );
+ fflush( stdout );
+ status = stat( file, &statbuf );
+ } else {
+ printf( "lstat( %s ) returned ", file );
+ fflush( stdout );
+ status = lstat( file, &statbuf );
+ }
if ( status == -1 ) {
printf( ": %s\n", strerror( errno ) );
@@ -211,6 +220,26 @@
}
/*
+ * Do a stat on a single file and report the status.
+*/
+void stat_a_file(
+ const char *file
+)
+{
+ stat_a_file_helper( file, true );
+}
+
+/*
+ * Do a lstat on a single file and report the status.
+ */
+void lstat_a_file(
+ const char *file
+)
+{
+ stat_a_file_helper( file, false );
+}
+
+/*
* stat() multiple files at a time
*/
@@ -228,10 +257,11 @@
}
/*
- * chown() multiple files at a time
+ * chown()/lchown() multiple files at a time
*/
-void chown_multiple_files(
- char **files
+void chown_multiple_files_helper(
+ char **files,
+ int follow_link
)
{
int i;
@@ -244,18 +274,46 @@
i = 0;
while ( files[i] ) {
printf("Change group of %s\n", files[i]);
- chown( files[i], st_uid, (st_gid+1) );
- stat_a_file( files[i] );
+ if ( follow_link ) {
+ chown( files[i], st_uid, (st_gid+1) );
+ stat_a_file( files[i] );
+ } else {
+ lchown( files[i], st_uid, (st_gid+1) );
+ lstat_a_file( files[i] );
+ }
printf("Change owner of %s\n", files[i]);
- chown( files[i], (st_uid+1), st_gid );
- stat_a_file( files[i] );
+ if ( follow_link ) {
+ chown( files[i], (st_uid+1), st_gid );
+ stat_a_file( files[i] );
+ } else {
+ lchown( files[i], (st_uid+1), st_gid );
+ lstat_a_file( files[i] );
+ }
i++;
}
}
+/*
+ * chown() multiple files at a time
+ */
+void chown_multiple_files(
+ char **files
+)
+{
+ chown_multiple_files_helper( files, true );
+}
+/*
+ * lchown() multiple files at a time
+ */
+void lchown_multiple_files(
+ char **files
+)
+{
+ chown_multiple_files_helper( files, false );
+}
/*
* mknod() multiple files at a time
@@ -377,7 +435,7 @@
void make_multiple_symlinks(void)
{
- int status;
+ int status, i;
make_a_symlink( Files[0], SymLinks[0] );
make_a_symlink( Directories[0], SymLinks[1] );
@@ -386,11 +444,10 @@
make_a_symlink( SymLinks[1], SymLinks[4] );
make_a_symlink( "//my_mount_point/links","/my_mount_point/symlinks/links" );
- stat_a_file( SymLinks[0] );
- stat_a_file( SymLinks[1] );
- stat_a_file( SymLinks[2] );
- stat_a_file( SymLinks[3] );
- stat_a_file( SymLinks[4] );
+ for (i = 0; i < 5; i++) {
+ stat_a_file( SymLinks[i] );
+ lstat_a_file( SymLinks[i] );
+ }
status = symlink( "//links", "bob/frank" );
rtems_test_assert (status == -1);
@@ -433,6 +490,7 @@
for (i=1; i < link_count; i++) {
sprintf( name1, "%d", i );
stat_a_file( name1 );
+ lstat_a_file( name1 );
}
}
@@ -841,6 +899,9 @@
status = rtems_task_wake_after( TIMEOUT_VALUE );
chown_multiple_files( Links_to_Dirs );
+ status = rtems_task_wake_after( TIMEOUT_VALUE );
+ lchown_multiple_files( SymLinks );
+
puts( "\n\n*** END OF STAT TEST 01 ***" );
rtems_test_exit(0);
}
*joel*:
2010-07-01 Bharath Suri <bharath.s.jois at gmail.com>
PR 1598/testing
* Makefile.am, configure.ac, psxpasswd01/init.c,
psxpasswd01/psxpasswd01.doc, psxpasswd01/psxpasswd01.scn: Add testing
for POSIX user database (e.g. /etc/group and /etc/passwd) access
routines which are implemented in libcsupport/src/getpwent.c.
* psxpasswd02/.cvsignore, psxpasswd02/Makefile.am, psxpasswd02/init.c,
psxpasswd02/psxpasswd02.doc, psxpasswd02/psxpasswd02.scn: New files.
M 1.280 testsuites/psxtests/ChangeLog
M 1.64 testsuites/psxtests/Makefile.am
M 1.68 testsuites/psxtests/configure.ac
M 1.2 testsuites/psxtests/psxpasswd01/init.c
M 1.2 testsuites/psxtests/psxpasswd01/psxpasswd01.doc
M 1.2 testsuites/psxtests/psxpasswd01/psxpasswd01.scn
A 1.1 testsuites/psxtests/psxpasswd02/.cvsignore
A 1.1 testsuites/psxtests/psxpasswd02/Makefile.am
A 1.1 testsuites/psxtests/psxpasswd02/init.c
A 1.1 testsuites/psxtests/psxpasswd02/psxpasswd02.doc
A 1.1 testsuites/psxtests/psxpasswd02/psxpasswd02.scn
diff -u rtems/testsuites/psxtests/ChangeLog:1.279 rtems/testsuites/psxtests/ChangeLog:1.280
--- rtems/testsuites/psxtests/ChangeLog:1.279 Thu Jul 1 12:24:35 2010
+++ rtems/testsuites/psxtests/ChangeLog Thu Jul 1 12:26:27 2010
@@ -1,3 +1,13 @@
+2010-07-01 Bharath Suri <bharath.s.jois at gmail.com>
+
+ PR 1598/testing
+ * Makefile.am, configure.ac, psxpasswd01/init.c,
+ psxpasswd01/psxpasswd01.doc, psxpasswd01/psxpasswd01.scn: Add testing
+ for POSIX user database (e.g. /etc/group and /etc/passwd) access
+ routines which are implemented in libcsupport/src/getpwent.c.
+ * psxpasswd02/.cvsignore, psxpasswd02/Makefile.am, psxpasswd02/init.c,
+ psxpasswd02/psxpasswd02.doc, psxpasswd02/psxpasswd02.scn: New files.
+
2010-07-01 Vinu Rajashekhar <vinutheraj at gmail.com>
PR 1597/cpukit
diff -u rtems/testsuites/psxtests/Makefile.am:1.63 rtems/testsuites/psxtests/Makefile.am:1.64
--- rtems/testsuites/psxtests/Makefile.am:1.63 Thu Jul 1 09:40:09 2010
+++ rtems/testsuites/psxtests/Makefile.am Thu Jul 1 12:26:29 2010
@@ -20,7 +20,7 @@
## File IO tests
SUBDIRS += psxfile01 psxfile02 psxfilelock01 psxid01 psximfs01 psxreaddir \
- psxstat psxmount psx13 psxchroot01 psxpasswd01
+ psxstat psxmount psx13 psxchroot01 psxpasswd01 psxpasswd02
## Until sys/uio.h is moved to libcsupport, we have to have networking
## enabled to support readv and writev. Hopefully this is a temporary
diff -u rtems/testsuites/psxtests/configure.ac:1.67 rtems/testsuites/psxtests/configure.ac:1.68
--- rtems/testsuites/psxtests/configure.ac:1.67 Thu Jul 1 09:40:09 2010
+++ rtems/testsuites/psxtests/configure.ac Thu Jul 1 12:26:30 2010
@@ -105,6 +105,7 @@
psxmutexattr01/Makefile
psxobj01/Makefile
psxpasswd01/Makefile
+psxpasswd02/Makefile
psxreaddir/Makefile
psxrdwrv/Makefile
psxrwlock01/Makefile
diff -u rtems/testsuites/psxtests/psxpasswd01/init.c:1.1 rtems/testsuites/psxtests/psxpasswd01/init.c:1.2
--- rtems/testsuites/psxtests/psxpasswd01/init.c:1.1 Thu Dec 3 11:15:02 2009
+++ rtems/testsuites/psxtests/psxpasswd01/init.c Thu Jul 1 12:26:31 2010
@@ -60,19 +60,100 @@
struct passwd *pw;
struct group *gr;
- puts( "*** PASSWORD/GROUP TEST ***" );
+ puts( "*** PASSWORD/GROUP TEST - 01 ***" );
+
+ /* getpwent */
+ puts( "Init - getpwent() -- OK, result should be NULL" );
+ pw = getpwent();
+ rtems_test_assert( !pw );
+
+ /* getgrent */
+ puts( "Init - getgrent() -- OK, result should be NULL" );
+ gr = getgrent();
+ rtems_test_assert( !gr );
+
+ /* setpwent */
+
+ puts( "Init - setpwent() -- OK" );
+ setpwent();
+
+ /* setgrent */
+
+ puts( "Init - setgrent() -- OK" );
+ setgrent();
+
+ /* getpwent */
+
+ puts( "Init - getpwent() (1) -- OK" );
+ pw = getpwent();
+ rtems_test_assert( pw );
+ print_passwd( pw );
+
+ puts( "Init - getpwent() (2) -- OK" );
+ pw = getpwent();
+ rtems_test_assert( pw );
+ print_passwd( pw );
+
+ puts( "Init - getpwent() (3) -- OK" );
+ pw = getpwent();
+ rtems_test_assert( pw );
+ print_passwd( pw );
+
+ puts( "Init - getpwent() (4) -- result should be NULL" );
+ pw = getpwent();
+ rtems_test_assert( !pw );
+
+ /* getgrent */
+
+ puts( "Init - getgrent() (1) -- OK" );
+ gr = getgrent();
+ rtems_test_assert( gr );
+ print_group( gr );
+
+ puts( "Init - getgrent() (2) -- OK" );
+ gr = getgrent();
+ rtems_test_assert( gr );
+ print_group( gr );
+
+ puts( "Init - getgrent() (3) -- OK" );
+ gr = getgrent();
+ rtems_test_assert( gr );
+ print_group( gr );
+
+ puts( "Init - getgrent() (4) -- result should be NULL" );
+ gr = getgrent();
+ rtems_test_assert( !gr );
/* getpwnam */
puts( "Init - getpwnam(\"root\") -- OK" );
- pw = getpwnam("root");
+ pw = getpwnam( "root" );
rtems_test_assert( pw );
print_passwd( pw );
puts( "Init - getpwnam(\"rtems\") -- OK" );
- pw = getpwnam("rtems");
+ pw = getpwnam( "rtems" );
rtems_test_assert( pw );
print_passwd( pw );
+ puts( "Init - getpwnam(\"suser\") -- result should be NULL" );
+ pw = getpwnam( "suser" );
+ rtems_test_assert( !pw );
+
+ /* getpwuid */
+ puts( "Init - getpwuid(0) -- OK" );
+ pw = getpwuid( 0 );
+ rtems_test_assert( pw );
+ print_passwd( pw );
+
+ puts( "Init - getpwuid(1) -- OK" );
+ pw = getpwuid( 1 );
+ rtems_test_assert( pw );
+ print_passwd( pw );
+
+ puts( "Init - getpwuid(4) -- result should be NULL" );
+ pw = getpwuid( 4 );
+ rtems_test_assert( !pw );
+
/* getgrnam */
puts( "Init - getgrnam(\"root\") -- OK" );
gr = getgrnam("root");
@@ -84,7 +165,30 @@
rtems_test_assert( gr );
print_group( gr );
- puts( "*** END OF PASSWORD/GROUP TEST ***" );
+ /* getgrgid */
+ puts( "Init - getgrgid(0) -- OK" );
+ gr = getgrgid(0);
+ rtems_test_assert( gr );
+ print_group( gr );
+
+ puts( "Init - getgrgid(1) -- OK" );
+ gr = getgrgid(1);
+ rtems_test_assert( gr );
+ print_group( gr );
+
+ puts( "Init - getgrgid(4) -- result should be NULL");
+ gr = getgrgid( 4 );
+ rtems_test_assert( !gr );
+
+ /* endpwent */
+ puts( "Init - endpwent() -- OK" );
+ endpwent();
+
+ /* endgrent */
+ puts( "Init - endgrent() -- OK" );
+ endgrent();
+
+ puts( "*** END OF PASSWORD/GROUP TEST - 01 ***" );
rtems_test_exit( 0 );
}
diff -u rtems/testsuites/psxtests/psxpasswd01/psxpasswd01.doc:1.1 rtems/testsuites/psxtests/psxpasswd01/psxpasswd01.doc:1.2
--- rtems/testsuites/psxtests/psxpasswd01/psxpasswd01.doc:1.1 Thu Dec 3 11:15:02 2009
+++ rtems/testsuites/psxtests/psxpasswd01/psxpasswd01.doc Thu Jul 1 12:26:33 2010
@@ -18,11 +18,17 @@
getpwuid
getpwnam_r
getpwuid_r
+ getpwent
+ setpwent
+ endpwent
getgrnam
getgrgid
getgrnam_r
getgrgid_r
+ getgrent
+ setgrent
+ endgrent
concepts:
diff -u rtems/testsuites/psxtests/psxpasswd01/psxpasswd01.scn:1.1 rtems/testsuites/psxtests/psxpasswd01/psxpasswd01.scn:1.2
--- rtems/testsuites/psxtests/psxpasswd01/psxpasswd01.scn:1.1 Thu Dec 3 11:15:02 2009
+++ rtems/testsuites/psxtests/psxpasswd01/psxpasswd01.scn Thu Jul 1 12:26:33 2010
@@ -1,4 +1,48 @@
-*** PASSWORD/GROUP TEST ***
+Initialized console on port COM1 9600-8-N-1
+
+*** PASSWORD/GROUP TEST - 01 ***
+Init - getpwent() -- OK, result should be NULL
+Init - getgrent() -- OK, result should be NULL
+Init - setpwent() -- OK
+Init - setgrent() -- OK
+Init - getpwent() (1) -- OK
+ username: root
+ user password: *
+ user ID: 0
+ group ID: 0
+ real name:
+ home directory: /
+ shell program: /bin/sh
+Init - getpwent() (2) -- OK
+ username: rtems
+ user password: *
+ user ID: 1
+ group ID: 1
+ real name:
+ home directory: /
+ shell program: /bin/sh
+Init - getpwent() (3) -- OK
+ username: tty
+ user password: !
+ user ID: 2
+ group ID: 2
+ real name:
+ home directory: /
+ shell program: /bin/false
+Init - getpwent() (4) -- result should be NULL
+Init - getgrent() (1) -- OK
+ group name: root
+ group password: x
+ group ID: 0
+Init - getgrent() (2) -- OK
+ group name: rtems
+ group password: x
+ group ID: 1
+Init - getgrent() (3) -- OK
+ group name: tty
+ group password: x
+ group ID: 2
+Init - getgrent() (4) -- result should be NULL
Init - getpwnam("root") -- OK
username: root
user password: *
@@ -15,7 +59,24 @@
real name:
home directory: /
shell program: /bin/sh
-
+Init - getpwnam("suser") -- result should be NULL
+Init - getpwuid(0) -- OK
+ username: root
+ user password: *
+ user ID: 0
+ group ID: 0
+ real name:
+ home directory: /
+ shell program: /bin/sh
+Init - getpwuid(1) -- OK
+ username: rtems
+ user password: *
+ user ID: 1
+ group ID: 1
+ real name:
+ home directory: /
+ shell program: /bin/sh
+Init - getpwuid(4) -- result should be NULL
Init - getgrnam("root") -- OK
group name: root
group password: x
@@ -24,5 +85,15 @@
group name: rtems
group password: x
group ID: 1
-*** END OF PASSWORD/GROUP TEST ***
-
+Init - getgrgid(0) -- OK
+ group name: root
+ group password: x
+ group ID: 0
+Init - getgrgid(1) -- OK
+ group name: rtems
+ group password: x
+ group ID: 1
+Init - getgrgid(4) -- result should be NULL
+Init - endpwent() -- OK
+Init - endgrent() -- OK
+*** END OF PASSWORD/GROUP TEST - 01 ***
diff -u /dev/null rtems/testsuites/psxtests/psxpasswd02/.cvsignore:1.1
--- /dev/null Thu Jul 1 13:14:44 2010
+++ rtems/testsuites/psxtests/psxpasswd02/.cvsignore Thu Jul 1 12:26:33 2010
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/psxtests/psxpasswd02/Makefile.am:1.1
--- /dev/null Thu Jul 1 13:14:44 2010
+++ rtems/testsuites/psxtests/psxpasswd02/Makefile.am Thu Jul 1 12:26:33 2010
@@ -0,0 +1,27 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = psxpasswd02
+psxpasswd02_SOURCES = init.c ../include/pmacros.h
+
+dist_rtems_tests_DATA = psxpasswd02.scn
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+
+AM_CPPFLAGS += -I$(top_srcdir)/include
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(psxpasswd02_OBJECTS) $(psxpasswd02_LDADD)
+LINK_LIBS = $(psxpasswd02_LDLIBS)
+
+psxpasswd02$(EXEEXT): $(psxpasswd02_OBJECTS) $(psxpasswd02_DEPENDENCIES)
+ @rm -f psxpasswd02$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/psxtests/psxpasswd02/init.c:1.1
--- /dev/null Thu Jul 1 13:14:44 2010
+++ rtems/testsuites/psxtests/psxpasswd02/init.c Thu Jul 1 12:26:35 2010
@@ -0,0 +1,182 @@
+/*
+ * COPYRIGHT (c) 1989-2010.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#include <bsp.h>
+#include <pmacros.h>
+#include <sys/types.h>
+#include <pwd.h>
+#include <grp.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+
+void print_passwd(
+ struct passwd *pw
+)
+{
+ printf(
+ " username: %s\n"
+ " user password: %s\n"
+ " user ID: %d\n"
+ " group ID: %d\n"
+ " real name: %s\n"
+ " home directory: %s\n"
+ " shell program: %s\n",
+ pw->pw_name,
+ pw->pw_passwd,
+ pw->pw_uid,
+ pw->pw_gid,
+ pw->pw_gecos,
+ pw->pw_dir,
+ pw->pw_shell
+ );
+}
+
+void print_group(
+ struct group *gr
+)
+{
+ printf(
+ " group name: %s\n"
+ " group password: %s\n"
+ " group ID: %d\n",
+ gr->gr_name,
+ gr->gr_passwd,
+ gr->gr_gid
+ );
+
+ /* TBD print users in group */
+}
+
+rtems_task Init(
+ rtems_task_argument ignored
+)
+{
+ struct passwd *pw;
+ struct group *gr;
+ int status = -1;
+
+ FILE *fp = NULL;
+
+ puts( "*** PASSWORD/GROUP TEST - 02 ***" );
+
+ puts( "Init - Creating /etc" );
+ status = mkdir( "/etc", 0777 );
+ rtems_test_assert( status == 0 );
+
+ puts( "Init - Creating /etc/passwd" );
+ status = mknod( "/etc/passwd", (S_IFREG | S_IRWXU), 0LL );
+ rtems_test_assert( status != -1 );
+
+ fp = fopen( "/etc/passwd", "w" );
+ rtems_test_assert( fp != NULL );
+ fprintf( fp, "bharath:x:-1:-a:Dummy::/:/bin/bash\n" );
+ fclose( fp );
+
+ puts( "Init - Creating /etc/group" );
+ status = mknod( "/etc/group", (S_IFREG | S_IRWXU), 0LL );
+ rtems_test_assert( status != -1);
+
+ fp = fopen( "/etc/group", "w" );
+ rtems_test_assert( fp != NULL );
+ fprintf( fp, "admin::1:root,su,super-user\n" );
+ fclose( fp );
+
+ puts( "Init - setpwent() -- OK" );
+ setpwent();
+
+ puts( "Init - setpwent() -- OK" );
+ setpwent();
+
+ puts( "Init - setgrent() -- OK" );
+ setgrent();
+
+ puts( "Init - setgrent() -- OK" );
+ setgrent();
+
+ puts( "Init - getpwnam(\"root\") -- expected EINVAL" );
+ pw = getpwnam( "root" );
+ rtems_test_assert( !pw );
+ rtems_test_assert( errno == EINVAL );
+
+ fp = fopen( "/etc/passwd", "w" );
+ rtems_test_assert( fp != NULL );
+ fprintf( fp, "rtems:x:1:1:dummy::/:/bin/bash:" );
+ fclose( fp );
+
+ puts( "Init - getpwnam(\"root\") -- expected EINVAL" );
+ pw = getpwnam( "root" );
+ rtems_test_assert( !pw );
+ rtems_test_assert( errno == EINVAL );
+
+ fp = fopen( "/etc/passwd", "w" );
+ rtems_test_assert( fp != NULL );
+ fprintf( fp, "user\n:x:2:2:dummy::/:/bin/sh\n" );
+ fclose( fp );
+
+ puts( "Init - getpwnam(\"root\") -- expected EINVAL" );
+ pw = getpwnam( "root" );
+ rtems_test_assert( !pw );
+ rtems_test_assert( errno == EINVAL );
+
+ puts( "Init - getgrent() -- OK" );
+ gr = getgrent();
+ rtems_test_assert( gr != NULL );
+ print_group( gr );
+
+ puts( "Init - endpwent() -- OK" );
+ endpwent();
+
+ puts( "Init - endpwent() -- OK" );
+ endpwent();
+
+ puts( "Init - endgrent() -- OK" );
+ endgrent();
+
+ puts( "Init - endgrent() -- OK" );
+ endgrent();
+
+ puts( "Removing /etc/passwd" );
+ status = unlink( "/etc/passwd" );
+ rtems_test_assert( status == 0 );
+
+ puts( "Removing /etc/group" );
+ status = unlink( "/etc/group" );
+ rtems_test_assert( status == 0 );
+
+ puts( "Init - getpwnam(\"root\") -- expected EINVAL" );
+ pw = getpwnam( "root" );
+ rtems_test_assert( !pw );
+ rtems_test_assert( errno == EINVAL );
+
+ puts( "Init - getgrnam(\"root\") -- expected EINVAL" );
+ gr = getgrnam( "root" );
+ rtems_test_assert( !gr );
+ rtems_test_assert( errno == EINVAL );
+
+ puts( "*** END OF PASSWORD/GROUP TEST - 02 ***" );
+ rtems_test_exit( 0 );
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
+#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 6
+
+#define CONFIGURE_MAXIMUM_TASKS 1
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
+/* end of file */
diff -u /dev/null rtems/testsuites/psxtests/psxpasswd02/psxpasswd02.doc:1.1
--- /dev/null Thu Jul 1 13:14:45 2010
+++ rtems/testsuites/psxtests/psxpasswd02/psxpasswd02.doc Thu Jul 1 12:26:36 2010
@@ -0,0 +1,26 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2010.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: POSIX PASSWD/GROUP TEST
+
+directives:
+
++ setpwent
++ setgrent
++ getpwnam
++ endpwent
++ endgrent
+
+concepts:
+
++ Exercise error paths in /etc/passwd and /etc/group.
diff -u /dev/null rtems/testsuites/psxtests/psxpasswd02/psxpasswd02.scn:1.1
--- /dev/null Thu Jul 1 13:14:45 2010
+++ rtems/testsuites/psxtests/psxpasswd02/psxpasswd02.scn Thu Jul 1 12:26:37 2010
@@ -0,0 +1,24 @@
+*** PASSWORD/GROUP TEST - 02 ***
+Init - Creating /etc
+Init - Creating /etc/passwd
+Init - Creating /etc/group
+Init - setpwent() -- OK
+Init - setpwent() -- OK
+Init - setgrent() -- OK
+Init - setgrent() -- OK
+Init - getpwnam("root") -- expected EINVAL
+Init - getpwnam("root") -- expected EINVAL
+Init - getpwnam("root") -- expected EINVAL
+Init - getgrent() -- OK
+ group name: admin
+ group password:
+ group ID: 1
+Init - endpwent() -- OK
+Init - endpwent() -- OK
+Init - endgrent() -- OK
+Init - endgrent() -- OK
+Removing /etc/passwd
+Removing /etc/group
+Init - getpwnam("root") -- expected EINVAL
+Init - getgrnam("root") -- expected EINVAL
+*** END OF PASSWORD/GROUP TEST - 02 ***
*joel*:
2010-07-01 Joel Sherrill <joel.sherrill at oarcorp.com>
* libcsupport/src/_rename_r.c, libcsupport/src/getdents.c,
libcsupport/src/unlink.c, libcsupport/src/utime.c,
libcsupport/src/writev.c: Remove remaining checks for missing
handlers.
M 1.2485 cpukit/ChangeLog
M 1.7 cpukit/libcsupport/src/_rename_r.c
M 1.10 cpukit/libcsupport/src/getdents.c
M 1.21 cpukit/libcsupport/src/unlink.c
M 1.15 cpukit/libcsupport/src/utime.c
M 1.4 cpukit/libcsupport/src/writev.c
diff -u rtems/cpukit/ChangeLog:1.2484 rtems/cpukit/ChangeLog:1.2485
--- rtems/cpukit/ChangeLog:1.2484 Thu Jul 1 12:22:00 2010
+++ rtems/cpukit/ChangeLog Thu Jul 1 12:47:44 2010
@@ -1,3 +1,10 @@
+2010-07-01 Joel Sherrill <joel.sherrill at oarcorp.com>
+
+ * libcsupport/src/_rename_r.c, libcsupport/src/getdents.c,
+ libcsupport/src/unlink.c, libcsupport/src/utime.c,
+ libcsupport/src/writev.c: Remove remaining checks for missing
+ handlers.
+
2010-07-01 Vinu Rajashekhar <vinutheraj at gmail.com>
PR 1597/cpukit
diff -u rtems/cpukit/libcsupport/src/_rename_r.c:1.6 rtems/cpukit/libcsupport/src/_rename_r.c:1.7
--- rtems/cpukit/libcsupport/src/_rename_r.c:1.6 Wed May 19 22:10:41 2010
+++ rtems/cpukit/libcsupport/src/_rename_r.c Thu Jul 1 12:47:45 2010
@@ -79,13 +79,6 @@
rtems_filesystem_get_start_loc( new, &i, &new_parent_loc );
- if ( !new_parent_loc.ops->evalformake_h ) {
- if ( free_old_parentloc )
- rtems_filesystem_freenode( &old_parent_loc );
- rtems_filesystem_freenode( &old_loc );
- rtems_set_errno_and_return_minus_one( ENOTSUP );
- }
-
result = (*new_parent_loc.ops->evalformake_h)( &new[i], &new_parent_loc, &name );
if ( result != 0 ) {
rtems_filesystem_freenode( &new_parent_loc );
@@ -108,14 +101,6 @@
rtems_set_errno_and_return_minus_one( EXDEV );
}
- if ( !new_parent_loc.ops->rename_h ) {
- rtems_filesystem_freenode( &new_parent_loc );
- if ( free_old_parentloc )
- rtems_filesystem_freenode( &old_parent_loc );
- rtems_filesystem_freenode( &old_loc );
- rtems_set_errno_and_return_minus_one( ENOTSUP );
- }
-
result = (*new_parent_loc.ops->rename_h)( &old_parent_loc, &old_loc, &new_parent_loc, name );
rtems_filesystem_freenode( &new_parent_loc );
@@ -125,18 +110,4 @@
return result;
}
-
-#if 0
- struct stat sb;
- int s;
-
- s = stat( old, &sb);
- if ( s < 0 )
- return s;
- s = link( old, new );
- if ( s < 0 )
- return s;
- return S_ISDIR(sb.st_mode) ? rmdir( old ) : unlink( old );
-#endif
-
#endif
diff -u rtems/cpukit/libcsupport/src/getdents.c:1.9 rtems/cpukit/libcsupport/src/getdents.c:1.10
--- rtems/cpukit/libcsupport/src/getdents.c:1.9 Sun Apr 18 01:05:34 2004
+++ rtems/cpukit/libcsupport/src/getdents.c Thu Jul 1 12:47:46 2010
@@ -38,16 +38,12 @@
/*
* Get the file control block structure associated with the file descriptor
*/
-
iop = rtems_libio_iop( dd_fd );
/*
* Make sure we are working on a directory
*/
loc = iop->pathinfo;
- if ( !loc.ops->node_type_h )
- rtems_set_errno_and_return_minus_one( ENOTSUP );
-
if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY )
rtems_set_errno_and_return_minus_one( ENOTDIR );
@@ -55,9 +51,5 @@
* Return the number of bytes that were actually transfered as a result
* of the read attempt.
*/
-
- if ( !iop->handlers->read_h )
- rtems_set_errno_and_return_minus_one( ENOTSUP );
-
return (*iop->handlers->read_h)( iop, dd_buf, dd_len );
}
diff -u rtems/cpukit/libcsupport/src/unlink.c:1.20 rtems/cpukit/libcsupport/src/unlink.c:1.21
--- rtems/cpukit/libcsupport/src/unlink.c:1.20 Thu Jul 1 10:12:38 2010
+++ rtems/cpukit/libcsupport/src/unlink.c Thu Jul 1 12:47:46 2010
@@ -74,13 +74,6 @@
rtems_set_errno_and_return_minus_one( EISDIR );
}
- if ( !loc.ops->unlink_h ) {
- rtems_filesystem_freenode( &loc );
- if ( free_parentloc )
- rtems_filesystem_freenode( &parentloc );
- rtems_set_errno_and_return_minus_one( ENOTSUP );
- }
-
result = (*loc.ops->unlink_h)( &parentloc, &loc );
rtems_filesystem_freenode( &loc );
diff -u rtems/cpukit/libcsupport/src/utime.c:1.14 rtems/cpukit/libcsupport/src/utime.c:1.15
--- rtems/cpukit/libcsupport/src/utime.c:1.14 Thu Jul 1 11:29:17 2010
+++ rtems/cpukit/libcsupport/src/utime.c Thu Jul 1 12:47:47 2010
@@ -34,11 +34,6 @@
if ( rtems_filesystem_evaluate_path( path, strlen( path ), 0x00, &temp_loc, true ) )
return -1;
- if ( !temp_loc.ops->utime_h ){
- rtems_filesystem_freenode( &temp_loc );
- rtems_set_errno_and_return_minus_one( ENOTSUP );
- }
-
if ( times == NULL ) {
now.actime = now.modtime = time( NULL );
times = &now;
diff -u rtems/cpukit/libcsupport/src/writev.c:1.3 rtems/cpukit/libcsupport/src/writev.c:1.4
--- rtems/cpukit/libcsupport/src/writev.c:1.3 Sun Nov 29 07:35:32 2009
+++ rtems/cpukit/libcsupport/src/writev.c Thu Jul 1 12:47:48 2010
@@ -55,9 +55,6 @@
if ( iovcnt > IOV_MAX )
rtems_set_errno_and_return_minus_one( EINVAL );
- if ( !iop->handlers->write_h )
- rtems_set_errno_and_return_minus_one( ENOTSUP );
-
/*
* OpenGroup says that you are supposed to return EINVAL if the
* sum of the iov_len values in the iov array would overflow a
--
Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20100701/dc9bf95c/attachment-0001.html>
More information about the vc
mailing list