Hardware Surfaces on X11 / nVidia TNT2

chown root.root myprog
chmod o+s myprog

— Carlos Vrancken wrote:> On Thu, 2003-04-24 at 12:59, Bob Pendleton wrote:

As far as I have been able to find out, the answer is no. Either the
user running the program must be root, or the program must be setuid to
root. The requirement to be root to use hardware buffers on Linux
seriously reduces the usefulness of hardware buffers on Linux. Yet
another reason to use OpenGL. :slight_smile:

A little off-topic, but just for completeness (and due to ignorance),
how do I setuid my program to root?

Thanks

Carlos

Carlos Vrancken


Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com

OK. Thanks!!!
Now, I have another followup problem. I’m setting my environment
variables at /etc/profile, including these lines:

set up environment for ipp

LD_LIBRARY_PATH="/opt/intel/ipp/sharedlib:$LD_LIBRARY_PATH"; export
LD_LIBRARY_PATH

set up environment for SDL

export “SDL_VIDEODRIVER=dga”

The thing is, when I log as a user, these variables do exist in my
environment. But when I “su” to root, LD_LIBRARY_PATH disappears!!!
(SDL_VIDEODRIVER stays, though). And now, when I execute my (setuid)
program, it doesn’t work because it doesn’t find the required libraries.
If a log as root, the variables are in my environment, no problem in
this case.

Any thoughts?

Thanks,

CarlosOn Fri, 2003-04-25 at 12:50, Todd Klaus wrote:

chown root.root myprog
chmod o+s myprog

— Carlos Vrancken wrote:

On Thu, 2003-04-24 at 12:59, Bob Pendleton wrote:

As far as I have been able to find out, the answer is no. Either the
user running the program must be root, or the program must be setuid to
root. The requirement to be root to use hardware buffers on Linux
seriously reduces the usefulness of hardware buffers on Linux. Yet
another reason to use OpenGL. :slight_smile:

A little off-topic, but just for completeness (and due to ignorance),
how do I setuid my program to root?

Thanks

Carlos

Carlos Vrancken


Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Carlos Vrancken

Well, if you suid your program, there should be no need to su to root to run it. I’m not sure why
your LD_LIBRARY_PATH is not set when you su (security reasons maybe?)

tk

— Carlos Vrancken wrote:> OK. Thanks!!!

Now, I have another followup problem. I’m setting my environment
variables at /etc/profile, including these lines:

set up environment for ipp

LD_LIBRARY_PATH="/opt/intel/ipp/sharedlib:$LD_LIBRARY_PATH"; export
LD_LIBRARY_PATH

set up environment for SDL

export “SDL_VIDEODRIVER=dga”

The thing is, when I log as a user, these variables do exist in my
environment. But when I “su” to root, LD_LIBRARY_PATH disappears!!!
(SDL_VIDEODRIVER stays, though). And now, when I execute my (setuid)
program, it doesn’t work because it doesn’t find the required libraries.
If a log as root, the variables are in my environment, no problem in
this case.

Any thoughts?

Thanks,

Carlos

On Fri, 2003-04-25 at 12:50, Todd Klaus wrote:

chown root.root myprog
chmod o+s myprog

— Carlos Vrancken wrote:

On Thu, 2003-04-24 at 12:59, Bob Pendleton wrote:

As far as I have been able to find out, the answer is no. Either the
user running the program must be root, or the program must be setuid to
root. The requirement to be root to use hardware buffers on Linux
seriously reduces the usefulness of hardware buffers on Linux. Yet
another reason to use OpenGL. :slight_smile:

A little off-topic, but just for completeness (and due to ignorance),
how do I setuid my program to root?

Thanks

Carlos

Carlos Vrancken


Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Carlos Vrancken


Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com

You’re absolutely right! but when I execute my (setuid) program as a
normal user, apparently it checks the root environmental variables, not
my user’s ones.

CarlosOn Fri, 2003-04-25 at 13:55, Todd Klaus wrote:

Well, if you suid your program, there should be no need to su to root to run it. I’m not sure why
your LD_LIBRARY_PATH is not set when you su (security reasons maybe?)

