rpms/ncpfs/FC-3 ncpfs-2.2.4-getuid.patch, NONE, 1.1 ncpfs.spec, 1.14, 1.15

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon Apr 11 11:53:44 UTC 2005


Update of /cvs/dist/rpms/ncpfs/FC-3
In directory cvs.devel.redhat.com:/tmp/cvs-serv27255

Modified Files:
	ncpfs.spec 
Added Files:
	ncpfs-2.2.4-getuid.patch 
Log Message:
fixed getuid security bug CAN-2005-0013


ncpfs-2.2.4-getuid.patch:
 contrib/tcl-utils/chgpwd.c       |    4 ++--
 contrib/tcl-utils/ncplist.c      |    7 ++++++-
 contrib/tcl-utils/ncpreadprop.c  |    2 +-
 contrib/tcl-utils/ncpreadprops.c |    2 +-
 lib/nwclient.c                   |   12 ++++++++----
 sutil/ncplogin.c                 |    5 ++++-
 6 files changed, 22 insertions(+), 10 deletions(-)

--- NEW FILE ncpfs-2.2.4-getuid.patch ---
--- ncpfs-2.2.4/sutil/ncplogin.c.nogetuid	2004-02-10 13:28:47.000000000 -0500
+++ ncpfs-2.2.4/sutil/ncplogin.c	2005-04-08 07:00:22.819565176 -0400
@@ -582,7 +582,10 @@
 		int flags = 0;
 
 		if (!info.tree) {
-			NWCXGetPreferredDSTree(ntree, sizeof(ntree));
+			err=NWCXGetPreferredDSTree(ntree, sizeof(ntree));
+			if (err){
+			   errexit(104, _("Cannot get preffered DS tree: %s\n"),strnwerror(err));
+			}
 			info.tree = ntree;
 		}
 
--- ncpfs-2.2.4/lib/nwclient.c.nogetuid	2004-02-10 13:28:49.000000000 -0500
+++ ncpfs-2.2.4/lib/nwclient.c	2005-04-08 06:57:58.657481144 -0400
@@ -497,6 +497,10 @@
                 *err = errno;
                 return NULL;
         }
+        if (st.st_uid != getuid()) {
+                *err = EACCES;
+                return NULL;
+        }
         if ((st.st_mode & (S_IRWXO | S_IRWXG)) != 0) {
                 *err = NCPLIB_INVALID_MODE;
                 return NULL;
@@ -576,7 +580,7 @@
   if (!res)
         res=readnwinfosfile (NULL,NDS_PREFERRED_TREE,NULL, &err);
   if (!res)
-    return -1;
+    return err;
   if (strlen (res)+1 >maxLen)
      return NWE_BUFFER_OVERFLOW;
   strcpy(preferTree,res);
@@ -597,7 +601,7 @@
    if (!res)
         res=readnwinfosfile (NULL,NDS_PREFERRED_NAME_CTX,forTree,&err);
   if (!res)
-    return -1;
+    return err;
   if (strlen (res)+1 >maxLen)
      return NWE_BUFFER_OVERFLOW;
   strcpy(nameContext,res);
@@ -619,7 +623,7 @@
 
 		res=readnwinfosfile (NULL, NDS_PREFERRED_SERVER, forTree, &err);
 		if (!res) {
-			return -1;
+			return err;
 		}
 	}
 	/* test that this server DO belongs to tree forTree*/
@@ -660,7 +664,7 @@
          if (!res)
                 res=readnwinfosfile (NULL,NDS_USER,forTree, &err);
          if (!res)
-                return -1;
+                return err;
         if (strlen (res)+1 >maxLen)
                 return NWE_BUFFER_OVERFLOW;
         strcpy(defaultName,res);
