How to get root access

I am writing a program that uses a library that needs root access in linux and administator rights in Windows. How do I gain access in code?
[italic][blue]Just my 2 bits[/blue][/italic]

Comments

  • : I am writing a program that uses a library that needs root access in
    : linux and administator rights in Windows. How do I gain access in
    : code?
    : [italic][blue]Just my 2 bits[/blue][/italic]

    AFAIK you cannot, not even with native programs. If the logged in user has admin/root rights, then each program which he starts has those rights.
  • : I am writing a program that uses a library that needs root access in
    : linux and administator rights in Windows. How do I gain access in
    : code?
    : [italic][blue]Just my 2 bits[/blue][/italic]
    under linux you can write a shell script that starts your java program as root (have a look at suid root). maybe you should try to get around this. and what are you doing so that you need admin right under windows? This sounds a little strange to me...
  • : : I am writing a program that uses a library that needs root access in
    : : linux and administator rights in Windows. How do I gain access in
    : : code?
    : : [italic][blue]Just my 2 bits[/blue][/italic]
    : under linux you can write a shell script that starts your java
    : program as root (have a look at suid root). maybe you should try to
    : get around this. and what are you doing so that you need admin right
    : under windows? This sounds a little strange to me...

    I am capturing packets using the Jpcap library(not jpcap) and it requires root access in *nix and admin in Windows. The program I am writing does not always use this library so doesn't need root. I was just hoping I could drop root privileges when it is not needed.


    [italic][blue]Just my 2 bits[/blue][/italic]
  • : : : I am writing a program that uses a library that needs root access in
    : : : linux and administator rights in Windows. How do I gain access in
    : : : code?
    : : : [italic][blue]Just my 2 bits[/blue][/italic]
    : : under linux you can write a shell script that starts your java
    : : program as root (have a look at suid root). maybe you should try to
    : : get around this. and what are you doing so that you need admin right
    : : under windows? This sounds a little strange to me...
    :
    : I am capturing packets using the Jpcap library(not jpcap) and it
    : requires root access in *nix and admin in Windows. The program I am
    : writing does not always use this library so doesn't need root. I was
    : just hoping I could drop root privileges when it is not needed.
    :
    :
    : [italic][blue]Just my 2 bits[/blue][/italic]

    From a security standpoint it should be impossible for a program to arbitrarily turn root access on or off. Image visiting a website, which installs an activeX control/applet on your computer, then turns on root access for itself and implant a backdoor, virus, or other malware.
    A workaround for your program would be to inform the user that capturing packets is not possible, when he has less than root access. You could also disable the controls, which activate the capturing when you don't have root access.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories