Operating System - HP-UX
1849322 Members
7056 Online
104042 Solutions
New Discussion

Permission Denied on Write Command

 
Tommy_6
Regular Advisor

Permission Denied on Write Command

I am trying to allow our user access to the write command. I created a C wrapper for the write command and did a chmod of 6555 and chown root:tty on the compiled code. I am able to run it as root without a problem, but the users cannot. They get a Permission Denied" error. They are able to run the write command by itself and the syntax is returned. Here is the command they are running:

write username pts/tb < testfile

I run the exact same process for the wall command and the wall command works fine for the users. I appreciate any help you can provide.

Tommy
1 REPLY 1
OldSchool
Honored Contributor

Re: Permission Denied on Write Command

Not sure the problem is your code...

I tried copying the existing "write" to "mywrite" and played w/ the setuid / gid and sticky bits....got the same result you did.

I did note however that:
a) sudo write .... works ok,
b) issuing "mesg y" in profile opens terminal so anybody can write to that terminal...which may be sufficient for your needs (or not)