Off the top of my head, I'd guess it's a problem with mount
permissions, since fattach() now uses the mount() syscall.

Specifically, non-root users are not by default allowed to do mounts,
and since an fattach() is a mount, a non-root user will be thus be
blocked from doing an fattach().

I don't know how easy it would be to change, and I'm not sure that
I would agree with a change.  There is a security issue here, and
that needs to be thought through; otherwise allowing fattach might
become an unwitting vulnerability.

It likely involves the LiS filesystem superblock structures as well,
which are where default mount permissions originate.  This is touchy
stuff, because the kernel will only follow through on the kind of mount
fattach does with certain options in effect, and forces some options of
its own.  I.e., this is not a directory mount, nor is a LiS stream a
block device, and so on.

I'll try to look into this as time permits.

-John

David Grothe wrote:
I'm not an fattach specialist, so maybe someone else can answer this.
-- Dave

Subject: fattach failed on application without super user privilege
To: [EMAIL PROTECTED]
From: [EMAIL PROTECTED]
Date: Thu, 25 Sep 2003 09:59:18 -0400


Hi,
I have an application running with LiS-2.16/Linux 2.4.18. The application
create named pipe, and push connld, and attach it (the program showed in
belows). It always failed on the calling fattach fucntion if the
application does not have super-user privilege. I tried fattach utility and
got the same result ("Operation is not permitted"). If the application run
on the super user mode, it succeeded. I need my application run on
non-super user mode, how can I do it ? Thanks



#include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <memory.h> #include <fcntl.h> #include <errno.h> #include <limits.h> #include <stropts.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/sysmacros.h> #include <sys/ioctl.h>


int main( int argc, char *argv[] ) { int fd[2];

      if (pipe(fd) < 0)  {
            fprintf( stderr,
                  "pipe() failed: %s\n", strerror(errno) );
            exit(1);
      }
      fcntl(fd[1], F_SETFL, O_NONBLOCK);
      mknod("pipe1", S_IFIFO | 0666, 0);

      if (ioctl( fd[1], I_PUSH, "connld" ) < 0) {
            fprintf( stderr,
                  "ioctl( %d, I_PUSH, connld ) failed: %s\n",
                  fd[1], strerror(errno) );
            exit(1);
      }

      if (fattach( fd[1], "pipe1" ) < 0) {
            fprintf( stderr, "fattach( %d, \"pipe1\" ) failed: %d %s\n",
                  fd[1], errno, strerror(errno) );
            exit(1);
      }

      close(fd[0]);
      close(fd[1]);

      exit(0);
}



Frank Chi
Senior Programming Engineer
Ingenico Atlanta
(678) 795-2850 Direct
(770) 594-6003 Fax



_______________________________________________ Linux-streams mailing list [EMAIL PROTECTED] http://gsyc.escet.urjc.es/mailman/listinfo/linux-streams




_______________________________________________
Linux-streams mailing list
[EMAIL PROTECTED]
http://gsyc.escet.urjc.es/mailman/listinfo/linux-streams

Reply via email to