tk

— Carlos Vrancken wrote:

OK. Thanks!!!
Now, I have another followup problem. I’m setting my environment
variables at /etc/profile, including these lines:

set up environment for ipp

LD_LIBRARY_PATH="/opt/intel/ipp/sharedlib:$LD_LIBRARY_PATH"; export
LD_LIBRARY_PATH

set up environment for SDL

export “SDL_VIDEODRIVER=dga”

The thing is, when I log as a user, these variables do exist in my
environment. But when I “su” to root, LD_LIBRARY_PATH disappears!!!
(SDL_VIDEODRIVER stays, though). And now, when I execute my (setuid)
program, it doesn’t work because it doesn’t find the required libraries.
If a log as root, the variables are in my environment, no problem in
this case.

Any thoughts?

Thanks,

Carlos

On Fri, 2003-04-25 at 12:50, Todd Klaus wrote:

chown root.root myprog
chmod o+s myprog

— Carlos Vrancken wrote:

On Thu, 2003-04-24 at 12:59, Bob Pendleton wrote:

As far as I have been able to find out, the answer is no. Either the
user running the program must be root, or the program must be setuid to
root. The requirement to be root to use hardware buffers on Linux
seriously reduces the usefulness of hardware buffers on Linux. Yet
another reason to use OpenGL. :slight_smile:

A little off-topic, but just for completeness (and due to ignorance),
how do I setuid my program to root?

Thanks

Carlos

Carlos Vrancken


Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Carlos Vrancken


Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Carlos Vrancken

LD_LIBRARY_PATH is ignored for suid programs; otherwise you could drop
backdoor code into eg. /bin/su.On Fri, Apr 25, 2003 at 02:06:19PM -0500, Carlos Vrancken wrote:

You’re absolutely right! but when I execute my (setuid) program as a
normal user, apparently it checks the root environmental variables, not
my user’s ones.


Glenn Maynard

Well, if you suid your program, there should be no need to su to root to run it. I’m not sure why
your LD_LIBRARY_PATH is not set when you su (security reasons maybe?)

I can answer that, probably.

“su” will leave the environment intact
"su -" will reset the environment, losing the export

tk

— Carlos Vrancken wrote:

OK. Thanks!!!
Now, I have another followup problem. I’m setting my environment
variables at /etc/profile, including these lines:

set up environment for ipp

LD_LIBRARY_PATH="/opt/intel/ipp/sharedlib:$LD_LIBRARY_PATH"; export
LD_LIBRARY_PATH

set up environment for SDL

export “SDL_VIDEODRIVER=dga”

On Fri, 2003-04-25 at 14:55, Todd Klaus wrote:


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Carlos Vrancken


Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Jimmy <@Jimmy>
Jimmy’s World.org
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030425/6ae3f816/attachment.pgp

OK. It makes sense now. BUT, is there anything I can do then? my program
needs the LD_LIBRARY_PATH, and it needs to be run as root or setuid.

My application is going to be a linux box, without keyboard and mouse,
so I guess there won’t be any security issues. Is it ever possible to
perform an automatic logon as root???

Thanks,

CarlosOn Fri, 2003-04-25 at 14:15, Glenn Maynard wrote:

On Fri, Apr 25, 2003 at 02:06:19PM -0500, Carlos Vrancken wrote:

You’re absolutely right! but when I execute my (setuid) program as a
normal user, apparently it checks the root environmental variables, not
my user’s ones.

LD_LIBRARY_PATH is ignored for suid programs; otherwise you could drop
backdoor code into eg. /bin/su.


Carlos Vrancken

Why not just install the libraries in the normal place (/usr/local/lib),
or add the path to /etc/ld.so.conf?On Fri, Apr 25, 2003 at 02:30:25PM -0500, Carlos Vrancken wrote:

OK. It makes sense now. BUT, is there anything I can do then? my program
needs the LD_LIBRARY_PATH, and it needs to be run as root or setuid.

My application is going to be a linux box, without keyboard and mouse,
so I guess there won’t be any security issues. Is it ever possible to
perform an automatic logon as root???


