bug-ncurses
[Top][All Lists]
Advanced

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

RE: Bug(let) in tack-1.06


From: Schmitz, Joachim
Subject: RE: Bug(let) in tack-1.06
Date: Fri, 25 Feb 2011 07:16:44 +0000

Hi Thomas

I wouldn't exclude that there are other platforms out there where the super 
user doesn't have UID 0, but so far I haven't come across any, and as long as 
nobody approaches you with a corresponding report, I don't think any extra 
action or code change is needed.
It might be a better idea to use some Macro though. It is done that way in vim 
for example

#ifdef __TANDEM
#define ROOT_UID 65535
#else
#define ROOT_UID 0
#endif
...
return getuid() != ROOT_UID && geteuid() != ROOT_UID;    /* ...finally, 
disallow root */

Bye, Jojo

-----Original Message-----
From: Thomas Dickey [mailto:address@hidden 
Sent: Thursday, February 24, 2011 11:27 PM
To: Schmitz, Joachim
Cc: address@hidden
Subject: Re: Bug(let) in tack-1.06

On Thu, 24 Feb 2011, Schmitz, Joachim wrote:

> Hi there
>
> In tack-1.06/output.c I encountered a warning reg. a pointless comparison of 
> an unsigned value vs. EOF, and found that this is due to the fact that chat 
> is unsigned on my platform (as on many others too). Here's the patch I came 
> up with:
>
> --- ./output.c.orig     2007-04-29 18:18:46.000000000 -0500
> +++ ./output.c  2011-02-23 13:00:12.000000000 -0600
> @@ -718,8 +718,8 @@
> int
> wait_here(void)
> {
> -       char ch, cc[64];
> -       char message[16];
> +       signed char ch;
> +       char cc[64], message[16];
>        int i, j;
>
>        for (i = 0; i < (int) sizeof(cc); i++) {
>
>
> Maybe int whould have been a better choice, not sure.

int would be better (will do that - thanks).

>        return FALSE;
> #endif
> +#ifdef __TANDEM

hmm - I wonder if there are other implementations that do this.

> +    return getuid() != 65535 && geteuid() != 65535;    /* ...finally, 
> disallow
> root */
> +#else
>     return getuid() != 0 && geteuid() != 0;    /* ...finally, disallow root */
> +#endif
> }
> #endif

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]