Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 181685 | Differences between
and this patch

Collapse All | Expand All

(-)mkinitrd-4.2.1.10.orig/grubby/grubby.c (-2 / +2 lines)
Lines 235-241 Link Here
235
struct singleEntry * findEntryByPath(struct grubConfig * cfg, 
235
struct singleEntry * findEntryByPath(struct grubConfig * cfg, 
236
				     const char * path, const char * prefix,
236
				     const char * path, const char * prefix,
237
				     int * index);
237
				     int * index);
238
static char * strndup(char * from, int len);
238
static char * strndup(char * from, size_t len);
239
static int readFile(int fd, char ** bufPtr);
239
static int readFile(int fd, char ** bufPtr);
240
static void lineInit(struct singleLine * line);
240
static void lineInit(struct singleLine * line);
241
static void lineFree(struct singleLine * line);
241
static void lineFree(struct singleLine * line);
Lines 245-251 Link Here
245
		       struct configFileInfo * cfi);
245
		       struct configFileInfo * cfi);
246
static char * getRootSpecifier(char * str);
246
static char * getRootSpecifier(char * str);
247
247
248
static char * strndup(char * from, int len) {
248
static char * strndup(char * from, size_t len) {
249
    char * to;
249
    char * to;
250
250
251
    to = malloc(len + 1);
251
    to = malloc(len + 1);
(-)mkinitrd-4.2.1.10.orig/nash/Makefile (-1 / +1 lines)
Lines 4-10 Link Here
4
ARCH := $(patsubst i%86,i386,$(shell uname -m))
4
ARCH := $(patsubst i%86,i386,$(shell uname -m))
5
ARCH := $(patsubst sparc%,sparc,$(ARCH))
5
ARCH := $(patsubst sparc%,sparc,$(ARCH))
6
6
7
ifeq (i386, $(ARCH))
7
ifdef USE_DIET
8
CC:=diet $(CC)
8
CC:=diet $(CC)
9
CFLAGS += -DUSE_DIET=1
9
CFLAGS += -DUSE_DIET=1
10
else
10
else
(-)mkinitrd-4.2.1.10.orig/nash/mount_by_label.c (-3 / +3 lines)
Lines 64-70 Link Here
64
	}
64
	}
