COMMAND
setprivgrp()
SYSTEMS AFFECTED
HP-UX 10.X, possibly others
PROBLEM
"...Only processes with an effective user ID equal to the file
owner or a user having appropriate privileges can change the
ownership of a file. If privilege groups are supported, the
owner of a file can change the ownership only as a member of a
privilege group allowing CHOWN, as set up by the setprivgrp
command (see setprivgrp(1M)). All users get the CHOWN privilege
by default..."
$ date
Thu Nov 7 11:17:24 PST 1996
$ getprivgrp
global privileges: CHOWN
$ pwd
/home/john
$ id
uid=110(john) gid=999(bla)
$ mkdir bla
$ chown john bla
$ chmod 6777 bla
$ ls -ldi bla
45696 drwsrwsrwx 2 john bla 24 Nov 7 11:12 bla
$ chown root bla
$ ls -ldi tmp
45696 drwsrwsrwx 2 root bla 24 Nov 7 11:12 bla
$ cd bla
$ touch hello
$ ls -ldi hello
45697 -rw-rw-rw- 1 john bla 0 Nov 7 11:12 hello
$ chmod 6777 hello
$ chown root hello
$ ls -ldi hello
45697 -rwxrwxrwx 1 root bla 0 Nov 7 11:12 hello
SOLUTION
If you don't want your HP-UX system to allow users to give away
files (which is the standard SysV behavior) create a file called
/etc/privgroup with "-g" in it, and this will be used as an
argument to a setprivgrp call on startup which will prevent this.