[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Ssystem & non root



Hi!

While looking at the Ssystem source I noticed that you have to be root to
_inquire_ FORCEFASTLOAD, SYNCTIME and TSLICE.

Here's a diff to fix that:
-------------------------------- >8 schnipp 8<
--------------------------------
diff -c -b -B mint-1.15.0.3.0/src/ssystem.c
mint-1.15.0.3.0/ssystem.c.modified
*** mint-1.15.0.3.0/src/ssystem.c       Tue Sep 15 14:23:24 1998
--- mint-1.15.0.3.0/ssystem.c.modified  Thu Oct  1 21:50:16 1998
***************
*** 508,521 ****
                }
                case FORCEFASTLOAD:
                {
!                       if (isroot == 0)
                        {
!                               r = EACCDN;
                                break;
                        }
!                       if (arg1 == -1)
                        {
!                               r = (long) forcefastload;
                                break;
                        }
                        forcefastload = (short) arg1 & 1;
--- 508,521 ----
                }
                case FORCEFASTLOAD:
                {
!                       if (arg1 == -1)
                        {
!                               r = (long) forcefastload;
                                break;
                        }
!                       if (isroot == 0)
                        {
!                               r = EACCDN;
                                break;
                        }
                        forcefastload = (short) arg1 & 1;
***************
*** 523,536 ****
                }
                case SYNC_TIME:
                {
!                       if (isroot == 0)
                        {
!                               r = EACCDN;
                                break;
                        }
!                       if (arg1 == -1)
                        {
!                               r = sync_time;
                                break;
                        }
                        sync_time = arg1;
--- 523,536 ----
                }
                case SYNC_TIME:
                {
!                       if (arg1 == -1)
                        {
!                               r = sync_time;
                                break;
                        }
!                       if (isroot == 0)
                        {
!                               r = EACCDN;
                                break;
                        }
                        sync_time = arg1;
***************
*** 538,551 ****
                }
                case TSLICE:
                {
!                       if (isroot == 0)
                        {
!                               r = EACCDN;
                                break;
                        }
!                       if (arg1 == -1)
                        {
!                               r = (long) time_slice;
                                break;
                        }
                        time_slice = (short) arg1;
--- 538,551 ----
                }
                case TSLICE:
                {
!                       if (arg1 == -1)
                        {
!                               r = (long) time_slice;
                                break;
                        }
!                       if (isroot == 0)
                        {
!                               r = EACCDN;
                                break;
                        }
                        time_slice = (short)
arg1;-------------------------------- >8 schnapp 8<
--------------------------------

Bye

                Joerg