change log for rtems (2011-07-31)

rtems-vc at rtems.org rtems-vc at rtems.org
Sun Jul 31 15:11:10 UTC 2011


 *joel* (on branch rtems-4-10-branch):
2011-07-31	Joel Sherrill <joel.sherrilL at OARcorp.com>

	PR 1839/filesystem
	* libcsupport/include/rtems/libio_.h, libcsupport/src/fchdir.c,
	libcsupport/src/fdatasync.c, libcsupport/src/fpathconf.c,
	libcsupport/src/fsync.c, libcsupport/src/ftruncate.c,
	libcsupport/src/read.c, libcsupport/src/readv.c,
	libcsupport/src/write.c, libcsupport/src/writev.c: Some calls did not
	return proper status for permission errors or incorrectly permissions
	at all.

M 1.2346.2.99  cpukit/ChangeLog
M 1.34.2.4  cpukit/libcsupport/include/rtems/libio_.h
M 1.9.2.1  cpukit/libcsupport/src/fchdir.c
M 1.10.8.1  cpukit/libcsupport/src/fdatasync.c
M 1.9.8.1  cpukit/libcsupport/src/fpathconf.c
M 1.11.8.1  cpukit/libcsupport/src/fsync.c
M 1.12.8.1  cpukit/libcsupport/src/ftruncate.c
M 1.15.2.1  cpukit/libcsupport/src/read.c
M 1.4.2.1  cpukit/libcsupport/src/readv.c
M 1.16.4.1  cpukit/libcsupport/src/write.c
M 1.3.2.1  cpukit/libcsupport/src/writev.c

diff -u rtems/cpukit/ChangeLog:1.2346.2.98 rtems/cpukit/ChangeLog:1.2346.2.99
--- rtems/cpukit/ChangeLog:1.2346.2.98	Tue Jul 19 08:14:07 2011
+++ rtems/cpukit/ChangeLog	Sun Jul 31 09:12:27 2011
@@ -1,3 +1,14 @@
+2011-07-31	Joel Sherrill <joel.sherrilL at OARcorp.com>
+
+	PR 1839/filesystem
+	* libcsupport/include/rtems/libio_.h, libcsupport/src/fchdir.c,
+	libcsupport/src/fdatasync.c, libcsupport/src/fpathconf.c,
+	libcsupport/src/fsync.c, libcsupport/src/ftruncate.c,
+	libcsupport/src/read.c, libcsupport/src/readv.c,
+	libcsupport/src/write.c, libcsupport/src/writev.c: Some calls did not
+	return proper status for permission errors or incorrectly permissions
+	at all.
+
 2011-07-19	Joel Sherrill <joel.sherrilL at OARcorp.com>
 
 	PR 1838/filesystem

diff -u rtems/cpukit/libcsupport/include/rtems/libio_.h:1.34.2.3 rtems/cpukit/libcsupport/include/rtems/libio_.h:1.34.2.4
--- rtems/cpukit/libcsupport/include/rtems/libio_.h:1.34.2.3	Wed May 25 09:17:51 2011
+++ rtems/cpukit/libcsupport/include/rtems/libio_.h	Sun Jul 31 09:12:29 2011
@@ -124,20 +124,31 @@
   } while (0)
 
 /*
- *  rtems_libio_check_permissions
+ *  rtems_libio_check_permissions_with_error
  *
  *  Macro to check if a file descriptor is open for this operation.
+ *  On failure, return the user specified error.
  */
 
