Re: How to make mount command mount partions as user not only as root ?



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

In article <g0gac2$1dc1$1@xxxxxxxxxxx>,
=SERGE= wrote:

Why cant' I pass params to mount command directly?

It can be done with a wrapper program:

extern int execve(char *,char **,char **);
extern int setuid(int);
const char m[] = "/bin/mount";
int
main(int ac, char **av, char **ev)
{
av[0] = m;
setuid(0);
execve(m,av,ev);
return 1;
}

Put these lines in file 'mymount.c'
Compile with 'cc -o mymount mymount.c' (ignore warnings)
Run 'su -c "install -so root -m 4550 mymount ${HOME}/bin/mount"'
Make sure '${HOME}/bin' is the first directory in ${PATH}

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFIK+rC+Gl3NVTic0gRApJHAJ470epkN5zxsD7FwVVHBqqNs12lKQCgp5ca
vrPODepYGzdemVyzxYO7vyM=
=9BSt
-----END PGP SIGNATURE-----
.