libgrub_cmd.c (c5aaf10a) libgrub_cmd.c (1a902ef8)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 8 unchanged lines hidden (view full) ---

17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 8 unchanged lines hidden (view full) ---

17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25/*
26 * Copyright 2015 Nexenta Systems, Inc.
27 */
25
26/*
27 * This file contains all the functions that implement the following
28 * GRUB commands:
29 * kernel, kernel$, module, module$, findroot, bootfs
30 * Return 0 on success, errno on failure.
31 */
32#include <stdio.h>

--- 361 unchanged lines hidden (view full) ---

394 if ((pos = strchr(sign, ',')) == NULL || (sz = pos - sign) == 0)
395 return (EG_FINDROOTFMT);
396
397 ++pos;
398 if (!IS_PRTNUM_VALID(barg->gb_prtnum = pos[0] - '0'))
399 return (EG_FINDROOTFMT);
400
401 ++pos;
28
29/*
30 * This file contains all the functions that implement the following
31 * GRUB commands:
32 * kernel, kernel$, module, module$, findroot, bootfs
33 * Return 0 on success, errno on failure.
34 */
35#include <stdio.h>

--- 361 unchanged lines hidden (view full) ---

397 if ((pos = strchr(sign, ',')) == NULL || (sz = pos - sign) == 0)
398 return (EG_FINDROOTFMT);
399
400 ++pos;
401 if (!IS_PRTNUM_VALID(barg->gb_prtnum = pos[0] - '0'))
402 return (EG_FINDROOTFMT);
403
404 ++pos;
402 if (pos[0] != ',' ||
405 if ((pos[0] != ',' && pos[0] != ')') ||
403 !IS_SLCNUM_VALID(barg->gb_slcnum = pos[1]) ||
404 pos[2] != ')')
405 return (EG_FINDROOTFMT);
406 } else {
407 sz = strlen(sign);
408 }
409
410 bsz = strlen(BOOTSIGN_DIR "/");

--- 51 unchanged lines hidden ---
406 !IS_SLCNUM_VALID(barg->gb_slcnum = pos[1]) ||
407 pos[2] != ')')
408 return (EG_FINDROOTFMT);
409 } else {
410 sz = strlen(sign);
411 }
412
413 bsz = strlen(BOOTSIGN_DIR "/");

--- 51 unchanged lines hidden ---