-#define rtems_libio_check_permissions(_iop, _flag)          \
+#define rtems_libio_check_permissions_with_error(_iop, _flag, _errno) \
   do {                                                      \
       if (((_iop)->flags & (_flag)) == 0) {                 \
-            rtems_set_errno_and_return_minus_one( EINVAL ); \
+            rtems_set_errno_and_return_minus_one( _errno ); \
             return -1;                                      \
       }                                                     \
   } while (0)
 
 /*
+ *  rtems_libio_check_permissions
+ *
+ *  Macro to check if a file descriptor is open for this operation.
+ *  On failure, return EINVAL
+ */
+
+#define rtems_libio_check_permissions(_iop, _flag) \
+   rtems_libio_check_permissions_with_error(_iop, _flag, EINVAL )
+
+/*
  *  rtems_filesystem_freenode
  *
  *  Macro to free a node.

diff -u rtems/cpukit/libcsupport/src/fchdir.c:1.9 rtems/cpukit/libcsupport/src/fchdir.c:1.9.2.1
--- rtems/cpukit/libcsupport/src/fchdir.c:1.9	Thu Jun 11 20:53:32 2009
+++ rtems/cpukit/libcsupport/src/fchdir.c	Sun Jul 31 09:12:29 2011
@@ -1,7 +1,7 @@
 /*
  *  fchdir() - compatible with SVr4, 4.4BSD and X/OPEN - Change Directory
  *
- *  COPYRIGHT (c) 1989-2000.
+ *  COPYRIGHT (c) 1989-2011.
  *  On-Line Applications Research Corporation (OAR).
  *
  *  The license and distribution terms for this file may be
@@ -36,12 +36,6 @@
   rtems_libio_check_is_open(iop);
 
   /*
-   *  Now process the fchmod().
-   */
-
-  rtems_libio_check_permissions( iop, LIBIO_FLAGS_READ );
-
-  /*
    * Verify you can change directory into this node.
    */
 

