[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

JSP code requires root privileges

Posted on 2007-03-29
5
Medium Priority
?
486 Views
Last Modified: 2013-11-15
Tomcat5, Ubuntu 6.06, Java5
I have written a class which accesses the Parallel Port on my PC - I am using parport: http://www.geocities.com/Juanga69/parport/
 
I have so far been running this class as root and it all works fine.

Now I want to use this class in a JSP - this means the user will no longer be root, it will be tomcat.

Any idea how to get around this?
0
Comment
Question by:basicinstinct
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 23

Author Comment

by:basicinstinct
ID: 18821083
By the way, the parallel port access requires the user to have root privileges
0
 
LVL 19

Accepted Solution

by:
Kuldeepchaturvedi earned 600 total points
ID: 18821110
then your tomcat has to run under root privilage. i.e. the process needs to be started using root privilages.
0
 
LVL 24

Assisted Solution

by:sciuriware
sciuriware earned 450 total points
ID: 18821679
And if you are NOT running as root and change the owner of the parallel port to yours?

;JOOP!
0
 
LVL 30

Assisted Solution

by:Mayank S
Mayank S earned 450 total points
ID: 18825863
>> the parallel port access requires the user to have root privileges

Why? If you have a printer connected to the parallel port, can any other user not print documents on it?

Anyway if you are running Tomcat as a service or daemon in Ubuntu, you can try to change its user-name to root as Kuldeep suggests
0
 
LVL 23

Author Comment

by:basicinstinct
ID: 18826981
Hi, thanks for the suggestions.  I played around tring to add the tomcat user to the 'root' group but it didn't make much difference.  Maybe I am doing something wrong.  Anyway I'm thinking there may be some security issues running tomcat as root.

Anywho, as this application is a hobby project and nothing professional I have gone for a workaround.  The parallel port program now listens for commands on a java.net.ServerSocket.  I wrote a client class which knows how to send commands to the parallel port program over tcp/ip. The JSP uses this client class.

The parallel port program is running as root, the JSP is running as tomcat and it all works nicely.  

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question