Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
| 2 | /* |
| 3 | * Support functions for mounting devices by label/uuid |
| 4 | * |
| 5 | * Copyright (C) 2006 by Jason Schoon <floydpink@gmail.com> |
| 6 | * Some portions cribbed from e2fsprogs, util-linux, dosfstools |
| 7 | * |
Denys Vlasenko | 0ef64bd | 2010-08-16 20:14:46 +0200 | [diff] [blame] | 8 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 9 | */ |
Denys Vlasenko | da49f58 | 2009-07-08 02:58:38 +0200 | [diff] [blame] | 10 | #include <sys/mount.h> /* BLKGETSIZE64 */ |
| 11 | #if !defined(BLKGETSIZE64) |
| 12 | # define BLKGETSIZE64 _IOR(0x12,114,size_t) |
| 13 | #endif |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 14 | #include "volume_id_internal.h" |
| 15 | |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 16 | static struct uuidCache_s { |
| 17 | struct uuidCache_s *next; |
Denis Vlasenko | c5b7372 | 2008-03-17 09:21:26 +0000 | [diff] [blame] | 18 | // int major, minor; |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 19 | char *device; |
| 20 | char *label; |
Denis Vlasenko | c5b7372 | 2008-03-17 09:21:26 +0000 | [diff] [blame] | 21 | char *uc_uuid; /* prefix makes it easier to grep for */ |
Denys Vlasenko | 90615a0 | 2010-12-30 00:40:11 +0100 | [diff] [blame] | 22 | IF_FEATURE_BLKID_TYPE(const char *type;) |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 23 | } *uuidCache; |
| 24 | |
Denys Vlasenko | 90615a0 | 2010-12-30 00:40:11 +0100 | [diff] [blame] | 25 | #if !ENABLE_FEATURE_BLKID_TYPE |
| 26 | #define get_label_uuid(fd, label, uuid, type) \ |
| 27 | get_label_uuid(fd, label, uuid) |
| 28 | #define uuidcache_addentry(device, label, uuid, type) \ |
| 29 | uuidcache_addentry(device, label, uuid) |
| 30 | #endif |
| 31 | |
Denis Vlasenko | c5b7372 | 2008-03-17 09:21:26 +0000 | [diff] [blame] | 32 | /* Returns !0 on error. |
| 33 | * Otherwise, returns malloc'ed strings for label and uuid |
Denis Vlasenko | 582dff0 | 2008-10-19 19:36:30 +0000 | [diff] [blame] | 34 | * (and they can't be NULL, although they can be ""). |
| 35 | * NB: closes fd. */ |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 36 | static int |
Denys Vlasenko | 90615a0 | 2010-12-30 00:40:11 +0100 | [diff] [blame] | 37 | get_label_uuid(int fd, char **label, char **uuid, const char **type) |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 38 | { |
| 39 | int rv = 1; |
| 40 | uint64_t size; |
| 41 | struct volume_id *vid; |
| 42 | |
Denis Vlasenko | 582dff0 | 2008-10-19 19:36:30 +0000 | [diff] [blame] | 43 | /* fd is owned by vid now */ |
| 44 | vid = volume_id_open_node(fd); |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 45 | |
Denis Vlasenko | 582dff0 | 2008-10-19 19:36:30 +0000 | [diff] [blame] | 46 | if (ioctl(/*vid->*/fd, BLKGETSIZE64, &size) != 0) |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 47 | size = 0; |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 48 | |
Denis Vlasenko | 28ea429 | 2009-02-15 05:51:19 +0000 | [diff] [blame] | 49 | if (volume_id_probe_all(vid, /*0,*/ size) != 0) |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 50 | goto ret; |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 51 | |
Denis Vlasenko | c5b7372 | 2008-03-17 09:21:26 +0000 | [diff] [blame] | 52 | if (vid->label[0] != '\0' || vid->uuid[0] != '\0') { |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 53 | *label = xstrndup(vid->label, sizeof(vid->label)); |
| 54 | *uuid = xstrndup(vid->uuid, sizeof(vid->uuid)); |
Denys Vlasenko | 90615a0 | 2010-12-30 00:40:11 +0100 | [diff] [blame] | 55 | #if ENABLE_FEATURE_BLKID_TYPE |
| 56 | *type = vid->type; |
| 57 | dbg("found label '%s', uuid '%s', type '%s'", *label, *uuid, *type); |
| 58 | #else |
Vladimir Dronnikov | 662e8b7 | 2009-11-01 23:05:09 +0100 | [diff] [blame] | 59 | dbg("found label '%s', uuid '%s'", *label, *uuid); |
Denys Vlasenko | 90615a0 | 2010-12-30 00:40:11 +0100 | [diff] [blame] | 60 | #endif |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 61 | rv = 0; |
| 62 | } |
| 63 | ret: |
Denis Vlasenko | 582dff0 | 2008-10-19 19:36:30 +0000 | [diff] [blame] | 64 | free_volume_id(vid); /* also closes fd */ |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 65 | return rv; |
| 66 | } |
| 67 | |
Denis Vlasenko | c5b7372 | 2008-03-17 09:21:26 +0000 | [diff] [blame] | 68 | /* NB: we take ownership of (malloc'ed) label and uuid */ |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 69 | static void |
Denys Vlasenko | 90615a0 | 2010-12-30 00:40:11 +0100 | [diff] [blame] | 70 | uuidcache_addentry(char *device, /*int major, int minor,*/ char *label, char *uuid, const char *type) |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 71 | { |
| 72 | struct uuidCache_s *last; |
Denis Vlasenko | 42cc304 | 2008-03-24 02:05:58 +0000 | [diff] [blame] | 73 | |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 74 | if (!uuidCache) { |
| 75 | last = uuidCache = xzalloc(sizeof(*uuidCache)); |
| 76 | } else { |
| 77 | for (last = uuidCache; last->next; last = last->next) |
| 78 | continue; |
| 79 | last->next = xzalloc(sizeof(*uuidCache)); |
| 80 | last = last->next; |
| 81 | } |
| 82 | /*last->next = NULL; - xzalloc did it*/ |
Denis Vlasenko | c5b7372 | 2008-03-17 09:21:26 +0000 | [diff] [blame] | 83 | // last->major = major; |
| 84 | // last->minor = minor; |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 85 | last->device = device; |
Denis Vlasenko | c5b7372 | 2008-03-17 09:21:26 +0000 | [diff] [blame] | 86 | last->label = label; |
| 87 | last->uc_uuid = uuid; |
Denys Vlasenko | 90615a0 | 2010-12-30 00:40:11 +0100 | [diff] [blame] | 88 | IF_FEATURE_BLKID_TYPE(last->type = type;) |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 89 | } |
| 90 | |
Denis Vlasenko | c5b7372 | 2008-03-17 09:21:26 +0000 | [diff] [blame] | 91 | /* If get_label_uuid() on device_name returns success, |
| 92 | * add a cache entry for this device. |
| 93 | * If device node does not exist, it will be temporarily created. */ |
Denis Vlasenko | 582dff0 | 2008-10-19 19:36:30 +0000 | [diff] [blame] | 94 | static int FAST_FUNC |
| 95 | uuidcache_check_device(const char *device, |
| 96 | struct stat *statbuf, |
| 97 | void *userData UNUSED_PARAM, |
| 98 | int depth UNUSED_PARAM) |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 99 | { |
Denys Vlasenko | 4fc5ec5 | 2009-06-27 21:58:25 +0200 | [diff] [blame] | 100 | /* note: this check rejects links to devices, among other nodes */ |
Denis Vlasenko | 582dff0 | 2008-10-19 19:36:30 +0000 | [diff] [blame] | 101 | if (!S_ISBLK(statbuf->st_mode)) |
| 102 | return TRUE; |
Denis Vlasenko | c5b7372 | 2008-03-17 09:21:26 +0000 | [diff] [blame] | 103 | |
Denys Vlasenko | 4fc5ec5 | 2009-06-27 21:58:25 +0200 | [diff] [blame] | 104 | /* Users report that mucking with floppies (especially non-present |
| 105 | * ones) is significant PITA. This is a horribly dirty hack, |
Denys Vlasenko | 1881ba4 | 2009-06-27 22:09:28 +0200 | [diff] [blame] | 106 | * but it is very useful in real world. |
| 107 | * If this will ever need to be enabled, consider using O_NONBLOCK. |
| 108 | */ |
Denys Vlasenko | 4fc5ec5 | 2009-06-27 21:58:25 +0200 | [diff] [blame] | 109 | if (major(statbuf->st_rdev) == 2) |
| 110 | return TRUE; |
| 111 | |
Denys Vlasenko | 90615a0 | 2010-12-30 00:40:11 +0100 | [diff] [blame] | 112 | add_to_uuid_cache(device); |
Denis Vlasenko | c5b7372 | 2008-03-17 09:21:26 +0000 | [diff] [blame] | 113 | |
Denis Vlasenko | 582dff0 | 2008-10-19 19:36:30 +0000 | [diff] [blame] | 114 | return TRUE; |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 115 | } |
| 116 | |
Denys Vlasenko | c3375f0 | 2011-12-06 15:06:59 +0100 | [diff] [blame] | 117 | static struct uuidCache_s* |
Denys Vlasenko | e8cfc3f | 2012-03-03 15:09:07 +0100 | [diff] [blame] | 118 | uuidcache_init(int scan_devices) |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 119 | { |
Denys Vlasenko | 90615a0 | 2010-12-30 00:40:11 +0100 | [diff] [blame] | 120 | dbg("DBG: uuidCache=%x, uuidCache"); |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 121 | if (uuidCache) |
Denys Vlasenko | c3375f0 | 2011-12-06 15:06:59 +0100 | [diff] [blame] | 122 | return uuidCache; |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 123 | |
Denis Vlasenko | 802a7be | 2008-10-19 19:54:49 +0000 | [diff] [blame] | 124 | /* We were scanning /proc/partitions |
| 125 | * and /proc/sys/dev/cdrom/info here. |
| 126 | * Missed volume managers. I see that "standard" blkid uses these: |
| 127 | * /dev/mapper/control |
| 128 | * /proc/devices |
| 129 | * /proc/evms/volumes |
| 130 | * /proc/lvm/VGs |
| 131 | * This is unacceptably complex. Let's just scan /dev. |
| 132 | * (Maybe add scanning of /sys/block/XXX/dev for devices |
| 133 | * somehow not having their /dev/XXX entries created?) */ |
Denys Vlasenko | e8cfc3f | 2012-03-03 15:09:07 +0100 | [diff] [blame] | 134 | if (scan_devices) |
| 135 | recursive_action("/dev", ACTION_RECURSE, |
| 136 | uuidcache_check_device, /* file_action */ |
| 137 | NULL, /* dir_action */ |
| 138 | NULL, /* userData */ |
| 139 | 0 /* depth */); |
Denys Vlasenko | c3375f0 | 2011-12-06 15:06:59 +0100 | [diff] [blame] | 140 | |
| 141 | return uuidCache; |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 142 | } |
| 143 | |
| 144 | #define UUID 1 |
| 145 | #define VOL 2 |
| 146 | |
| 147 | #ifdef UNUSED |
| 148 | static char * |
Denis Vlasenko | c5b7372 | 2008-03-17 09:21:26 +0000 | [diff] [blame] | 149 | get_spec_by_x(int n, const char *t, int *majorPtr, int *minorPtr) |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 150 | { |
| 151 | struct uuidCache_s *uc; |
| 152 | |
Denys Vlasenko | e8cfc3f | 2012-03-03 15:09:07 +0100 | [diff] [blame] | 153 | uc = uuidcache_init(/*scan_devices:*/ 1); |
Denis Vlasenko | c5b7372 | 2008-03-17 09:21:26 +0000 | [diff] [blame] | 154 | while (uc) { |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 155 | switch (n) { |
| 156 | case UUID: |
Denis Vlasenko | c5b7372 | 2008-03-17 09:21:26 +0000 | [diff] [blame] | 157 | if (strcmp(t, uc->uc_uuid) == 0) { |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 158 | *majorPtr = uc->major; |
| 159 | *minorPtr = uc->minor; |
| 160 | return uc->device; |
| 161 | } |
| 162 | break; |
| 163 | case VOL: |
Denis Vlasenko | c5b7372 | 2008-03-17 09:21:26 +0000 | [diff] [blame] | 164 | if (strcmp(t, uc->label) == 0) { |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 165 | *majorPtr = uc->major; |
| 166 | *minorPtr = uc->minor; |
| 167 | return uc->device; |
| 168 | } |
| 169 | break; |
| 170 | } |
| 171 | uc = uc->next; |
| 172 | } |
| 173 | return NULL; |
| 174 | } |
| 175 | |
| 176 | static unsigned char |
| 177 | fromhex(char c) |
| 178 | { |
| 179 | if (isdigit(c)) |
| 180 | return (c - '0'); |
Denis Vlasenko | c5b7372 | 2008-03-17 09:21:26 +0000 | [diff] [blame] | 181 | return ((c|0x20) - 'a' + 10); |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 182 | } |
| 183 | |
| 184 | static char * |
Denis Vlasenko | c5b7372 | 2008-03-17 09:21:26 +0000 | [diff] [blame] | 185 | get_spec_by_uuid(const char *s, int *major, int *minor) |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 186 | { |
| 187 | unsigned char uuid[16]; |
| 188 | int i; |
| 189 | |
Denis Vlasenko | c5b7372 | 2008-03-17 09:21:26 +0000 | [diff] [blame] | 190 | if (strlen(s) != 36 || s[8] != '-' || s[13] != '-' |
| 191 | || s[18] != '-' || s[23] != '-' |
| 192 | ) { |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 193 | goto bad_uuid; |
Denis Vlasenko | c5b7372 | 2008-03-17 09:21:26 +0000 | [diff] [blame] | 194 | } |
| 195 | for (i = 0; i < 16; i++) { |
| 196 | if (*s == '-') |
| 197 | s++; |
| 198 | if (!isxdigit(s[0]) || !isxdigit(s[1])) |
| 199 | goto bad_uuid; |
| 200 | uuid[i] = ((fromhex(s[0]) << 4) | fromhex(s[1])); |
| 201 | s += 2; |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 202 | } |
| 203 | return get_spec_by_x(UUID, (char *)uuid, major, minor); |
| 204 | |
| 205 | bad_uuid: |
| 206 | fprintf(stderr, _("mount: bad UUID")); |
| 207 | return 0; |
| 208 | } |
| 209 | |
| 210 | static char * |
| 211 | get_spec_by_volume_label(const char *s, int *major, int *minor) |
| 212 | { |
| 213 | return get_spec_by_x(VOL, s, major, minor); |
| 214 | } |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 215 | #endif // UNUSED |
| 216 | |
Denis Vlasenko | 1e19afd | 2008-10-12 11:20:08 +0000 | [diff] [blame] | 217 | /* Used by blkid */ |
Denys Vlasenko | e8cfc3f | 2012-03-03 15:09:07 +0100 | [diff] [blame] | 218 | void display_uuid_cache(int scan_devices) |
Denis Vlasenko | 1e19afd | 2008-10-12 11:20:08 +0000 | [diff] [blame] | 219 | { |
Denys Vlasenko | c3375f0 | 2011-12-06 15:06:59 +0100 | [diff] [blame] | 220 | struct uuidCache_s *uc; |
Denis Vlasenko | 1e19afd | 2008-10-12 11:20:08 +0000 | [diff] [blame] | 221 | |
Denys Vlasenko | e8cfc3f | 2012-03-03 15:09:07 +0100 | [diff] [blame] | 222 | uc = uuidcache_init(scan_devices); |
Denys Vlasenko | c3375f0 | 2011-12-06 15:06:59 +0100 | [diff] [blame] | 223 | while (uc) { |
| 224 | printf("%s:", uc->device); |
| 225 | if (uc->label[0]) |
| 226 | printf(" LABEL=\"%s\"", uc->label); |
| 227 | if (uc->uc_uuid[0]) |
| 228 | printf(" UUID=\"%s\"", uc->uc_uuid); |
Denys Vlasenko | 90615a0 | 2010-12-30 00:40:11 +0100 | [diff] [blame] | 229 | #if ENABLE_FEATURE_BLKID_TYPE |
Denys Vlasenko | c3375f0 | 2011-12-06 15:06:59 +0100 | [diff] [blame] | 230 | if (uc->type) |
| 231 | printf(" TYPE=\"%s\"", uc->type); |
Denys Vlasenko | 90615a0 | 2010-12-30 00:40:11 +0100 | [diff] [blame] | 232 | #endif |
Denis Vlasenko | 1e19afd | 2008-10-12 11:20:08 +0000 | [diff] [blame] | 233 | bb_putchar('\n'); |
Denys Vlasenko | c3375f0 | 2011-12-06 15:06:59 +0100 | [diff] [blame] | 234 | uc = uc->next; |
Denis Vlasenko | 1e19afd | 2008-10-12 11:20:08 +0000 | [diff] [blame] | 235 | } |
| 236 | } |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 237 | |
Denys Vlasenko | 90615a0 | 2010-12-30 00:40:11 +0100 | [diff] [blame] | 238 | int add_to_uuid_cache(const char *device) |
| 239 | { |
| 240 | char *uuid = uuid; /* for compiler */ |
| 241 | char *label = label; |
| 242 | #if ENABLE_FEATURE_BLKID_TYPE |
| 243 | const char *type = type; |
| 244 | #endif |
| 245 | int fd; |
| 246 | |
| 247 | fd = open(device, O_RDONLY); |
| 248 | if (fd < 0) |
| 249 | return 0; |
| 250 | |
| 251 | /* get_label_uuid() closes fd in all cases (success & failure) */ |
| 252 | if (get_label_uuid(fd, &label, &uuid, &type) == 0) { |
| 253 | /* uuidcache_addentry() takes ownership of all four params */ |
| 254 | uuidcache_addentry(xstrdup(device), /*ma, mi,*/ label, uuid, type); |
| 255 | return 1; |
| 256 | } |
| 257 | return 0; |
| 258 | } |
| 259 | |
| 260 | |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 261 | /* Used by mount and findfs */ |
| 262 | |
| 263 | char *get_devname_from_label(const char *spec) |
| 264 | { |
| 265 | struct uuidCache_s *uc; |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 266 | |
Denys Vlasenko | e8cfc3f | 2012-03-03 15:09:07 +0100 | [diff] [blame] | 267 | uc = uuidcache_init(/*scan_devices:*/ 1); |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 268 | while (uc) { |
Denis Vlasenko | 9983d80 | 2009-03-31 19:47:34 +0000 | [diff] [blame] | 269 | if (uc->label[0] && strcmp(spec, uc->label) == 0) { |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 270 | return xstrdup(uc->device); |
| 271 | } |
| 272 | uc = uc->next; |
| 273 | } |
| 274 | return NULL; |
| 275 | } |
| 276 | |
| 277 | char *get_devname_from_uuid(const char *spec) |
| 278 | { |
| 279 | struct uuidCache_s *uc; |
| 280 | |
Denys Vlasenko | e8cfc3f | 2012-03-03 15:09:07 +0100 | [diff] [blame] | 281 | uc = uuidcache_init(/*scan_devices:*/ 1); |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 282 | while (uc) { |
Denis Vlasenko | d25c33f | 2008-03-17 09:25:05 +0000 | [diff] [blame] | 283 | /* case of hex numbers doesn't matter */ |
| 284 | if (strcasecmp(spec, uc->uc_uuid) == 0) { |
Denis Vlasenko | de7684a | 2008-02-18 21:08:49 +0000 | [diff] [blame] | 285 | return xstrdup(uc->device); |
| 286 | } |
| 287 | uc = uc->next; |
| 288 | } |
| 289 | return NULL; |
| 290 | } |
Natanael Copa | 9aff299 | 2009-09-20 04:28:22 +0200 | [diff] [blame] | 291 | |
| 292 | int resolve_mount_spec(char **fsname) |
| 293 | { |
| 294 | char *tmp = *fsname; |
| 295 | |
| 296 | if (strncmp(*fsname, "UUID=", 5) == 0) |
| 297 | tmp = get_devname_from_uuid(*fsname + 5); |
| 298 | else if (strncmp(*fsname, "LABEL=", 6) == 0) |
| 299 | tmp = get_devname_from_label(*fsname + 6); |
| 300 | |
| 301 | if (tmp == *fsname) |
| 302 | return 0; /* no UUID= or LABEL= prefix found */ |
| 303 | |
| 304 | if (tmp) |
| 305 | *fsname = tmp; |
| 306 | return 1; |
| 307 | } |