65
	else if (lseek(fd, 0, SEEK_SET) == 0
65
	else if (lseek(fd, 0, SEEK_SET) == 0
66
	    && read(fd, (char *) &xfsb, sizeof(xfsb)) == sizeof(xfsb)
66
	    && read(fd, (char *) &xfsb, sizeof(xfsb)) == sizeof(xfsb)
67
	    && (strncmp(xfsb.s_magic, XFS_SUPER_MAGIC, 4) == 0)) {
67
	    && (strncmp((const char*)xfsb.s_magic, XFS_SUPER_MAGIC, 4) == 0)) {
68
		memcpy(uuid, xfsb.s_uuid, sizeof(xfsb.s_uuid));
68
		memcpy(uuid, xfsb.s_uuid, sizeof(xfsb.s_uuid));
69
		namesize = sizeof(xfsb.s_fname);
69
		namesize = sizeof(xfsb.s_fname);
70
		if ((*label = calloc(namesize + 1, 1)) != NULL)
70
		if ((*label = calloc(namesize + 1, 1)) != NULL)
Lines 172-178 Link Here
172
			int mustRemoveDir = 0;
172
			int mustRemoveDir = 0;
173
			int i;
173
			int i;
174
174
175
			sprintf(device, "%s/%s", DEVLABELDIR, ptname);
175
			snprintf(device, 110, "%s/%s", DEVLABELDIR, ptname);
176
			if (access(device, F_OK)) {
176
			if (access(device, F_OK)) {
177
			    ptr = device;
177
			    ptr = device;
178
			    i = 0;
178
			    i = 0;
Lines 265-271 Link Here
265
	    uuid[i] = ((fromhex(s[0])<<4) | fromhex(s[1]));
265
	    uuid[i] = ((fromhex(s[0])<<4) | fromhex(s[1]));
266
	    s += 2;
266
	    s += 2;
267
	}
267
	}
268
	return get_spec_by_x(UUID, uuid, major, minor);
268
	return get_spec_by_x(UUID, (const char*)uuid, major, minor);
269
269
270
 bad_uuid:
270
 bad_uuid:
271
	fprintf(stderr, _("mount: bad UUID"));
271
	fprintf(stderr, _("mount: bad UUID"));
(-)mkinitrd-4.2.1.10.orig/nash/name_to_dev_t.c (-1 / +1 lines)
Lines 18-24 Link Here
18
18
19
	/* read device number from .../dev */
19
	/* read device number from .../dev */
20
20
21
	sprintf(path, "/sys/block/%s/dev", name);
21
	snprintf(path, 64, "/sys/block/%s/dev", name);
22
	fd = open(path, O_RDONLY);
22
	fd = open(path, O_RDONLY);
23
	if (fd < 0)
23
	if (fd < 0)
24
		goto fail;
24
		goto fail;
(-)mkinitrd-4.2.1.10.orig/nash/nash.c (-6 / +6 lines)
Lines 559-567 Link Here
559
        printf("%s%s", prefix, fn);
559
        printf("%s%s", prefix, fn);
560
560
561
        if (S_ISDIR(sb.st_mode)) {
561
        if (S_ISDIR(sb.st_mode)) {
562
            char * pfx;
562
			const size_t pfx_size = strlen(prefix) + 3;
563
            pfx = malloc(strlen(prefix) + 3);
563
            char * pfx = malloc(pfx_size);
564
            sprintf(pfx, "%s  ", prefix);
564
            snprintf(pfx, pfx_size, "%s  ", prefix);
565
            printf("/\n");
565
            printf("/\n");
566
        } else if (S_ISCHR(sb.st_mode)) {
566
        } else if (S_ISCHR(sb.st_mode)) {
567
            printf(" c %d %d\n", major(sb.st_rdev), minor(sb.st_rdev));
567
            printf(" c %d %d\n", major(sb.st_rdev), minor(sb.st_rdev));
Lines 1306-1312 Link Here
1306
	strcpy(separator, "/");
1306
	strcpy(separator, "/");
1307
1307
1308
    for (devNum = 0; devNum < 256; devNum++) {
1308
    for (devNum = 0; devNum < 256; devNum++) {
1309
	sprintf(devName, "/dev/loop%s%d", separator, devNum);
1309
	snprintf(devName, 20, "/dev/loop%s%d", separator, devNum);
1310
	if ((fd = open(devName, O_RDONLY)) < 0) return 0;
1310
	if ((fd = open(devName, O_RDONLY)) < 0) return 0;
1311
1311
1312
	if (ioctl(fd, LOOP_GET_STATUS, &loopInfo)) {
1312
	if (ioctl(fd, LOOP_GET_STATUS, &loopInfo)) {
Lines 1437-1443 Link Here
1437
			char * ptr, * deviceDir;
1437
			char * ptr, * deviceDir;
1438
			int i;
1438
			int i;
1439
1439
1440
			sprintf(devName, "%s/%s", prefix, start);
1440
			snprintf(devName, 128, "%s/%s", prefix, start);
1441
			unlink(devName);
1441
			unlink(devName);
1442
1442
1443
			ptr = devName;
1443
			ptr = devName;
Lines 1561-1567 Link Here
1561
    int i;
1561
    int i;
1562
    char * start, * end;
1562
    char * start, * end;
1563
    char * chptr;
1563
    char * chptr;
1564
    int rc;
1564
    int rc = -1;
1565
1565
1566
    i = read(fd, contents, sizeof(contents) - 1);
1566
    i = read(fd, contents, sizeof(contents) - 1);
1567
    if (i == (sizeof(contents) - 1)) {
1567
    if (i == (sizeof(contents) - 1)) {

Return to bug 181685