unsigned < 0 test ?

andreas moroder claudiamoroder at st-ulrich.suedtirol.net
Tue Sep 25 13:34:20 GMT 2001


Hello,

in smbd/sec_ctx.c  there are the following lines

BOOL initialise_groups(char *user, uid_t uid, gid_t gid)
{
	struct sec_ctx *prev_ctx_p;
	BOOL result = True;

	if (non_root_mode()) {
		return True;
	}

	become_root();

	/* Call initgroups() to get user groups */

	if (winbind_initgroups(user,gid) == -1) {
		DEBUG(0,("Unable to initgroups. Error was %s\n", strerror(errno) ));
		if (getuid() == 0) {
			if (gid < 0 || gid > 32767 || uid < 0 || uid > 32767) {
				DEBUG(0,("This is probably a problem with the account %s\n", user));
			}
		}
		result = False;
		goto done;
	}

I hope I am not wrong, but gid and uid are unsigned variables ( on linux ) . 
If this is true the <0 condition is allways false and not necessary.
Are there systems around where the type uid_t is signed ?

Bye
Andreas





More information about the samba-technical mailing list