changing ownership of 'file name' : operation not permitted
I`ve been given a project to design a program that will interface with a hardware device through the parallel port.And so far it`s not going go.
I managed to write the programe an compiled it, but when runing it the compiler says: 'changing ownership of'and then the file name then it continues to say, 'operation not permitted'. Guys please help! its already overdue. |
May ge super user issue
Run it as root Quote:
Quote:
|
yes I am running it as root, the su method, and if I don`t use the root it says segmentation fault.
|
We need more information.
Which compiler and compiler version do you use? Which distribution? What is your compile command? Where are your files located (ls -l)? If you are trying to run the program, the compiler doesn't do anything.It did it's work before. The code would also be helpful. |
Quote:
I think you can run the command "cat 0 > /selinux/enforce; reboot" to disable it and reboot. |
[QUOTE=Virgil B;4127146]I`ve been given a project to design a program that will interface with a hardware device through the parallel port.And so far it`s not going go.
I managed to write the programe an compiled it, but when runing it the compiler says: 'changing ownership of'and then the file name then it continues to say, 'operation not permitted'. Im using a LINUX G++ compiler, what version i don`t know,and im using the command su {enter possword} chown root:root scriptname chown 4755 scriptname and I saved as an .c file PLEASE DONT BE TO HARD ON ME GUEST IM NEW ON THIS PROGRAMMING ENVIRONMENT,EXPLAIN AS CLEARLY AS POSSIBLE. I ONLY KNOW A HAND FULL ABOUT PROGRAMMING AND ITS LANGUAGES |
Segfaults
Hello!
Virgil, segfaults are usually signs that you have escaped allowed address range due to programming mistakes or other false assumptions. I.e. you address null pointer (quite typical) and so on. AFAIK, to check parallel port you just need to send something to it through command line interface like this: echo -e "\\033E" > /dev/lp0 HP LJ/DJ should eject a paper sheet (reset itself), Epson will just switch bold font on so it's all harmless for a printer. If this all works, 100% you've got something wrong in your program. [QUOTE=Virgil B;4127185] Quote:
|
If you are using g++ asumming you are coding in c++ you need to save your file as .cpp saving the file with .c is used for c language and not c++. If you are coding C language then you need to use gcc and save as .c
Good luck to u Note man g++ That will give you the man page and give you some command to tell version etc. |
If you are running the program as root then the process real uid will be root uid. But to determine what resources the process can access effective uid is used. I think in your case effective uid is not privileged to change the ownership of the file(On most of the system only root can change the ownership)
You can make sure by printing the real uid and effective uid of the process (getuid(),geteuid()). If the process effective uid is not equal to root uid then try setting effective uid to root uid(seteuid()) |
It would probably be helpful if you could be more specific about when you get the error, where the file lives, etc. So perhaps run the commands you listed above, and then copy/paste everything from the terminal into a post here. The basic rule is: The more information you give, and the more specific it is, the easier it is to help you.
|
All times are GMT -5. The time now is 04:31 AM. |