blob: c4c4350a4c9be7c5dcd5198d6358904a3accceb4 [file] [log] [blame]
"Robert P. J. Day"63fc1a92006-07-02 19:47:05 +00001/* vi: set sw=4 ts=4: */
2/*
Tim Rikerc1ef7bd2006-01-25 00:08:53 +00003 *
Rob Landley70f7ef72005-12-13 08:21:33 +00004 * mdev - Mini udev for busybox
Tim Rikerc1ef7bd2006-01-25 00:08:53 +00005 *
Rob Landley70f7ef72005-12-13 08:21:33 +00006 * Copyright 2005 Rob Landley <rob@landley.net>
7 * Copyright 2005 Frank Sorenson <frank@tuxrocks.com>
8 *
Rob Landleye9a7a622006-09-22 02:52:41 +00009 * Licensed under GPL version 2, see file LICENSE in this tarball for details.
Rob Landley70f7ef72005-12-13 08:21:33 +000010 */
11
Denis Vlasenkob6adbf12007-05-26 19:00:18 +000012#include "libbb.h"
Rob Landleyb56c2852005-12-17 10:52:30 +000013#include "xregex.h"
Rob Landley70f7ef72005-12-13 08:21:33 +000014
Denis Vlasenko4e5f82c2007-06-03 22:30:22 +000015struct globals {
Rob Landley5cd1ccd2006-05-21 18:33:27 +000016 int root_major, root_minor;
Denis Vlasenko4e5f82c2007-06-03 22:30:22 +000017};
18#define G (*(struct globals*)&bb_common_bufsiz1)
19#define root_major (G.root_major)
20#define root_minor (G.root_minor)
Rob Landleya7e3d052006-02-21 06:11:13 +000021
Mike Frysingerb51fd352007-06-13 09:24:50 +000022#define MAX_SYSFS_DEPTH 3 /* prevent infinite loops in /sys symlinks */
23
Denis Vlasenkocf26ab72008-03-27 22:45:44 +000024/* We use additional 64+ bytes in make_device() */
25#define SCRATCH_SIZE 80
26
Denis Vlasenko44615642008-03-29 13:10:57 +000027static char *next_field(char *s)
28{
29 char *end = skip_non_whitespace(s);
30 s = skip_whitespace(end);
31 *end = '\0';
32 if (*s == '\0')
33 s = NULL;
34 return s;
35}
36
Rob Landley70f7ef72005-12-13 08:21:33 +000037/* mknod in /dev based on a path like "/sys/block/hda/hda1" */
Denis Vlasenkocf26ab72008-03-27 22:45:44 +000038/* NB: "mdev -s" may call us many times, do not leak memory/fds! */
Rob Landleyef10d522006-06-26 14:11:33 +000039static void make_device(char *path, int delete)
Rob Landley70f7ef72005-12-13 08:21:33 +000040{
Denis Vlasenkodc757aa2007-06-30 08:04:05 +000041 const char *device_name;
Denis Vlasenkof46be092006-10-16 19:39:37 +000042 int major, minor, type, len;
Mike Frysingera421ba82006-02-03 00:25:37 +000043 int mode = 0660;
44 uid_t uid = 0;
45 gid_t gid = 0;
Denis Vlasenkocf26ab72008-03-27 22:45:44 +000046 char *dev_maj_min = path + strlen(path);
Rob Landleyef10d522006-06-26 14:11:33 +000047 char *command = NULL;
Mike Frysingerf0044c42008-02-01 06:53:50 +000048 char *alias = NULL;
49
50 /* Force the configuration file settings exactly. */
51 umask(0);
Rob Landley70f7ef72005-12-13 08:21:33 +000052
Rob Landley15fe2e12006-05-08 02:53:23 +000053 /* Try to read major/minor string. Note that the kernel puts \n after
54 * the data, so we don't need to worry about null terminating the string
55 * because sscanf() will stop at the first nondigit, which \n is. We
Mike Frysingerc881c732007-11-19 09:04:22 +000056 * also depend on path having writeable space after it.
57 */
Rob Landley10b36f92006-08-10 01:09:37 +000058 if (!delete) {
Denis Vlasenkocf26ab72008-03-27 22:45:44 +000059 strcpy(dev_maj_min, "/dev");
60 len = open_read_close(path, dev_maj_min + 1, 64);
61 *dev_maj_min++ = '\0';
Mike Frysingerae86a332008-02-20 18:31:36 +000062 if (len < 1) {
Denis Vlasenkocf26ab72008-03-27 22:45:44 +000063 if (!ENABLE_FEATURE_MDEV_EXEC)
Mike Frysingerae86a332008-02-20 18:31:36 +000064 return;
Denis Vlasenkocf26ab72008-03-27 22:45:44 +000065 /* no "dev" file, so just try to run script */
66 *dev_maj_min = '\0';
Mike Frysingerae86a332008-02-20 18:31:36 +000067 }
Rob Landley10b36f92006-08-10 01:09:37 +000068 }
Tim Rikerc1ef7bd2006-01-25 00:08:53 +000069
Rob Landley70f7ef72005-12-13 08:21:33 +000070 /* Determine device name, type, major and minor */
Denis Vlasenkodc757aa2007-06-30 08:04:05 +000071 device_name = bb_basename(path);
Denis Vlasenkocf26ab72008-03-27 22:45:44 +000072 type = (path[5] == 'c' ? S_IFCHR : S_IFBLK); /* "/sys/[c]lass"? */
Tim Rikerc1ef7bd2006-01-25 00:08:53 +000073
Rob Landleyb56c2852005-12-17 10:52:30 +000074 if (ENABLE_FEATURE_MDEV_CONF) {
Mike Frysingerc881c732007-11-19 09:04:22 +000075 FILE *fp;
Denis Vlasenko44615642008-03-29 13:10:57 +000076 char *line, *val, *next;
Denis Vlasenkoee87ebf2007-12-21 22:18:16 +000077 unsigned lineno = 0;
Rob Landleyb56c2852005-12-17 10:52:30 +000078
Denis Vlasenko44615642008-03-29 13:10:57 +000079 /* If we have config file, look up user settings */
Mike Frysingerc881c732007-11-19 09:04:22 +000080 fp = fopen_or_warn("/etc/mdev.conf", "r");
81 if (!fp)
Denis Vlasenkof46be092006-10-16 19:39:37 +000082 goto end_parse;
Rob Landleyb56c2852005-12-17 10:52:30 +000083
Denis Vlasenko44615642008-03-29 13:10:57 +000084 while ((line = xmalloc_fgetline(fp)) != NULL) {
Mike Frysingerc881c732007-11-19 09:04:22 +000085 ++lineno;
Denis Vlasenko44615642008-03-29 13:10:57 +000086 trim(line);
87 if (!line[0])
88 goto next_line;
Denis Vlasenkocf26ab72008-03-27 22:45:44 +000089
90 /* Fields: regex uid:gid mode [alias] [cmd] */
Mike Frysingerc881c732007-11-19 09:04:22 +000091
Denis Vlasenko44615642008-03-29 13:10:57 +000092 /* 1st field: regex to match this device */
93 next = next_field(line);
94 {
95 regex_t match;
96 regmatch_t off;
97 int result;
Mike Frysingera421ba82006-02-03 00:25:37 +000098
Denis Vlasenko44615642008-03-29 13:10:57 +000099 /* Is this it? */
100 xregcomp(&match, line, REG_EXTENDED);
101 result = regexec(&match, device_name, 1, &off, 0);
102 regfree(&match);
Rob Landleyb56c2852005-12-17 10:52:30 +0000103
Denis Vlasenko44615642008-03-29 13:10:57 +0000104 /* If not this device, skip rest of line */
105 if (result || off.rm_so || off.rm_eo != strlen(device_name))
106 goto next_line;
107 }
Tim Rikerc1ef7bd2006-01-25 00:08:53 +0000108
Denis Vlasenko44615642008-03-29 13:10:57 +0000109 /* This line matches: stop parsing the file
110 * after parsing the rest of fields */
Rob Landleyb56c2852005-12-17 10:52:30 +0000111
Denis Vlasenko44615642008-03-29 13:10:57 +0000112 /* 2nd field: uid:gid - device ownership */
113 if (!next) /* field must exist */
Denis Vlasenkoee87ebf2007-12-21 22:18:16 +0000114 bb_error_msg_and_die("bad line %u", lineno);
Denis Vlasenko44615642008-03-29 13:10:57 +0000115 val = next;
116 next = next_field(val);
117 {
118 struct passwd *pass;
119 struct group *grp;
120 char *str_uid = val;
121 char *str_gid = strchrnul(val, ':');
Denis Vlasenkof46be092006-10-16 19:39:37 +0000122
Denis Vlasenko44615642008-03-29 13:10:57 +0000123 if (*str_gid)
124 *str_gid++ = '\0';
125 /* Parse UID */
126 pass = getpwnam(str_uid);
127 if (pass)
128 uid = pass->pw_uid;
129 else
130 uid = strtoul(str_uid, NULL, 10);
131 /* Parse GID */
132 grp = getgrnam(str_gid);
133 if (grp)
134 gid = grp->gr_gid;
135 else
136 gid = strtoul(str_gid, NULL, 10);
137 }
138
139 /* 3rd field: mode - device permissions */
140 if (!next) /* field must exist */
141 bb_error_msg_and_die("bad line %u", lineno);
142 val = next;
143 next = next_field(val);
144 mode = strtoul(val, NULL, 8);
145
146 /* 4th field (opt): >alias */
147 if (ENABLE_FEATURE_MDEV_RENAME) {
148 if (!next)
149 break;
150 val = next;
151 next = next_field(val);
152 if (*val == '>') {
153 alias = xstrdup(val + 1);
154 }
155 }
156
157 /* The rest (opt): command to run */
158 if (!next)
159 break;
160 val = next;
161 if (ENABLE_FEATURE_MDEV_EXEC) {
162 const char *s = "@$*";
163 const char *s2 = strchr(s, *val);
164
165 if (!s2)
166 bb_error_msg_and_die("bad line %u", lineno);
167
168 /* Correlate the position in the "@$*" with the delete
169 * step so that we get the proper behavior:
170 * @cmd: run on create
171 * $cmd: run on delete
172 * *cmd: run on both
173 */
174 if ((s2 - s + 1) /*1/2/3*/ & /*1/2*/ (1 + delete)) {
175 command = xstrdup(val + 1);
176 }
177 }
178 /* end of field parsing */
179 break; /* we found matching line, stop */
Mike Frysingerc881c732007-11-19 09:04:22 +0000180 next_line:
181 free(line);
Denis Vlasenkocf26ab72008-03-27 22:45:44 +0000182 } /* end of "while line is read from /etc/mdev.conf" */
Mike Frysingerc881c732007-11-19 09:04:22 +0000183
Denis Vlasenko44615642008-03-29 13:10:57 +0000184 free(line); /* in case we used "break" to get here */
Denis Vlasenkocf26ab72008-03-27 22:45:44 +0000185 fclose(fp);
Rob Landleyb56c2852005-12-17 10:52:30 +0000186 }
Denis Vlasenkocf26ab72008-03-27 22:45:44 +0000187 end_parse:
Rob Landley70f7ef72005-12-13 08:21:33 +0000188
Denis Vlasenkocf26ab72008-03-27 22:45:44 +0000189 if (!delete && sscanf(dev_maj_min, "%u:%u", &major, &minor) == 2) {
Mike Frysingerf0044c42008-02-01 06:53:50 +0000190
191 if (ENABLE_FEATURE_MDEV_RENAME)
192 unlink(device_name);
193
Rob Landleyef10d522006-06-26 14:11:33 +0000194 if (mknod(device_name, mode | type, makedev(major, minor)) && errno != EEXIST)
Denis Vlasenkof46be092006-10-16 19:39:37 +0000195 bb_perror_msg_and_die("mknod %s", device_name);
Rob Landley70f7ef72005-12-13 08:21:33 +0000196
Denis Vlasenko4e5f82c2007-06-03 22:30:22 +0000197 if (major == root_major && minor == root_minor)
Rob Landleyef10d522006-06-26 14:11:33 +0000198 symlink(device_name, "root");
Denis Vlasenko9213a9e2006-09-17 16:28:10 +0000199
Mike Frysingerf0044c42008-02-01 06:53:50 +0000200 if (ENABLE_FEATURE_MDEV_CONF) {
Mike Frysingerc881c732007-11-19 09:04:22 +0000201 chown(device_name, uid, gid);
Mike Frysingerf0044c42008-02-01 06:53:50 +0000202
203 if (ENABLE_FEATURE_MDEV_RENAME && alias) {
204 char *dest;
205
Denis Vlasenkocae11b52008-03-29 15:11:07 +0000206 /* ">bar/": rename to bar/device_name */
207 /* ">bar[/]baz": rename to bar[/]baz */
Denis Vlasenkocf26ab72008-03-27 22:45:44 +0000208 dest = strrchr(alias, '/');
Denis Vlasenkocae11b52008-03-29 15:11:07 +0000209 if (dest) { /* ">bar/[baz]" ? */
210 *dest = '\0'; /* mkdir bar */
Mike Frysingerf0044c42008-02-01 06:53:50 +0000211 bb_make_directory(alias, 0755, FILEUTILS_RECUR);
Denis Vlasenkocae11b52008-03-29 15:11:07 +0000212 *dest = '/';
213 if (dest[1] == '\0') { /* ">bar/" => ">bar/device_name" */
214 dest = alias;
215 alias = concat_path_file(alias, device_name);
216 free(dest);
217 }
218 }
Mike Frysingerf0044c42008-02-01 06:53:50 +0000219
Denis Vlasenkocae11b52008-03-29 15:11:07 +0000220 /* recreate device_name as a symlink to moved device node */
221 if (rename(device_name, alias) == 0) {
222 symlink(alias, device_name);
223 }
Mike Frysingerf0044c42008-02-01 06:53:50 +0000224
Denis Vlasenkocae11b52008-03-29 15:11:07 +0000225 free(alias);
Mike Frysingerf0044c42008-02-01 06:53:50 +0000226 }
227 }
Rob Landleyef10d522006-06-26 14:11:33 +0000228 }
Denis Vlasenkocf26ab72008-03-27 22:45:44 +0000229
Mike Frysingerf0044c42008-02-01 06:53:50 +0000230 if (ENABLE_FEATURE_MDEV_EXEC && command) {
Denis Vlasenkocf26ab72008-03-27 22:45:44 +0000231 /* setenv will leak memory, use putenv/unsetenv/free */
Denis Vlasenkod6766c72007-06-08 16:18:15 +0000232 char *s = xasprintf("MDEV=%s", device_name);
Rob Landleyef10d522006-06-26 14:11:33 +0000233 putenv(s);
Denis Vlasenkod6766c72007-06-08 16:18:15 +0000234 if (system(command) == -1)
Denis Vlasenkocf26ab72008-03-27 22:45:44 +0000235 bb_perror_msg_and_die("can't run '%s'", command);
Denis Vlasenkod6766c72007-06-08 16:18:15 +0000236 s[4] = '\0';
237 unsetenv(s);
Rob Landleyef10d522006-06-26 14:11:33 +0000238 free(s);
239 free(command);
Rob Landleyef10d522006-06-26 14:11:33 +0000240 }
Denis Vlasenkocf26ab72008-03-27 22:45:44 +0000241
Mike Frysingerc881c732007-11-19 09:04:22 +0000242 if (delete)
Denis Vlasenkocf26ab72008-03-27 22:45:44 +0000243 unlink(device_name);
Rob Landley70f7ef72005-12-13 08:21:33 +0000244}
245
Mike Frysingerb51fd352007-06-13 09:24:50 +0000246/* File callback for /sys/ traversal */
Denis Vlasenko68404f12008-03-17 09:00:54 +0000247static int fileAction(const char *fileName,
248 struct stat *statbuf ATTRIBUTE_UNUSED,
249 void *userData,
250 int depth ATTRIBUTE_UNUSED)
Rob Landley70f7ef72005-12-13 08:21:33 +0000251{
Denis Vlasenkocf26ab72008-03-27 22:45:44 +0000252 size_t len = strlen(fileName) - 4; /* can't underflow */
Mike Frysingerb51fd352007-06-13 09:24:50 +0000253 char *scratch = userData;
Rob Landley70f7ef72005-12-13 08:21:33 +0000254
Denis Vlasenkocf26ab72008-03-27 22:45:44 +0000255 /* len check is for paranoid reasons */
256 if (strcmp(fileName + len, "/dev") || len >= PATH_MAX)
Mike Frysingerb51fd352007-06-13 09:24:50 +0000257 return FALSE;
Rob Landley70f7ef72005-12-13 08:21:33 +0000258
Mike Frysingerb51fd352007-06-13 09:24:50 +0000259 strcpy(scratch, fileName);
Denis Vlasenkocf26ab72008-03-27 22:45:44 +0000260 scratch[len] = '\0';
Mike Frysingerb51fd352007-06-13 09:24:50 +0000261 make_device(scratch, 0);
Rob Landley70f7ef72005-12-13 08:21:33 +0000262
Mike Frysingerb51fd352007-06-13 09:24:50 +0000263 return TRUE;
264}
Rob Landley70f7ef72005-12-13 08:21:33 +0000265
Mike Frysingerb51fd352007-06-13 09:24:50 +0000266/* Directory callback for /sys/ traversal */
Denis Vlasenko68404f12008-03-17 09:00:54 +0000267static int dirAction(const char *fileName ATTRIBUTE_UNUSED,
268 struct stat *statbuf ATTRIBUTE_UNUSED,
269 void *userData ATTRIBUTE_UNUSED,
270 int depth)
Mike Frysingerb51fd352007-06-13 09:24:50 +0000271{
272 return (depth >= MAX_SYSFS_DEPTH ? SKIP : TRUE);
Rob Landley70f7ef72005-12-13 08:21:33 +0000273}
274
Mike Frysingera78ef2c2007-06-13 07:34:15 +0000275/* For the full gory details, see linux/Documentation/firmware_class/README
276 *
277 * Firmware loading works like this:
278 * - kernel sets FIRMWARE env var
279 * - userspace checks /lib/firmware/$FIRMWARE
280 * - userspace waits for /sys/$DEVPATH/loading to appear
281 * - userspace writes "1" to /sys/$DEVPATH/loading
282 * - userspace copies /lib/firmware/$FIRMWARE into /sys/$DEVPATH/data
283 * - userspace writes "0" (worked) or "-1" (failed) to /sys/$DEVPATH/loading
284 * - kernel loads firmware into device
285 */
Denis Vlasenko6ca409e2007-08-12 20:58:27 +0000286static void load_firmware(const char *const firmware, const char *const sysfs_path)
Mike Frysingera78ef2c2007-06-13 07:34:15 +0000287{
288 int cnt;
289 int firmware_fd, loading_fd, data_fd;
290
Mike Frysingera78ef2c2007-06-13 07:34:15 +0000291 /* check for /lib/firmware/$FIRMWARE */
292 xchdir("/lib/firmware");
Mike Frysinger0e0639b2007-06-14 09:29:48 +0000293 firmware_fd = xopen(firmware, O_RDONLY);
Mike Frysingera78ef2c2007-06-13 07:34:15 +0000294
295 /* in case we goto out ... */
296 data_fd = -1;
297
298 /* check for /sys/$DEVPATH/loading ... give 30 seconds to appear */
299 xchdir(sysfs_path);
300 for (cnt = 0; cnt < 30; ++cnt) {
301 loading_fd = open("loading", O_WRONLY);
Denis Vlasenkocf26ab72008-03-27 22:45:44 +0000302 if (loading_fd != -1)
303 goto loading;
304 sleep(1);
Mike Frysingera78ef2c2007-06-13 07:34:15 +0000305 }
Denis Vlasenkocf26ab72008-03-27 22:45:44 +0000306 goto out;
Mike Frysingera78ef2c2007-06-13 07:34:15 +0000307
Denis Vlasenkocf26ab72008-03-27 22:45:44 +0000308 loading:
Mike Frysingera78ef2c2007-06-13 07:34:15 +0000309 /* tell kernel we're loading by `echo 1 > /sys/$DEVPATH/loading` */
Denis Vlasenkocf26ab72008-03-27 22:45:44 +0000310 if (full_write(loading_fd, "1", 1) != 1)
Mike Frysingera78ef2c2007-06-13 07:34:15 +0000311 goto out;
312
313 /* load firmware by `cat /lib/firmware/$FIRMWARE > /sys/$DEVPATH/data */
314 data_fd = open("data", O_WRONLY);
315 if (data_fd == -1)
316 goto out;
317 cnt = bb_copyfd_eof(firmware_fd, data_fd);
318
319 /* tell kernel result by `echo [0|-1] > /sys/$DEVPATH/loading` */
320 if (cnt > 0)
Denis Vlasenkocf26ab72008-03-27 22:45:44 +0000321 full_write(loading_fd, "0", 1);
Mike Frysingera78ef2c2007-06-13 07:34:15 +0000322 else
Denis Vlasenkocf26ab72008-03-27 22:45:44 +0000323 full_write(loading_fd, "-1", 2);
Mike Frysingera78ef2c2007-06-13 07:34:15 +0000324
325 out:
326 if (ENABLE_FEATURE_CLEAN_UP) {
327 close(firmware_fd);
328 close(loading_fd);
329 close(data_fd);
330 }
331}
332
Denis Vlasenko9b49a5e2007-10-11 10:05:36 +0000333int mdev_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
Bernhard Reutner-Fischerfebe3c42007-04-04 20:52:03 +0000334int mdev_main(int argc, char **argv)
Rob Landley70f7ef72005-12-13 08:21:33 +0000335{
Rob Landley29e08ff2006-01-12 06:13:50 +0000336 char *action;
337 char *env_path;
Denis Vlasenkocf26ab72008-03-27 22:45:44 +0000338 RESERVE_CONFIG_BUFFER(temp, PATH_MAX + SCRATCH_SIZE);
Rob Landley29e08ff2006-01-12 06:13:50 +0000339
Denis Vlasenko4e5f82c2007-06-03 22:30:22 +0000340 xchdir("/dev");
Rob Landley15fe2e12006-05-08 02:53:23 +0000341
Denis Vlasenkocf26ab72008-03-27 22:45:44 +0000342 if (argc == 2 && !strcmp(argv[1], "-s")) {
Mike Frysingerc881c732007-11-19 09:04:22 +0000343 /* Scan:
344 * mdev -s
345 */
Rob Landleya7e3d052006-02-21 06:11:13 +0000346 struct stat st;
347
Denis Vlasenkof46be092006-10-16 19:39:37 +0000348 xstat("/", &st);
Denis Vlasenko4e5f82c2007-06-03 22:30:22 +0000349 root_major = major(st.st_dev);
350 root_minor = minor(st.st_dev);
Mike Frysingerb51fd352007-06-13 09:24:50 +0000351
352 recursive_action("/sys/block",
353 ACTION_RECURSE | ACTION_FOLLOWLINKS,
354 fileAction, dirAction, temp, 0);
355
356 recursive_action("/sys/class",
357 ACTION_RECURSE | ACTION_FOLLOWLINKS,
358 fileAction, dirAction, temp, 0);
Rob Landley29e08ff2006-01-12 06:13:50 +0000359
Rob Landley29e08ff2006-01-12 06:13:50 +0000360 } else {
Mike Frysingerc881c732007-11-19 09:04:22 +0000361 /* Hotplug:
362 * env ACTION=... DEVPATH=... mdev
363 * ACTION can be "add" or "remove"
364 * DEVPATH is like "/block/sda" or "/class/input/mice"
365 */
Rob Landley29e08ff2006-01-12 06:13:50 +0000366 action = getenv("ACTION");
367 env_path = getenv("DEVPATH");
Denis Vlasenko92758142006-10-03 19:56:34 +0000368 if (!action || !env_path)
Mike Frysingera421ba82006-02-03 00:25:37 +0000369 bb_show_usage();
Tim Rikerc1ef7bd2006-01-25 00:08:53 +0000370
Denis Vlasenkocf26ab72008-03-27 22:45:44 +0000371 snprintf(temp, PATH_MAX, "/sys%s", env_path);
Mike Frysingera78ef2c2007-06-13 07:34:15 +0000372 if (!strcmp(action, "remove"))
373 make_device(temp, 1);
374 else if (!strcmp(action, "add")) {
375 make_device(temp, 0);
376
Denis Vlasenkocf26ab72008-03-27 22:45:44 +0000377 if (ENABLE_FEATURE_MDEV_LOAD_FIRMWARE) {
378 char *fw = getenv("FIRMWARE");
379 if (fw)
380 load_firmware(fw, temp);
381 }
Mike Frysingera78ef2c2007-06-13 07:34:15 +0000382 }
Rob Landley29e08ff2006-01-12 06:13:50 +0000383 }
384
Mike Frysingerc881c732007-11-19 09:04:22 +0000385 if (ENABLE_FEATURE_CLEAN_UP)
386 RELEASE_CONFIG_BUFFER(temp);
387
Rob Landley70f7ef72005-12-13 08:21:33 +0000388 return 0;
389}