*BSD News Article 33648


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msuinfo!agate!howland.reston.ans.net!usenet.ins.cwru.edu!eff!news.kei.com!travelers.mail.cornell.edu!newsstand.cit.cornell.edu!news.graphics.cornell.edu!ghost.dsi.unimi.it!univ-lyon1.fr!frmug.fr.net!renux.frmug.fr.net!keltia.frmug.fr.net!not-for-mail
From: roberto@keltia.frmug.fr.net (Ollivier Robert)
Newsgroups: comp.os.386bsd.questions
Subject: Re: 1.1G: uucp: permission denied ?
Date: 31 Jul 1994 15:39:00 +0200
Organization: A Happy FreeBSD 1.1.5 Usenet Site
Lines: 62
Message-ID: <31g9i2$4ir@keltia.frmug.fr.net>
References: <Cto0B9.2EC@jester.GUN.de>
Reply-To: roberto@hsc.fr.net (Ollivier Robert)
NNTP-Posting-Host: keltia.frmug.fr.net
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

In article <Cto0B9.2EC@jester.GUN.de>,
Michael Gerhards <michael@jester.GUN.de> wrote:
> When I started the command "uucp file system!~/file" as a normal user, I
> got the message: "uucp: fopen(system/D./D.000A) permission denied".
> ( I'm using the /bin/sh, so I don't need to escape the ! )

If you're using Taylor UUCP 1.05, you'l have to  change the following flags
in /usr/src/gnu/libexec/uucp/common_sources/policy.h :

------------------------------------------------------------
/* If your system does not support saved set user ID, set
   HAVE_SAVED_SETUID to 0.  However, this is ignored if your system
   has the setreuid function.  Most modern Unixes have one or the
   other.  If your system has the setreuid function, don't worry about
   this define, or about the following discussion.

   If you set HAVE_SAVED_SETUID to 0, you will not be able to use uucp
   to transfer files that the uucp user can not read.  Basically, you
   will only be able to use uucp on world-readable files.  If you set
   HAVE_SAVED_SETUID to 1, but your system does not have saved set
   user ID, uucp will fail with an error message whenever anybody
   other than the uucp user uses it.  */
#define HAVE_SAVED_SETUID 0

/* On some systems, such as the DG Aviion and, possibly, the RS/6000,
   the setreuid function is broken.  It should be possible to use
   setreuid to swap the real and effective user ID's, but on some
   systems it will not change the real user ID (I believe this is due
   to a misreading of the POSIX standard).  On such a system you must
   set HAVE_BROKEN_SETREUID to 1; if you do not, you will get error
   messages from setreuid.  Systems on which setreuid exists but is
   broken pretty much always have saved setuid.  */
#define HAVE_BROKEN_SETREUID 1
------------------------------------------------------------

It should work much better after that.

Beware there is another bug in 1.05 that I fixed  a few months ago. When it
has to create  a   destination tree  (e.g. you  asked  to  put  a  file  in
~////path///with/multiple/slashes/) it failed. Here is the patch :

/usr/src/gnu/libexec/uucp/libunix/mkdirs.c
------------------------------------------------------------
--- mkdirs.c.DIST	Thu May 12 19:57:10 1994
+++ mkdirs.c	Thu May 19 21:25:40 1994
@@ -38,7 +38,10 @@
 	      ubuffree (zcopy);
 	      return FALSE;
 	    }
-	  *z = '/';
+	  *z = '/';     /* replace '/' in its place */
+          		/* now skips over multiple '/' in name */
+          while ( (*(z + 1)) && (*(z + 1)) == '/')
+              z++;
 	}
     }

------------------------------------------------------------
-- 
Ollivier ROBERT                                           roberto@hsc.fr.net
Hervé Schauer Consultants                Ollivier.Robert@keltia.frmug.fr.net
PERL / MIME / PGP 2.6ui         FreeBSD keltia 1.1.5(RELEASE) RELEASE#0 i386