Newsgroups: comp.sys.hp Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!ghost.unimi.it!marco From: marco@ghost.unimi.it (Marco Negri) Subject: NFS root uid == -2 : Solution Message-ID: <1991May13.203301.13754@ghost.unimi.it> Organization: Computer Science Dep. - Milan University Date: Mon, 13 May 1991 20:33:01 GMT Lines: 164 I have posted, yesterday, an help request about root uid == -2 on remote access to an NFS. I have recived many respond, thanks very much to everybody, and I have tested it on hp-ux 7.0 on an hp9000s800 (825/835/855). The solution is to patch the value of "nobody" Kernel variable. nobody represent the uid of root when made a remote access. Sources are enclosed, simple and run fine. Marco. -- Marco Negri Phone : +39-2-7575242 Computer Science Dep. Milan University Fax : +39-2-76110556 Via Moretto da Brescia, 9 Telex : 335199 - MIDSII I-20133 Milano - Italy - `92 Europe E-Mail : marco@ghost.unimi.it #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh Makefile <<'@EOF' X# X# $Author: marco $ X# $Id: Makefile,v 1.1 1991/05/13 18:33:26 marco Exp marco $ X# $Date: 1991/05/13 18:33:26 $ X# $Revision: 1.1 $ X# $Lock:$ X# X XCFLAGS = -O -s -n XINST = /usr/local/bin X Xnfspatch : nfspatch.c X cc $(CFLAGS) $@.c -o $@ X cpset $@ $(INST) @EOF set `wc -lwc nfspatch.c <<'@EOF' X/* X * $Author: marco $ X * $Id: nfspatch.c,v 1.1 1991/05/13 18:33:26 marco Exp marco $ X * $Date: 1991/05/13 18:33:26 $ X * $Revision: 1.1 $ X * $Lock:$ X */ X X#ifndef lint Xstatic char *rcsid = "@(#) $Id: nfspatch.c,v 1.1 1991/05/13 18:33:26 marco Exp marco $"; X#endif lint X X#include X#include X#include X Xstruct nlist nl_tbl[] = { X#ifdef hp9000s800 X {"nobody", 0}, X#else hp9000s800 X {"_nobody", 0}, X#endif hp9000s800 X {0} X}; X X#define ADDR nl_tbl[0].n_value X X#define KERNEL "/hp-ux" X Xmain(argc, argv) Xint argc; Xchar *argv[]; X{ X register int i = 0; X int fd; X int v = 0; X X if (argc > 2) { X fprintf(stderr, "Usage : %s [remote-root-uid]\n", argv[0]); X exit(1); X } X X if (argc == 2) X v = atoi(argv[1]); X X if (nlist(KERNEL, nl_tbl) == -1) { X perror("nlist()"); X exit(1); X } X X if ((fd = open("/dev/kmem", O_RDWR)) == -1) { X perror("/dev/kmem"); X exit(1); X } X X if (lseek(fd, ADDR, 0) != ADDR) { X perror("lseek()"); X exit(1); X } X X if (write(fd, &v, sizeof(v)) != sizeof(v)) { X perror("write()"); X exit(1); X } X X exit(0); X} @EOF set `wc -lwc