Glenn Maynard

Well, if you suid your program, there should be no need to su to root to run it. I’m not sure why
your LD_LIBRARY_PATH is not set when you su (security reasons maybe?)

I can answer that, probably.

“su” will leave the environment intact
"su -" will reset the environment, losing the export

Actually, from the man page of “su”:

-m, --preserve-environment
do not reset environment variables
-p
same as -m

CarlosOn Fri, 2003-04-25 at 14:24, Jimmy wrote:

On Fri, 2003-04-25 at 14:55, Todd Klaus wrote:


Carlos Vrancken

I’d like to preserve the libraries location. But I tried adding the path
to /etc/ld.so.conf, and it didn’t do any good.

Thx,

CarlosOn Fri, 2003-04-25 at 14:49, Glenn Maynard wrote:

On Fri, Apr 25, 2003 at 02:30:25PM -0500, Carlos Vrancken wrote:

OK. It makes sense now. BUT, is there anything I can do then? my program
needs the LD_LIBRARY_PATH, and it needs to be run as root or setuid.

My application is going to be a linux box, without keyboard and mouse,
so I guess there won’t be any security issues. Is it ever possible to
perform an automatic logon as root???

Why not just install the libraries in the normal place (/usr/local/lib),
or add the path to /etc/ld.so.conf?


Carlos Vrancken

I found one solution myself. When the application is run as root (or
setuid root), LD_LIBRARY_PATH is reseted. The application looks for
libraries at /usr/lib. So one solution is to create links from /usr/lib
to the needed libraries.

Thank y’all.

CarlosOn Fri, 2003-04-25 at 16:07, Carlos Vrancken wrote:

I’d like to preserve the libraries location. But I tried adding the
path to /etc/ld.so.conf, and it didn’t do any good.

Thx,

Carlos

On Fri, 2003-04-25 at 14:49, Glenn Maynard wrote:

On Fri, Apr 25, 2003 at 02:30:25PM -0500, Carlos Vrancken wrote:

OK. It makes sense now. BUT, is there anything I can do then? my program
needs the LD_LIBRARY_PATH, and it needs to be run as root or setuid.

My application is going to be a linux box, without keyboard and mouse,
so I guess there won’t be any security issues. Is it ever possible to
perform an automatic logon as root???

Why not just install the libraries in the normal place (/usr/local/lib),
or add the path to /etc/ld.so.conf?

Carlos Vrancken


Carlos Vrancken

Did you run ldconfig?On Fri, Apr 25, 2003 at 04:07:17PM -0500, Carlos Vrancken wrote:

I’d like to preserve the libraries location. But I tried adding the path
to /etc/ld.so.conf, and it didn’t do any good.


Glenn Maynard

No, “su -” gives you a login shell.On Fri, Apr 25, 2003 at 03:24:28PM -0400, Jimmy wrote:

Well, if you suid your program, there should be no need to su to root to run it. I’m not sure why
your LD_LIBRARY_PATH is not set when you su (security reasons maybe?)

I can answer that, probably.

“su” will leave the environment intact
"su -" will reset the environment, losing the export


Glenn Maynard

OpenGL does it in the graphics adapter.
Nowadays the video cards cpus are optimized to do 3D drawing, the
OpenGL driver only sends graphic instructions to the video card and
the video card cpu does the rest.On Thursday 24 April 2003 10:15 pm, Chris Nystrom wrote:

On 24 Apr 2003, Bob Pendleton wrote:

As far as I have been able to find out, the answer is no. Either the
user running the program must be root, or the program must be setuid to
root. The requirement to be root to use hardware buffers on Linux
seriously reduces the usefulness of hardware buffers on Linux. Yet
another reason to use OpenGL. :slight_smile:

Pardon my ignorance, but how does OpenGL do it? Could not SDL be
configured (or rewritten?) to do it the same way?

Chris


Paulo Pinto

I found one solution myself. When the application is run as root (or
setuid root), LD_LIBRARY_PATH is reseted. The application looks for
libraries at /usr/lib. So one solution is to create links from
/usr/lib to the needed libraries.

