The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 The Android Open Source Project |
| 3 | * All rights reserved. |
| 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that the following conditions |
| 7 | * are met: |
| 8 | * * Redistributions of source code must retain the above copyright |
| 9 | * notice, this list of conditions and the following disclaimer. |
| 10 | * * Redistributions in binary form must reproduce the above copyright |
| 11 | * notice, this list of conditions and the following disclaimer in |
| 12 | * the documentation and/or other materials provided with the |
| 13 | * distribution. |
| 14 | * |
| 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 16 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 17 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 18 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
| 19 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| 21 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS |
| 22 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
| 23 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
| 25 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 26 | * SUCH DAMAGE. |
| 27 | */ |
| 28 | #include <stdio.h> |
Colin Cross | 5cf32de | 2013-01-23 23:07:06 -0800 | [diff] [blame] | 29 | #include <stdint.h> |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 30 | #include <stdlib.h> |
| 31 | #include <unistd.h> |
| 32 | #include <stddef.h> |
| 33 | #include <errno.h> |
Brad Fitzpatrick | 23bc3ff | 2011-03-30 13:10:04 -0700 | [diff] [blame] | 34 | #include <poll.h> |
Nick Kralevich | 32417fb | 2013-01-23 09:28:35 -0800 | [diff] [blame] | 35 | #include <fcntl.h> |
| 36 | #include <stdbool.h> |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 37 | |
| 38 | #include <sys/mman.h> |
| 39 | |
| 40 | #include <sys/socket.h> |
| 41 | #include <sys/un.h> |
| 42 | #include <sys/select.h> |
Nick Kralevich | 32417fb | 2013-01-23 09:28:35 -0800 | [diff] [blame] | 43 | #include <sys/stat.h> |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 44 | #include <sys/types.h> |
| 45 | #include <netinet/in.h> |
satok | ec7e8cc | 2011-03-15 11:02:26 +0900 | [diff] [blame] | 46 | #include <unistd.h> |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 47 | |
| 48 | #define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ |
| 49 | #include <sys/_system_properties.h> |
| 50 | |
| 51 | #include <sys/atomics.h> |
| 52 | |
Colin Cross | 5cf32de | 2013-01-23 23:07:06 -0800 | [diff] [blame] | 53 | struct prop_area { |
| 54 | unsigned volatile count; |
| 55 | unsigned volatile serial; |
| 56 | unsigned magic; |
| 57 | unsigned version; |
| 58 | unsigned reserved[4]; |
| 59 | unsigned toc[1]; |
| 60 | }; |
| 61 | |
| 62 | typedef struct prop_area prop_area; |
| 63 | |
| 64 | struct prop_info { |
| 65 | char name[PROP_NAME_MAX]; |
| 66 | unsigned volatile serial; |
| 67 | char value[PROP_VALUE_MAX]; |
| 68 | }; |
| 69 | |
| 70 | typedef struct prop_info prop_info; |
| 71 | |
satok | ec7e8cc | 2011-03-15 11:02:26 +0900 | [diff] [blame] | 72 | static const char property_service_socket[] = "/dev/socket/" PROP_SERVICE_NAME; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 73 | |
| 74 | static unsigned dummy_props = 0; |
| 75 | |
| 76 | prop_area *__system_property_area__ = (void*) &dummy_props; |
| 77 | |
Nick Kralevich | 32417fb | 2013-01-23 09:28:35 -0800 | [diff] [blame] | 78 | static int get_fd_from_env(void) |
| 79 | { |
| 80 | char *env = getenv("ANDROID_PROPERTY_WORKSPACE"); |
| 81 | |
| 82 | if (!env) { |
| 83 | return -1; |
| 84 | } |
| 85 | |
| 86 | return atoi(env); |
| 87 | } |
| 88 | |
Colin Cross | 5cf32de | 2013-01-23 23:07:06 -0800 | [diff] [blame] | 89 | void __system_property_area_init(void *data) |
| 90 | { |
| 91 | prop_area *pa = data; |
| 92 | memset(pa, 0, PA_SIZE); |
| 93 | pa->magic = PROP_AREA_MAGIC; |
| 94 | pa->version = PROP_AREA_VERSION; |
| 95 | |
| 96 | /* plug into the lib property services */ |
| 97 | __system_property_area__ = pa; |
| 98 | } |
| 99 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 100 | int __system_properties_init(void) |
| 101 | { |
Nick Kralevich | 32417fb | 2013-01-23 09:28:35 -0800 | [diff] [blame] | 102 | bool fromFile = true; |
Nick Kralevich | c16961b | 2013-01-25 13:07:31 -0800 | [diff] [blame] | 103 | int result = -1; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 104 | |
| 105 | if(__system_property_area__ != ((void*) &dummy_props)) { |
| 106 | return 0; |
| 107 | } |
| 108 | |
Nick Kralevich | 32417fb | 2013-01-23 09:28:35 -0800 | [diff] [blame] | 109 | int fd = open(PROP_FILENAME, O_RDONLY | O_NOFOLLOW); |
| 110 | |
| 111 | if ((fd < 0) && (errno == ENOENT)) { |
| 112 | /* |
| 113 | * For backwards compatibility, if the file doesn't |
| 114 | * exist, we use the environment to get the file descriptor. |
| 115 | * For security reasons, we only use this backup if the kernel |
| 116 | * returns ENOENT. We don't want to use the backup if the kernel |
| 117 | * returns other errors such as ENOMEM or ENFILE, since it |
| 118 | * might be possible for an external program to trigger this |
| 119 | * condition. |
| 120 | */ |
| 121 | fd = get_fd_from_env(); |
| 122 | fromFile = false; |
| 123 | } |
| 124 | |
| 125 | if (fd < 0) { |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 126 | return -1; |
| 127 | } |
Nick Kralevich | 32417fb | 2013-01-23 09:28:35 -0800 | [diff] [blame] | 128 | |
| 129 | struct stat fd_stat; |
| 130 | if (fstat(fd, &fd_stat) < 0) { |
Nick Kralevich | c16961b | 2013-01-25 13:07:31 -0800 | [diff] [blame] | 131 | goto cleanup; |
| 132 | } |
| 133 | |
| 134 | if ((fd_stat.st_uid != 0) |
| 135 | || (fd_stat.st_gid != 0) |
| 136 | || ((fd_stat.st_mode & (S_IWGRP | S_IWOTH)) != 0)) { |
| 137 | goto cleanup; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 138 | } |
Nick Kralevich | 32417fb | 2013-01-23 09:28:35 -0800 | [diff] [blame] | 139 | |
Elliott Hughes | 0d787c1 | 2013-04-04 13:46:46 -0700 | [diff] [blame] | 140 | prop_area *pa = mmap(NULL, fd_stat.st_size, PROT_READ, MAP_SHARED, fd, 0); |
Nick Kralevich | 32417fb | 2013-01-23 09:28:35 -0800 | [diff] [blame] | 141 | |
Nick Kralevich | 32417fb | 2013-01-23 09:28:35 -0800 | [diff] [blame] | 142 | if (pa == MAP_FAILED) { |
Nick Kralevich | c16961b | 2013-01-25 13:07:31 -0800 | [diff] [blame] | 143 | goto cleanup; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 144 | } |
| 145 | |
| 146 | if((pa->magic != PROP_AREA_MAGIC) || (pa->version != PROP_AREA_VERSION)) { |
Nick Kralevich | 32417fb | 2013-01-23 09:28:35 -0800 | [diff] [blame] | 147 | munmap(pa, fd_stat.st_size); |
Nick Kralevich | c16961b | 2013-01-25 13:07:31 -0800 | [diff] [blame] | 148 | goto cleanup; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 149 | } |
| 150 | |
| 151 | __system_property_area__ = pa; |
Nick Kralevich | c16961b | 2013-01-25 13:07:31 -0800 | [diff] [blame] | 152 | result = 0; |
| 153 | |
| 154 | cleanup: |
| 155 | if (fromFile) { |
| 156 | close(fd); |
| 157 | } |
| 158 | |
| 159 | return result; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 160 | } |
| 161 | |
Greg Hackmann | c6ff844 | 2013-02-12 16:39:31 -0800 | [diff] [blame^] | 162 | int __system_property_foreach( |
| 163 | void (*propfn)(const prop_info *pi, void *cookie), |
| 164 | void *cookie) |
| 165 | { |
| 166 | prop_area *pa = __system_property_area__; |
| 167 | unsigned i; |
| 168 | |
| 169 | for (i = 0; i < pa->count; i++) { |
| 170 | unsigned entry = pa->toc[i]; |
| 171 | prop_info *pi = TOC_TO_INFO(pa, entry); |
| 172 | propfn(pi, cookie); |
| 173 | } |
| 174 | |
| 175 | return 0; |
| 176 | } |
| 177 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 178 | const prop_info *__system_property_find_nth(unsigned n) |
| 179 | { |
| 180 | prop_area *pa = __system_property_area__; |
| 181 | |
| 182 | if(n >= pa->count) { |
| 183 | return 0; |
| 184 | } else { |
| 185 | return TOC_TO_INFO(pa, pa->toc[n]); |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | const prop_info *__system_property_find(const char *name) |
| 190 | { |
| 191 | prop_area *pa = __system_property_area__; |
| 192 | unsigned count = pa->count; |
| 193 | unsigned *toc = pa->toc; |
| 194 | unsigned len = strlen(name); |
| 195 | prop_info *pi; |
| 196 | |
Colin Cross | 5cf32de | 2013-01-23 23:07:06 -0800 | [diff] [blame] | 197 | if (len >= PROP_NAME_MAX) |
| 198 | return 0; |
| 199 | if (len < 1) |
| 200 | return 0; |
| 201 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 202 | while(count--) { |
| 203 | unsigned entry = *toc++; |
| 204 | if(TOC_NAME_LEN(entry) != len) continue; |
Elliott Hughes | 0d787c1 | 2013-04-04 13:46:46 -0700 | [diff] [blame] | 205 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 206 | pi = TOC_TO_INFO(pa, entry); |
| 207 | if(memcmp(name, pi->name, len)) continue; |
| 208 | |
| 209 | return pi; |
| 210 | } |
| 211 | |
| 212 | return 0; |
| 213 | } |
| 214 | |
| 215 | int __system_property_read(const prop_info *pi, char *name, char *value) |
| 216 | { |
| 217 | unsigned serial, len; |
Elliott Hughes | 0d787c1 | 2013-04-04 13:46:46 -0700 | [diff] [blame] | 218 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 219 | for(;;) { |
| 220 | serial = pi->serial; |
| 221 | while(SERIAL_DIRTY(serial)) { |
David 'Digit' Turner | 50ace4f | 2010-06-16 16:36:41 -0700 | [diff] [blame] | 222 | __futex_wait((volatile void *)&pi->serial, serial, 0); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 223 | serial = pi->serial; |
| 224 | } |
| 225 | len = SERIAL_VALUE_LEN(serial); |
| 226 | memcpy(value, pi->value, len + 1); |
| 227 | if(serial == pi->serial) { |
| 228 | if(name != 0) { |
| 229 | strcpy(name, pi->name); |
| 230 | } |
| 231 | return len; |
| 232 | } |
| 233 | } |
| 234 | } |
| 235 | |
| 236 | int __system_property_get(const char *name, char *value) |
| 237 | { |
| 238 | const prop_info *pi = __system_property_find(name); |
| 239 | |
| 240 | if(pi != 0) { |
| 241 | return __system_property_read(pi, 0, value); |
| 242 | } else { |
| 243 | value[0] = 0; |
| 244 | return 0; |
| 245 | } |
| 246 | } |
| 247 | |
satok | ec7e8cc | 2011-03-15 11:02:26 +0900 | [diff] [blame] | 248 | |
| 249 | static int send_prop_msg(prop_msg *msg) |
| 250 | { |
Brad Fitzpatrick | 23bc3ff | 2011-03-30 13:10:04 -0700 | [diff] [blame] | 251 | struct pollfd pollfds[1]; |
satok | ec7e8cc | 2011-03-15 11:02:26 +0900 | [diff] [blame] | 252 | struct sockaddr_un addr; |
| 253 | socklen_t alen; |
| 254 | size_t namelen; |
| 255 | int s; |
| 256 | int r; |
Brad Fitzpatrick | 23bc3ff | 2011-03-30 13:10:04 -0700 | [diff] [blame] | 257 | int result = -1; |
satok | ec7e8cc | 2011-03-15 11:02:26 +0900 | [diff] [blame] | 258 | |
| 259 | s = socket(AF_LOCAL, SOCK_STREAM, 0); |
| 260 | if(s < 0) { |
Brad Fitzpatrick | 23bc3ff | 2011-03-30 13:10:04 -0700 | [diff] [blame] | 261 | return result; |
satok | ec7e8cc | 2011-03-15 11:02:26 +0900 | [diff] [blame] | 262 | } |
| 263 | |
| 264 | memset(&addr, 0, sizeof(addr)); |
| 265 | namelen = strlen(property_service_socket); |
| 266 | strlcpy(addr.sun_path, property_service_socket, sizeof addr.sun_path); |
| 267 | addr.sun_family = AF_LOCAL; |
| 268 | alen = namelen + offsetof(struct sockaddr_un, sun_path) + 1; |
| 269 | |
Jens Gulin | c20d0f3 | 2012-07-19 14:10:46 +0200 | [diff] [blame] | 270 | if(TEMP_FAILURE_RETRY(connect(s, (struct sockaddr *) &addr, alen)) < 0) { |
satok | ec7e8cc | 2011-03-15 11:02:26 +0900 | [diff] [blame] | 271 | close(s); |
Brad Fitzpatrick | 23bc3ff | 2011-03-30 13:10:04 -0700 | [diff] [blame] | 272 | return result; |
satok | ec7e8cc | 2011-03-15 11:02:26 +0900 | [diff] [blame] | 273 | } |
| 274 | |
| 275 | r = TEMP_FAILURE_RETRY(send(s, msg, sizeof(prop_msg), 0)); |
| 276 | |
| 277 | if(r == sizeof(prop_msg)) { |
Brad Fitzpatrick | 23bc3ff | 2011-03-30 13:10:04 -0700 | [diff] [blame] | 278 | // We successfully wrote to the property server but now we |
| 279 | // wait for the property server to finish its work. It |
| 280 | // acknowledges its completion by closing the socket so we |
| 281 | // poll here (on nothing), waiting for the socket to close. |
| 282 | // If you 'adb shell setprop foo bar' you'll see the POLLHUP |
| 283 | // once the socket closes. Out of paranoia we cap our poll |
| 284 | // at 250 ms. |
| 285 | pollfds[0].fd = s; |
| 286 | pollfds[0].events = 0; |
| 287 | r = TEMP_FAILURE_RETRY(poll(pollfds, 1, 250 /* ms */)); |
| 288 | if (r == 1 && (pollfds[0].revents & POLLHUP) != 0) { |
| 289 | result = 0; |
Brad Fitzpatrick | 8da75ab | 2011-04-01 10:53:12 -0700 | [diff] [blame] | 290 | } else { |
| 291 | // Ignore the timeout and treat it like a success anyway. |
| 292 | // The init process is single-threaded and its property |
| 293 | // service is sometimes slow to respond (perhaps it's off |
| 294 | // starting a child process or something) and thus this |
| 295 | // times out and the caller thinks it failed, even though |
| 296 | // it's still getting around to it. So we fake it here, |
| 297 | // mostly for ctl.* properties, but we do try and wait 250 |
| 298 | // ms so callers who do read-after-write can reliably see |
| 299 | // what they've written. Most of the time. |
| 300 | // TODO: fix the system properties design. |
| 301 | result = 0; |
Brad Fitzpatrick | 23bc3ff | 2011-03-30 13:10:04 -0700 | [diff] [blame] | 302 | } |
satok | ec7e8cc | 2011-03-15 11:02:26 +0900 | [diff] [blame] | 303 | } |
| 304 | |
| 305 | close(s); |
Brad Fitzpatrick | 23bc3ff | 2011-03-30 13:10:04 -0700 | [diff] [blame] | 306 | return result; |
satok | ec7e8cc | 2011-03-15 11:02:26 +0900 | [diff] [blame] | 307 | } |
| 308 | |
| 309 | int __system_property_set(const char *key, const char *value) |
| 310 | { |
satok | ec7e8cc | 2011-03-15 11:02:26 +0900 | [diff] [blame] | 311 | int err; |
Brad Fitzpatrick | 23bc3ff | 2011-03-30 13:10:04 -0700 | [diff] [blame] | 312 | prop_msg msg; |
satok | ec7e8cc | 2011-03-15 11:02:26 +0900 | [diff] [blame] | 313 | |
| 314 | if(key == 0) return -1; |
| 315 | if(value == 0) value = ""; |
| 316 | if(strlen(key) >= PROP_NAME_MAX) return -1; |
| 317 | if(strlen(value) >= PROP_VALUE_MAX) return -1; |
| 318 | |
| 319 | memset(&msg, 0, sizeof msg); |
| 320 | msg.cmd = PROP_MSG_SETPROP; |
| 321 | strlcpy(msg.name, key, sizeof msg.name); |
| 322 | strlcpy(msg.value, value, sizeof msg.value); |
| 323 | |
satok | ec7e8cc | 2011-03-15 11:02:26 +0900 | [diff] [blame] | 324 | err = send_prop_msg(&msg); |
| 325 | if(err < 0) { |
| 326 | return err; |
| 327 | } |
| 328 | |
satok | ec7e8cc | 2011-03-15 11:02:26 +0900 | [diff] [blame] | 329 | return 0; |
| 330 | } |
| 331 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 332 | int __system_property_wait(const prop_info *pi) |
| 333 | { |
| 334 | unsigned n; |
| 335 | if(pi == 0) { |
| 336 | prop_area *pa = __system_property_area__; |
| 337 | n = pa->serial; |
| 338 | do { |
| 339 | __futex_wait(&pa->serial, n, 0); |
| 340 | } while(n == pa->serial); |
| 341 | } else { |
| 342 | n = pi->serial; |
| 343 | do { |
David 'Digit' Turner | 50ace4f | 2010-06-16 16:36:41 -0700 | [diff] [blame] | 344 | __futex_wait((volatile void *)&pi->serial, n, 0); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 345 | } while(n == pi->serial); |
| 346 | } |
| 347 | return 0; |
| 348 | } |
Colin Cross | 5cf32de | 2013-01-23 23:07:06 -0800 | [diff] [blame] | 349 | |
| 350 | int __system_property_update(prop_info *pi, const char *value, unsigned int len) |
| 351 | { |
| 352 | prop_area *pa = __system_property_area__; |
| 353 | |
| 354 | if (len >= PROP_VALUE_MAX) |
| 355 | return -1; |
| 356 | |
| 357 | pi->serial = pi->serial | 1; |
| 358 | memcpy(pi->value, value, len + 1); |
| 359 | pi->serial = (len << 24) | ((pi->serial + 1) & 0xffffff); |
| 360 | __futex_wake(&pi->serial, INT32_MAX); |
| 361 | |
| 362 | pa->serial++; |
| 363 | __futex_wake(&pa->serial, INT32_MAX); |
| 364 | |
| 365 | return 0; |
| 366 | } |
| 367 | |
| 368 | int __system_property_add(const char *name, unsigned int namelen, |
| 369 | const char *value, unsigned int valuelen) |
| 370 | { |
| 371 | prop_area *pa = __system_property_area__; |
| 372 | prop_info *pa_info_array = (void*) (((char*) pa) + PA_INFO_START); |
| 373 | prop_info *pi; |
| 374 | |
| 375 | if (pa->count == PA_COUNT_MAX) |
| 376 | return -1; |
| 377 | if (namelen >= PROP_NAME_MAX) |
| 378 | return -1; |
| 379 | if (valuelen >= PROP_VALUE_MAX) |
| 380 | return -1; |
| 381 | if (namelen < 1) |
| 382 | return -1; |
| 383 | |
| 384 | pi = pa_info_array + pa->count; |
| 385 | pi->serial = (valuelen << 24); |
| 386 | memcpy(pi->name, name, namelen + 1); |
| 387 | memcpy(pi->value, value, valuelen + 1); |
| 388 | |
| 389 | pa->toc[pa->count] = |
| 390 | (namelen << 24) | (((unsigned) pi) - ((unsigned) pa)); |
| 391 | |
| 392 | pa->count++; |
| 393 | pa->serial++; |
| 394 | __futex_wake(&pa->serial, INT32_MAX); |
| 395 | |
| 396 | return 0; |
| 397 | } |
| 398 | |
| 399 | unsigned int __system_property_serial(const prop_info *pi) |
| 400 | { |
| 401 | return pi->serial; |
| 402 | } |
| 403 | |
| 404 | unsigned int __system_property_wait_any(unsigned int serial) |
| 405 | { |
| 406 | prop_area *pa = __system_property_area__; |
| 407 | |
| 408 | do { |
| 409 | __futex_wait(&pa->serial, serial, 0); |
| 410 | } while(pa->serial == serial); |
| 411 | |
| 412 | return pa->serial; |
| 413 | } |