Skip to content

Commit

Permalink
remove useless setuid code
Browse files Browse the repository at this point in the history
  • Loading branch information
lnussel committed Sep 3, 2005
1 parent 4a5f66f commit 2e6d24d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
3 changes: 1 addition & 2 deletions code/unix/linux_qgl.c
Expand Up @@ -3038,10 +3038,9 @@ qboolean QGL_Init( const char *dllname )
{
char fn[1024];
// FILE *fp; // bk001204 - unused
extern uid_t saved_euid; // unix_main.c

// if we are not setuid, try current directory
if (getuid() == saved_euid) {
if (1) {
getcwd(fn, sizeof(fn));
Q_strcat(fn, sizeof(fn), "/");
Q_strcat(fn, sizeof(fn), dllname);
Expand Down
5 changes: 0 additions & 5 deletions code/unix/linux_snd.c
Expand Up @@ -82,7 +82,6 @@ qboolean SNDDMA_Init(void)
// char *s; // bk001204 - unused
struct audio_buf_info info;
int caps;
extern uid_t saved_euid;

if (snd_inited)
return 1;
Expand All @@ -96,12 +95,8 @@ qboolean SNDDMA_Init(void)

// open /dev/dsp, confirm capability to mmap, and get size of dma buffer
if (!audio_fd) {
seteuid(saved_euid);

audio_fd = open(snddevice->string, O_RDWR);

seteuid(getuid());

if (audio_fd < 0) {
perror(snddevice->string);
Com_Printf("Could not open %s\n", snddevice->string);
Expand Down
5 changes: 0 additions & 5 deletions code/unix/unix_main.c
Expand Up @@ -61,7 +61,6 @@ refexport_t re;

unsigned sys_frame_time;

uid_t saved_euid;
qboolean stdin_active = qtrue;

// =============================================================
Expand Down Expand Up @@ -1261,10 +1260,6 @@ int main ( int argc, char* argv[] )
char cdpath[PATH_MAX] = {0};
void Sys_SetDefaultCDPath(const char *path);

// go back to real user for config loads
saved_euid = geteuid();
seteuid(getuid());

Sys_ParseArgs( argc, argv ); // bk010104 - added this for support

strncat(cdpath, argv[0], sizeof(cdpath)-1);
Expand Down

0 comments on commit 2e6d24d

Please sign in to comment.