Path: utzoo!utgpu!attcan!uunet!mcvax!hp4nl!mhres!jv From: jv@mhres.mh.nl (Johan Vromans) Newsgroups: comp.sys.hp Subject: strange failure of chown(2) Keywords: chown inetd Message-ID: <2136@mhres.mh.nl> Date: 26 Jul 88 20:28:20 GMT Organization: Multihouse NV, the Netherlands Lines: 30 On my system, HP9000/320 running HP-UX 5.3, I encounter the following problem: I have a server configured under inetd, with the following line in /etc/inetd.conf : smtp stream tcp nowait mailer /etc/smtpd smtpd This program reads a smtp message from stdin, and then execs a mail delivery program. This program runs setgid 'mail'. This program creates a file in /usr/mail/, and calls chown(2) to change ownership to someone else (e.g. the recipient of the mail). The 'chown'-call fails with EPERM: "Not owner". But the file which was created in /usr/mail/ has owner 'mailer' and group 'mail' - just as can be expected. So - the program CREATES a file (this makes the program owner by definition), and then gets error NOT OWNER when it tries to chown it. As far as I have tried, this only happens when the program is run from the inetd. The problem disappears when I have the program run as user 'root' (change "mailer" into "root" in the /etc/inetd.conf line). Although I found a good work-around (running it as user 'root') I wonder what is happening here. Any suggestions? -- Johan