diff -u rtems/cpukit/libcsupport/src/fdatasync.c:1.10 rtems/cpukit/libcsupport/src/fdatasync.c:1.10.8.1
--- rtems/cpukit/libcsupport/src/fdatasync.c:1.10	Thu Sep  4 13:54:13 2003
+++ rtems/cpukit/libcsupport/src/fdatasync.c	Sun Jul 31 09:12:29 2011
@@ -1,7 +1,7 @@
 /*
  *  fdatasync() - POSIX 1003.1b 6.6.2 - Synchronize the Data of a File
  *
- *  COPYRIGHT (c) 1989-1999.
+ *  COPYRIGHT (c) 1989-2011.
  *  On-Line Applications Research Corporation (OAR).
  *
  *  The license and distribution terms for this file may be
@@ -29,7 +29,7 @@
   rtems_libio_check_fd( fd );
   iop = rtems_libio_iop( fd );
   rtems_libio_check_is_open(iop);
-  rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE );
+  rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_WRITE, EBADF );
 
   /*
    *  Now process the fdatasync().

diff -u rtems/cpukit/libcsupport/src/fpathconf.c:1.9 rtems/cpukit/libcsupport/src/fpathconf.c:1.9.8.1
--- rtems/cpukit/libcsupport/src/fpathconf.c:1.9	Thu Sep  4 13:54:13 2003
+++ rtems/cpukit/libcsupport/src/fpathconf.c	Sun Jul 31 09:12:29 2011
@@ -1,7 +1,7 @@
 /*
  *  fpathconf() - POSIX 1003.1b - 5.7.1 - Configurable Pathname Varables
  *
- *  COPYRIGHT (c) 1989-1999.
+ *  COPYRIGHT (c) 1989-2011.
  *  On-Line Applications Research Corporation (OAR).
  *
  *  The license and distribution terms for this file may be
@@ -33,7 +33,6 @@
   rtems_libio_check_fd(fd);
   iop = rtems_libio_iop(fd);
   rtems_libio_check_is_open(iop);
-  rtems_libio_check_permissions(iop, LIBIO_FLAGS_READ);
 
   /*
    *  Now process the information request.

diff -u rtems/cpukit/libcsupport/src/fsync.c:1.11 rtems/cpukit/libcsupport/src/fsync.c:1.11.8.1
--- rtems/cpukit/libcsupport/src/fsync.c:1.11	Thu Sep  4 13:54:13 2003
+++ rtems/cpukit/libcsupport/src/fsync.c	Sun Jul 31 09:12:29 2011
@@ -1,7 +1,7 @@
 /*
  *  fsync() - POSIX 1003.1b 6.6.1 - Synchronize the State of a File
  *
- *  COPYRIGHT (c) 1989-1999.
+ *  COPYRIGHT (c) 1989-2011.
  *  On-Line Applications Research Corporation (OAR).
  *
  *  The license and distribution terms for this file may be
@@ -29,7 +29,6 @@
   rtems_libio_check_fd( fd );
   iop = rtems_libio_iop( fd );
   rtems_libio_check_is_open(iop);
-  rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE );
 
   /*
    *  Now process the fsync().

diff -u rtems/cpukit/libcsupport/src/ftruncate.c:1.12 rtems/cpukit/libcsupport/src/ftruncate.c:1.12.8.1
--- rtems/cpukit/libcsupport/src/ftruncate.c:1.12	Sun Apr 18 01:05:34 2004
+++ rtems/cpukit/libcsupport/src/ftruncate.c	Sun Jul 31 09:12:29 2011
@@ -32,6 +32,7 @@
   rtems_libio_check_fd( fd );
   iop = rtems_libio_iop( fd );
   rtems_libio_check_is_open(iop);
+  rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE );
 
   /*
    *  Now process the ftruncate() request.

diff -u rtems/cpukit/libcsupport/src/read.c:1.15 rtems/cpukit/libcsupport/src/read.c:1.15.2.1
--- rtems/cpukit/libcsupport/src/read.c:1.15	Wed Sep 30 03:20:31 2009
+++ rtems/cpukit/libcsupport/src/read.c	Sun Jul 31 09:12:29 2011
@@ -32,7 +32,7 @@
   rtems_libio_check_is_open( iop );
   rtems_libio_check_buffer( buffer );
   rtems_libio_check_count( count );
-  rtems_libio_check_permissions( iop, LIBIO_FLAGS_READ );
+  rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_READ, EBADF );
 
   /*
    *  Now process the read().

diff -u rtems/cpukit/libcsupport/src/readv.c:1.4 rtems/cpukit/libcsupport/src/readv.c:1.4.2.1
--- rtems/cpukit/libcsupport/src/readv.c:1.4	Sun Apr 25 14:50:05 2010
+++ rtems/cpukit/libcsupport/src/readv.c	Sun Jul 31 09:12:29 2011
@@ -5,7 +5,7 @@
  *
  *  http://www.opengroup.org/onlinepubs/009695399/functions/readv.html
  *
- *  COPYRIGHT (c) 1989-2007.
+ *  COPYRIGHT (c) 1989-2011.
  *  On-Line Applications Research Corporation (OAR).
  *
  *  The license and distribution terms for this file may be
@@ -40,7 +40,7 @@
   rtems_libio_check_fd( fd );
   iop = rtems_libio_iop( fd );
   rtems_libio_check_is_open( iop );
-  rtems_libio_check_permissions( iop, LIBIO_FLAGS_READ );
+  rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_READ, EBADF );
 
   /*
    *  Argument validation on IO vector

diff -u rtems/cpukit/libcsupport/src/write.c:1.16 rtems/cpukit/libcsupport/src/write.c:1.16.4.1
--- rtems/cpukit/libcsupport/src/write.c:1.16	Thu Sep 20 17:25:14 2007
+++ rtems/cpukit/libcsupport/src/write.c	Sun Jul 31 09:12:29 2011
@@ -39,7 +39,7 @@
   rtems_libio_check_is_open( iop );
   rtems_libio_check_buffer( buffer );
   rtems_libio_check_count( count );
-  rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE );
+  rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_WRITE, EBADF );
 
   /*
    *  Now process the write() request.

diff -u rtems/cpukit/libcsupport/src/writev.c:1.3 rtems/cpukit/libcsupport/src/writev.c:1.3.2.1
--- rtems/cpukit/libcsupport/src/writev.c:1.3	Sun Nov 29 07:35:32 2009
+++ rtems/cpukit/libcsupport/src/writev.c	Sun Jul 31 09:12:29 2011
@@ -5,7 +5,7 @@
  *
  *  http://www.opengroup.org/onlinepubs/009695399/functions/writev.html
  *
- *  COPYRIGHT (c) 1989-2007.
+ *  COPYRIGHT (c) 1989-2011.
  *  On-Line Applications Research Corporation (OAR).
  *
  *  The license and distribution terms for this file may be
@@ -41,7 +41,7 @@
   rtems_libio_check_fd( fd );
   iop = rtems_libio_iop( fd );
   rtems_libio_check_is_open( iop );
-  rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE );
+  rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_WRITE, EBADF );
 
   /*
    *  Argument validation on IO vector



--

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/20110731/995ba3eb/attachment.html>


More information about the vc mailing list