By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release. View | Details | Raw Unified | Return to bug 189
Collapse All | Expand All

(-)trunk/KDE/kdebase/workspace/kdm/backend/auth.c (-29 / +21 lines)
Lines 319-333 Link Here
319
}
319
}
320
320
321
321
322
static FILE *
323
mkTempFile( char *nambuf, int namelen )
324
{
325
	FILE *f;
326
	int r;
327
328
	for (r = 0; r < 100; r++) {
329
		randomStr( nambuf + namelen );
330
		if ((f = fdOpenW( open( nambuf, O_WRONLY | O_CREAT | O_EXCL, 0600 ) )))
331
			return f;
332
		if (errno != EEXIST)
333
			break;
334
	}
335
	return 0;
336
}
337
322
#define NAMELEN 255
338
#define NAMELEN 255
323
339
324
static FILE *
340
static FILE *
325
makeServerAuthFile( struct display *d )
341
makeServerAuthFile( struct display *d )
326
{
342
{
327
	FILE *f;
343
	FILE *f;
328
#ifndef HAVE_MKSTEMP
344
	int i;
329
	int r;
330
#endif
331
	char cleanname[NAMELEN], nambuf[NAMELEN+128];
345
	char cleanname[NAMELEN], nambuf[NAMELEN+128];
332
346
333
	/*
347
	/*
Lines 339-360 Link Here
339
	if (mkdir( authDir, 0755 ) < 0  &&  errno != EEXIST)
353
	if (mkdir( authDir, 0755 ) < 0  &&  errno != EEXIST)
340
		return 0;
354
		return 0;
341
	cleanUpFileName( d->name, cleanname, NAMELEN - 8 );
355
	cleanUpFileName( d->name, cleanname, NAMELEN - 8 );
342
#ifdef HAVE_MKSTEMP
356
	i = sprintf( nambuf, "%s/A%s-", authDir, cleanname );
343
	sprintf( nambuf, "%s/A%s-XXXXXX", authDir, cleanname );
357
	if ((f = mkTempFile( nambuf, i ))) {
344
	if ((f = fdOpenW( mkstemp( nambuf ) ))) {
345
		strDup( &d->authFile, nambuf );
358
		strDup( &d->authFile, nambuf );
346
		return f;
359
		return f;
347
	}
360
	}
348
#else
349
	for (r = 0; r < 100; r++) {
350
		sprintf( nambuf, "%s/A%s-XXXXXX", authDir, cleanname );
351
		(void)mktemp( nambuf );
352
		if ((f = fdOpenW( open( nambuf, O_WRONLY | O_CREAT | O_EXCL, 0600 ) ))) {
353
			strDup( &d->authFile, nambuf );
354
			return f;
355
		}
356
	}
357
#endif
358
	return 0;
361
	return 0;
359
}
362
}
360
363
Lines 1203-1221 Link Here
1203
			 * temporary - we can assume that we are the only ones
1206
			 * temporary - we can assume that we are the only ones
1204
			 * knowing about this file anyway.
1207
			 * knowing about this file anyway.
1205
			 */
1208
			 */
1206
#ifdef HAVE_MKSTEMP
1209
			i = sprintf( name_buf, "%s/.Xauth", d->userAuthDir );
1207
			sprintf( name_buf, "%s/.XauthXXXXXX", d->userAuthDir );
1210
			new = mkTempFile( name_buf, i );
1208
			new = fdOpenW( mkstemp( name_buf ) );
1209
#else
1210
			for (i = 0; i < 100; i++) {
1211
				sprintf( name_buf, "%s/.XauthXXXXXX", d->userAuthDir );
1212
				(void)mktemp( name_buf );
1213
				if ((new =
1214
				     fdOpenW( open( name_buf, O_WRONLY | O_CREAT | O_EXCL,
1215
				                    0600 ) )))
1216
					break;
1217
			}
1218
#endif
1219
			if (!new) {
1211
			if (!new) {
1220
				logError( "Cannot create authorization file in %s: %m\n",
1212
				logError( "Cannot create authorization file in %s: %m\n",
1221
				          d->userAuthDir );
1213
				          d->userAuthDir );
(-)trunk/KDE/kdebase/workspace/kdm/backend/dm.h (+1 lines)
Lines 560-565 Link Here
560
int writer( int fd, const void *buf, int len );
560
int writer( int fd, const void *buf, int len );
561
int fGets( char *buf, int max, FILE *f );
561
int fGets( char *buf, int max, FILE *f );
562
time_t mTime( const char *fn );
562
time_t mTime( const char *fn );
563
void randomStr( char *s );
563
int hexToBinary( char *out, const char *in );
564
int hexToBinary( char *out, const char *in );
564
void listSessions( int flags, struct display *d, void *ctx,
565
void listSessions( int flags, struct display *d, void *ctx,
565
                   void (*emitXSess)( struct display *, struct display *, void * ),
566
                   void (*emitXSess)( struct display *, struct display *, void * ),
(-)trunk/KDE/kdebase/workspace/kdm/backend/util.c (+15 lines)
Lines 35-40 Link Here
35
 */
35
 */
36
36
37
#include "dm.h"
37
#include "dm.h"
38
#include "dm_auth.h"
38
#include "dm_error.h"
39
#include "dm_error.h"
39
40
40
#include <string.h>
41
#include <string.h>
Lines 570-575 Link Here
570
		return st.st_mtime;
571
		return st.st_mtime;
571
}
572
}
572
573
574
void
575
randomStr( char *s )
576
{
577
	static const char letters[] =
578
		"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
579
	unsigned i, rn = secureRandom();
580
581
	for (i = 0; i < 6; i++) {
582
		*s++ = letters[rn % 62];
583
		rn /= 62;
584
	}
585
	*s = 0;
586
}
587
573
static int
588
static int
574
strNChrCnt( const char *s, int slen, char c )
589
strNChrCnt( const char *s, int slen, char c )
575
{
590
{

Return to bug 189