dirty. but you can link in the library path at link time. look for rpath
or something (in the gcc manpage). mom…

this we do in our makefile (LIB_DIRS is the list of directories where
the libs reside, LIB_NAMES is the names of the libs (like “LIB_NAMES =
qt vtkCommon m”)

LIB_FLAGS := $(LIB_DIRS:%=-L%) -Wno-deprecated

LIB_FLAGS += $(LIB_DIRS:%=-Wl,-rpath -Wl,%)

LIB_FLAGS += $(LIB_NAMES:%=-l%)

then use $(LIB_FLAGS) in your g++ (or gcc) linker command…

this usually frees you from setting LD_LIBRARY_PATH… so maybe it helps
your problem…On Fri, 25 Apr 2003 16:36:22 -0500 Carlos Vrancken wrote:


@Florian_Schmidt
sound clips - http://www.arted.biz/mista.tapas

Hi! I’m seeing a discussion on the SDL_ttf library, which I have not
used (yet?).

Is this library the only way to write text on a SDL display?

Thanks,

Carlos

Well, there is a small image based text library… depends if you want bitmap based text or TTF based text.

Ja> ----- Original Message -----

From: carlosvra@mevran.com.ar (Carlos Vrancken)
To: sdl at libsdl.org
Date: Tue, 20 May 2003 10:38:48 -0500
Subject: [SDL] Text on SDL

Hi! I’m seeing a discussion on the SDL_ttf library, which I have not
used (yet?).

Is this library the only way to write text on a SDL display?

Thanks,

Carlos

Hi! I’m seeing a discussion on the SDL_ttf library, which I have not
used (yet?).

Is this library the only way to write text on a SDL display?

No. SDL allows you to draw text any way you chose.

SDL_ttf is a library for generating SDL surfaces from true type font
(.ttf) files. You can then blit those to another SDL surface to draw
text.

	Bob PendletonOn Tue, 2003-05-20 at 10:38, Carlos Vrancken wrote:

Thanks,

Carlos

±----------------------------------+

  • Bob Pendleton: independent writer +
  • and programmer. +
  • email: Bob at Pendleton.com +
    ±----------------------------------+

Hmmm… and what are those ways to draw text? is there any documentation
about it?

Thanks!!

CarlosOn Tue, 2003-05-20 at 11:58, Bob Pendleton wrote:

On Tue, 2003-05-20 at 10:38, Carlos Vrancken wrote:

Hi! I’m seeing a discussion on the SDL_ttf library, which I have not
used (yet?).

Is this library the only way to write text on a SDL display?

No. SDL allows you to draw text any way you chose.

SDL_ttf is a library for generating SDL surfaces from true type font
(.ttf) files. You can then blit those to another SDL surface to draw
text.

  Bob Pendleton

Thanks,

Carlos


Carlos Vrancken

I think a popular one is sfont.

http://www.linux-games.com/sfont/

Basically the idea is that you have a file full of pre-rendered text and you blit what you want (one letter at a time… well the library does 1 letter at a time).

You can also make bitmap data structures in your code (or include them!) but this has problems on a few platforms (think Mac OS classic).

Jesse> ----- Original Message -----

From: carlosvra@mevran.com.ar (Carlos Vrancken)
To: sdl at libsdl.org
Date: Tue, 20 May 2003 12:38:18 -0500
Subject: Re: [SDL] Text on SDL

Hmmm… and what are those ways to draw text? is there any documentation
about it?

Thanks!!

Carlos

On Tue, 2003-05-20 at 11:58, Bob Pendleton wrote:

On Tue, 2003-05-20 at 10:38, Carlos Vrancken wrote:

Hi! I’m seeing a discussion on the SDL_ttf library, which I have not
used (yet?).

Is this library the only way to write text on a SDL display?

No. SDL allows you to draw text any way you chose.

SDL_ttf is a library for generating SDL surfaces from true type font
(.ttf) files. You can then blit those to another SDL surface to draw
text.

  Bob Pendleton

Thanks,

Carlos


Carlos Vrancken