--- ncpfs-2.2.4/contrib/tcl-utils/ncpreadprop.c.nogetuid	2004-02-10 13:28:48.000000000 -0500
+++ ncpfs-2.2.4/contrib/tcl-utils/ncpreadprop.c	2005-04-08 06:57:58.658480992 -0400
@@ -470,7 +470,7 @@
             }
         } else {
                 if (!treeName[0]) {
-                         NWCXGetPreferredDSTree(treeName,sizeof(treeName));
+                         dserr=NWCXGetPreferredDSTree(treeName,sizeof(treeName));
 
                 }
                 if (!treeName[0]) {
--- ncpfs-2.2.4/contrib/tcl-utils/ncplist.c.nogetuid	2004-02-10 13:28:47.000000000 -0500
+++ ncpfs-2.2.4/contrib/tcl-utils/ncplist.c	2005-04-08 06:57:58.659480840 -0400
@@ -299,7 +299,12 @@
         }else {
 
                 if (!treeName[0]) {
-                         NWCXGetPreferredDSTree(treeName,sizeof(treeName));
+                         dserr=NWCXGetPreferredDSTree(treeName,sizeof(treeName));
+                         if (dserr){
+                            fprintf(stderr, "failed: Cannot get preffered DS tree: %s\n",
+                                    strnwerror(dserr);
+			    exit(106);
+			 }
 
                 }
                 if (!treeName[0]) {
--- ncpfs-2.2.4/contrib/tcl-utils/ncpreadprops.c.nogetuid	2004-02-10 13:28:49.000000000 -0500
+++ ncpfs-2.2.4/contrib/tcl-utils/ncpreadprops.c	2005-04-08 06:57:58.659480840 -0400
@@ -507,7 +507,7 @@
             }
         } else {
                 if (!treeName[0]) {
-                         NWCXGetPreferredDSTree(treeName,sizeof(treeName));
+                         dserr=NWCXGetPreferredDSTree(treeName,sizeof(treeName));
 
                 }
                 if (!treeName[0]) {
--- ncpfs-2.2.4/contrib/tcl-utils/chgpwd.c.nogetuid	2004-02-10 13:28:47.000000000 -0500
+++ ncpfs-2.2.4/contrib/tcl-utils/chgpwd.c	2005-04-08 06:57:58.660480688 -0400
@@ -292,12 +292,12 @@
 	        }
         } else {
                 if (!treeName[0]) {
-                         NWCXGetPreferredDSTree(treeName,sizeof(treeName));
+                         dserr=NWCXGetPreferredDSTree(treeName,sizeof(treeName));
 
                 }
                 if (!treeName[0]) {
                         fprintf(stderr,"failed: You must specify a server or a tree\n");
-                        dserr=114;
+                        /*dserr=114;*/
                         goto finished;
                 }
 


Index: ncpfs.spec
===================================================================
RCS file: /cvs/dist/rpms/ncpfs/FC-3/ncpfs.spec,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- ncpfs.spec	9 Sep 2004 09:04:36 -0000	1.14
+++ ncpfs.spec	11 Apr 2005 11:53:42 -0000	1.15
@@ -1,13 +1,14 @@
 Summary: Utilities for the ncpfs filesystem, a NetWare client for Linux.
 Name: ncpfs
 Version:  2.2.4
-Release: 4
+Release: 4.FC3
 License:  GPL
 Source: http://ftp.cvut.cz/ncpfs/ncpfs-%{version}.tar.gz
 Patch: ncpfs-2.2.3-fix.patch
 Patch1: ncpfs-2.2.3-array.patch
 Patch2: ncpfs-2.2.3-lvalue.patch
 Patch3: ncpfs-2.2.4-pie.patch
+Patch4: ncpfs-2.2.4-getuid.patch
 Group: Applications/System
 Requires: ipxutils
 Buildroot: %{_tmppath}/%{name}-%{version}-root
@@ -41,6 +42,7 @@
 %patch1 -p1 -b .array
 %patch2 -p1 -b .lvalue
 %patch3 -p1 -b .pie
+%patch4 -p1 -b .nogetuid
 
 %build
 %ifarch s390 s390x
@@ -110,6 +112,9 @@
 %{_mandir}/man8/ipx*
 
 %changelog
+* Mon Apr 11 2005 Jiri Ryska <jryska at redhat.com> 2.2.4-4.FC3
+- fixed getuid security bug CAN-2005-0013
+
 * Tue Jun 15 2004 Elliot Lee <sopwith at redhat.com>
 - rebuilt
 




More information about the fedora-cvs-commits mailing list