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

Bug#493524: xdm: SE Linux patch was written for old version



On Sun, Aug  3, 2008 at 01:51:56 +0200, Julien Cristau wrote:

> On Sun, Aug  3, 2008 at 09:30:37 +1000, Russell Coker wrote:
> 
> > +	if (getseuserbyname(login, &seuser, &level) == 0)
> > +		ret=get_default_context_with_level(seuser, level, 0, &scontext);
> > +	if (ret < 0 || scontext == NULL) {
> > +		LogError ("SELinux: unable to obtain default security context for %s\n", login);
> > +		return FALSE;
> > +	}
> > +
> 
> Looks like seuser and level are never freed.  Am I missing something?
> 
Looking at <selinux/selinux.h>, we read:
/* Get the SELinux username and level to use for a given Linux username.?
   These values may then be passed into the get_ordered_context_list*
   and get_default_context* functions to obtain a context for the user.
   Returns 0 on success or -1 otherwise.
   Caller must free the returned strings via free. */
extern int getseuserbyname(const char *linuxuser, char **seuser, char **level);

Will apply the fixed patch with the missing calls to free().

Cheers,
Julien



Reply to: