Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37375936
en ru br
Репозитории ALT
5.1: 2.2.6-alt7
4.1: 2.2.6-alt7
4.0: 2.2.6-alt6
3.0: 2.2.6-alt1
www.altlinux.org/Changes

Группа :: Сети/Прочее
Пакет: ncpfs

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: ncpfs-2.2.6-getuid.patch
Скачать


--- ncpfs-2.2.6/contrib/tcl-utils/ncplist.c.getuid	2005-01-27 18:35:59.000000000 +0100
+++ ncpfs-2.2.6/contrib/tcl-utils/ncplist.c	2005-11-11 14:37:41.000000000 +0100
@@ -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.6/contrib/tcl-utils/chgpwd.c.getuid	2005-01-27 18:35:59.000000000 +0100
+++ ncpfs-2.2.6/contrib/tcl-utils/chgpwd.c	2005-11-11 14:37:41.000000000 +0100
@@ -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;
                 }
 
--- ncpfs-2.2.6/contrib/tcl-utils/ncpreadprops.c.getuid	2005-01-27 18:35:59.000000000 +0100
+++ ncpfs-2.2.6/contrib/tcl-utils/ncpreadprops.c	2005-11-11 14:37:41.000000000 +0100
@@ -507,7 +507,7 @@
             }
         } else {
                 if (!treeName[0]) {
-                         NWCXGetPreferredDSTree(treeName,sizeof(treeName));
+                         dserr=NWCXGetPreferredDSTree(treeName,sizeof(treeName));
 
                 }
                 if (!treeName[0]) {
--- ncpfs-2.2.6/contrib/tcl-utils/ncpreadprop.c.getuid	2005-01-27 18:35:59.000000000 +0100
+++ ncpfs-2.2.6/contrib/tcl-utils/ncpreadprop.c	2005-11-11 14:37:41.000000000 +0100
@@ -470,7 +470,7 @@
             }
         } else {
                 if (!treeName[0]) {
-                         NWCXGetPreferredDSTree(treeName,sizeof(treeName));
+                         dserr=NWCXGetPreferredDSTree(treeName,sizeof(treeName));
 
                 }
                 if (!treeName[0]) {
--- ncpfs-2.2.6/sutil/ncplogin.c.getuid	2005-01-27 18:35:59.000000000 +0100
+++ ncpfs-2.2.6/sutil/ncplogin.c	2005-11-11 14:37:30.000000000 +0100
@@ -588,7 +588,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.6/lib/nwclient.c.getuid	2005-01-27 18:35:59.000000000 +0100
+++ ncpfs-2.2.6/lib/nwclient.c	2005-11-11 14:37:41.000000000 +0100
@@ -481,6 +481,10 @@
                 *err = EACCES;
                 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;
@@ -560,7 +564,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);
@@ -581,7 +585,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);
@@ -603,7 +607,7 @@
 
 		res=readnwinfosfile (NULL, NDS_PREFERRED_SERVER, forTree, &err);
 		if (!res) {
-			return -1;
+			return err;
 		}
 	}
 	/* test that this server DO belongs to tree forTree*/
@@ -644,7 +648,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);
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin