Uli Luckas
2002-Aug-13 08:02 UTC
[Samba] AW: Unable to open configuration file "/etc/smb.conf" (or whereve r i specify)
Hi, it looks like you have something really messed up on your system. The size of the file is 1243 bytes (from strace) but 0 bytes are being read. If you had no permission to read the strace would have looked like this: open("/etc/samba/smb.conf", O_RDONLY|O_LARGEFILE) = -1 EACCES (Permission denied) A quick look at the source code reveals: /etc/samba/smb.conf is opened in file_load (lib/util_file.c) which is being called from OpenConfFile (param/params.c). Then fd_load tries to read the file into memory. "Unable to open configuration file" is only being printed if file_load returns NULL which is being called if fd_load returns NULL which it does as the read returns 0 instead of 1243 (strace). This code is not verry complex but I really can't see how this can fail... May be your filesystem is broken. Can you "strace cat /etc/samba/smb.conf" and compare the open fstat and read calls? char *fd_load(int fd, size_t *size) { SMB_STRUCT_STAT sbuf; char *p; if (sys_fstat(fd, &sbuf) != 0) return NULL; p = (char *)malloc(sbuf.st_size+1); if (!p) return NULL; if (read(fd, p, sbuf.st_size) != sbuf.st_size) { SAFE_FREE(p); return NULL; } p[sbuf.st_size] = 0; if (size) *size = sbuf.st_size; return p; } Uli> -----Urspr?ngliche Nachricht----- > Von: nero one [mailto:nero_oner@yahoo.com] > Gesendet: Dienstag, 13. August 2002 18:14 > An: Uli Luckas > Cc: samba@lists.samba.org > Betreff: Unable to open configuration file "/etc/smb.conf" > (or wherever > i specify) > > > --- Uli Luckas <Uli.Luckas@abakusag.de> wrote: > > Try these two: > > bash> which testparam > > should tell you which testparam is being started. Is it > where you expect it > > to be? > > bash> strace /full/path/testparam > > Gives you information on all system calls called from > within testparam. It > > will give quite a bit of output and somewhere near the end > you will find > > something like: > > open("/usr/lib/smb.conf", O_RDONLY|O_LARGEFILE) = ... > > > > This would give you a hint to what testparam is trying to > open and why it > > fails. > > Of course you need strace to be installed and you need to be root. > > Good idea. Here's the result of the strace. I can't really > figure out why it borks. > > "open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such > file or directory)" > It seems to look for this file in /etc . . only I don't have > any mention of any ld.so.preload* on > my system. > > write(1, "Load smb config files from /etc/"..., 47Load smb > config files from /etc/samba/smb.conf > ) = 47 > stat64("/etc/samba/smb.conf", {st_mode=S_IFREG|0644, > st_size=1243, ...}) = 0 > open("/etc/samba/smb.conf", O_RDONLY|O_LARGEFILE) = 3 > fstat64(3, {st_mode=S_IFREG|0644, st_size=1243, ...}) = 0 > read(3, "", 0) = 0 > close(3) = 0 > write(1, "params.c:OpenConfFile() - Unable"..., > 83params.c:OpenConfFile() - Unable to open > configuration file "/etc/samba/smb.conf": > ) = 83 > write(1, "\tSuccess\n", 9 Success > ) = 9 > brk(0x80c0000) = 0x80c0000 > write(1, "Error loading services.\n", 24Error loading services. > ) = 24 > munmap(0x129000, 4096) = 0 > _exit(1) = ? > > Would it be broken due to the "..." as opposed to specifying > /etc/samba/smb.conf? > Seems that the fstat isn't returning with anything, and the > read is expecting the fstat to do so? > > If anyone can help shed light on this - it'd be much > appreciated. If there's anything else I can > do to further help in resolving the problem, please let me > know. We have already determined in > prior emails that the configuration file is operational on > other systems. Once again, the > description of the issue is the following. The full result > of the strace follows: > > [root][/etc/samba]: pwd && ls -all && testparm > /etc/samba > total 12 > drwxr-xr-x 2 root root 4096 Aug 12 19:38 . > drwxr-xr-x 32 root root 4096 Aug 12 19:33 .. > -rw-r--r-- 1 root root 1243 Aug 12 19:38 smb.conf > Load smb config files from /etc/samba/smb.conf > params.c:OpenConfFile() - Unable to open configuration file > "/etc/samba/smb.conf": > Success > Error loading services. > > [root][/etc/samba]: testparm /etc/samba/smb.conf > Load smb config files from /etc/samba/smb.conf > params.c:OpenConfFile() - Unable to open configuration file > "/etc/samba/smb.conf": > Success > Error loading services. > [root][/etc/samba]: > > [root][~]: strace /usr/bin/testparm > execve("/usr/bin/testparm", ["/usr/bin/testparm"], [/* 26 > vars */]) = 0 > uname({sys="Linux", node="maddog1", ...}) = 0 > brk(0) = 0x80be148 > open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such > file or directory) > open("/etc/ld.so.cache", O_RDONLY) = 3 > fstat64(3, {st_mode=S_IFREG|0644, st_size=10769, ...}) = 0 > old_mmap(NULL, 10769, PROT_READ, MAP_PRIVATE, 3, 0) = 0x129000 > close(3) = 0 > open("/lib/libdl.so.2", O_RDONLY) = 3 > read(3, > "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\340!\0"..., > 1024) = 1024 > fstat64(3, {st_mode=S_IFREG|0755, st_size=66114, ...}) = 0 > old_mmap(NULL, 14072, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) > = 0x12c000 > mprotect(0x12f000, 1784, PROT_NONE) = 0 > old_mmap(0x12f000, 4096, PROT_READ|PROT_WRITE, > MAP_PRIVATE|MAP_FIXED, 3, 0x2000) = 0x12f000 > close(3) = 0 > open("/lib/libnsl.so.1", O_RDONLY) = 3 > read(3, > "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0pB\0\000"..., > 1024) = 1024 > fstat64(3, {st_mode=S_IFREG|0755, st_size=390111, ...}) = 0 > old_mmap(NULL, 98304, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) > = 0x130000 > mprotect(0x145000, 12288, PROT_NONE) = 0 > old_mmap(0x145000, 4096, PROT_READ|PROT_WRITE, > MAP_PRIVATE|MAP_FIXED, 3, 0x14000) = 0x145000 > old_mmap(0x146000, 8192, PROT_READ|PROT_WRITE, > MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) > 0x146000 > close(3) = 0 > open("/lib/libcrypt.so.1", O_RDONLY) = 3 > read(3, > "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0P\22\0\000"... > , 1024) = 1024 > fstat64(3, {st_mode=S_IFREG|0755, st_size=78762, ...}) = 0 > old_mmap(NULL, 187356, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, > 0) = 0x148000 > mprotect(0x14e000, 162780, PROT_NONE) = 0 > old_mmap(0x14e000, 4096, PROT_READ|PROT_WRITE, > MAP_PRIVATE|MAP_FIXED, 3, 0x5000) = 0x14e000 > old_mmap(0x14f000, 158684, PROT_READ|PROT_WRITE, > MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) > 0x14f000 > close(3) = 0 > open("/usr/lib/libpopt.so.0", O_RDONLY) = 3 > read(3, > "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\300\23"..., > 1024) = 1024 > fstat64(3, {st_mode=S_IFREG|0755, st_size=32507, ...}) = 0 > old_mmap(NULL, 29820, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) > = 0x176000 > mprotect(0x17d000, 1148, PROT_NONE) = 0 > old_mmap(0x17d000, 4096, PROT_READ|PROT_WRITE, > MAP_PRIVATE|MAP_FIXED, 3, 0x6000) = 0x17d000 > close(3) = 0 > open("/lib/libc.so.6", O_RDONLY) = 3 > read(3, > "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\314\316"..., > 1024) = 1024 > fstat64(3, {st_mode=S_IFREG|0755, st_size=5077798, ...}) = 0 > old_mmap(NULL, 1351940, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, > 0) = 0x17e000 > mprotect(0x2be000, 41220, PROT_NONE) = 0 > old_mmap(0x2be000, 28672, PROT_READ|PROT_WRITE, > MAP_PRIVATE|MAP_FIXED, 3, 0x13f000) = 0x2be000 > old_mmap(0x2c5000, 12548, PROT_READ|PROT_WRITE, > MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) > 0x2c5000 > close(3) = 0 > open("/lib/libc.so.6", O_RDONLY) = 3 > read(3, > "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\314\316"..., > 1024) = 1024 > fstat64(3, {st_mode=S_IFREG|0755, st_size=5077798, ...}) = 0 > close(3) = 0 > open("/lib/libc.so.6", O_RDONLY) = 3 > read(3, > "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\314\316"..., > 1024) = 1024 > fstat64(3, {st_mode=S_IFREG|0755, st_size=5077798, ...}) = 0 > close(3) = 0 > open("/lib/libc.so.6", O_RDONLY) = 3 > read(3, > "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\314\316"..., > 1024) = 1024 > fstat64(3, {st_mode=S_IFREG|0755, st_size=5077798, ...}) = 0 > close(3) = 0 > open("/lib/libc.so.6", O_RDONLY) = 3 > read(3, > "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\314\316"..., > 1024) = 1024 > fstat64(3, {st_mode=S_IFREG|0755, st_size=5077798, ...}) = 0 > close(3) = 0 > old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, > MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2c9000 > mprotect(0x17e000, 1310720, PROT_READ|PROT_WRITE) = 0 > mprotect(0x17e000, 1310720, PROT_READ|PROT_EXEC) = 0 > munmap(0x129000, 10769) = 0 > getpid() = 23563 > time(NULL) = 1029254406 > brk(0) = 0x80be148 > brk(0x80be170) = 0x80be170 > brk(0x80bf000) = 0x80bf000 > open("/etc/localtime", O_RDONLY) = 3 > fstat64(3, {st_mode=S_IFREG|0644, st_size=1218, ...}) = 0 > old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, > MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x129000 > read(3, > "TZif\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2\0\0\0\2\0"..., > 4096) = 1218 > close(3) = 0 > munmap(0x129000, 4096) = 0 > gettimeofday({1029254406, 741487}, NULL) = 0 > fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0 > old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, > MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x129000 > ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0 > write(1, "Load smb config files from /etc/"..., 47Load smb > config files from /etc/samba/smb.conf > ) = 47 > stat64("/etc/samba/smb.conf", {st_mode=S_IFREG|0644, > st_size=1243, ...}) = 0 > open("/etc/samba/smb.conf", O_RDONLY|O_LARGEFILE) = 3 > fstat64(3, {st_mode=S_IFREG|0644, st_size=1243, ...}) = 0 > read(3, "", 0) = 0 > close(3) = 0 > write(1, "params.c:OpenConfFile() - Unable"..., > 83params.c:OpenConfFile() - Unable to open > configuration file "/etc/samba/smb.conf": > ) = 83 > write(1, "\tSuccess\n", 9 Success > ) = 9 > brk(0x80c0000) = 0x80c0000 > write(1, "Error loading services.\n", 24Error loading services. > ) = 24 > munmap(0x129000, 4096) = 0 > _exit(1) = ? > [root][~]: > > > __________________________________________________ > Do You Yahoo!? > HotJobs - Search Thousands of New Jobs > http://www.hotjobs.com >
nero one
2002-Aug-13 08:34 UTC
[Samba] Re: AW: Unable to open configuration file "/etc/smb.conf" (or whereve r i specify)
Hi Uli, I'm not really sure what i'm looking for here, but here's the result of the cat w/strace. Seems its still return with result == 0? open("smb.conf", O_RDONLY|O_LARGEFILE) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=1243, ...}) = 0 brk(0x804e000) = 0x804e000 [root][~]: cd /etc/samba/ [root][/etc/samba]: strace cat smb.conf execve("/bin/cat", ["cat", "smb.conf"], [/* 27 vars */]) = 0 uname({sys="Linux", node="maddog1", ...}) = 0 brk(0) = 0x804b49c open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=10769, ...}) = 0 old_mmap(NULL, 10769, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40019000 close(3) = 0 open("/lib/librt.so.1", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`#\0\000"..., 1024) = 1024 fstat64(3, {st_mode=S_IFREG|0755, st_size=154599, ...}) = 0 old_mmap(NULL, 74900, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x4001c000 mprotect(0x40023000, 46228, PROT_NONE) = 0 old_mmap(0x40023000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x6000) = 0x40023000 old_mmap(0x40024000, 42132, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) 0x40024000 close(3) = 0 open("/lib/libc.so.6", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\314\316"..., 1024) = 1024 fstat64(3, {st_mode=S_IFREG|0755, st_size=5077798, ...}) = 0 old_mmap(NULL, 1351940, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x4002f000 mprotect(0x4016f000, 41220, PROT_NONE) = 0 old_mmap(0x4016f000, 28672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x13f000) = 0x4016f000 old_mmap(0x40176000, 12548, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) 0x40176000 close(3) = 0 open("/lib/libc.so.6", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\314\316"..., 1024) = 1024 fstat64(3, {st_mode=S_IFREG|0755, st_size=5077798, ...}) = 0 close(3) = 0 open("/lib/libpthread.so.0", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\360Q\0"..., 1024) = 1024 fstat64(3, {st_mode=S_IFREG|0755, st_size=482043, ...}) = 0 old_mmap(NULL, 105564, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x4017a000 mprotect(0x4018c000, 31836, PROT_NONE) = 0 old_mmap(0x4018c000, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x11000) = 0x4018c000 close(3) = 0 open("/lib/libc.so.6", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\314\316"..., 1024) = 1024 fstat64(3, {st_mode=S_IFREG|0755, st_size=5077798, ...}) = 0 close(3) = 0 mprotect(0x4002f000, 1310720, PROT_READ|PROT_WRITE) = 0 mprotect(0x4002f000, 1310720, PROT_READ|PROT_EXEC) = 0 munmap(0x40019000, 10769) = 0 getpid() = 735 getpid() = 735 rt_sigaction(SIGRT_0, {0x40185958, [], 0x4000000}, NULL, 8) = 0 rt_sigaction(SIGRT_1, {0x40184740, [], 0x4000000}, NULL, 8) = 0 rt_sigaction(SIGRT_2, {0x40185a30, [], 0x4000000}, NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, [RT_0], NULL, 8) = 0 _sysctl({{CTL_KERN, KERN_VERSION}, 2, 0xbffff68c, 31, (nil), 0}) = 0 brk(0) = 0x804b49c brk(0x804b4cc) = 0x804b4cc brk(0x804c000) = 0x804c000 open("/usr/share/locale/locale.alias", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=2567, ...}) = 0 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40019000 read(3, "# Locale name alias data base.\n#"..., 4096) = 2567 brk(0x804d000) = 0x804d000 read(3, "", 4096) = 0 close(3) = 0 munmap(0x40019000, 4096) = 0 open("/usr/lib/locale/en_US/LC_IDENTIFICATION", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=244, ...}) = 0 old_mmap(NULL, 244, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40019000 close(3) = 0 open("/usr/lib/locale/en_US/LC_MEASUREMENT", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=13, ...}) = 0 old_mmap(NULL, 13, PROT_READ, MAP_PRIVATE, 3, 0) = 0x4001a000 close(3) = 0 open("/usr/lib/locale/en_US/LC_TELEPHONE", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=49, ...}) = 0 old_mmap(NULL, 49, PROT_READ, MAP_PRIVATE, 3, 0) = 0x4001b000 close(3) = 0 open("/usr/lib/locale/en_US/LC_ADDRESS", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=145, ...}) = 0 old_mmap(NULL, 145, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40194000 close(3) = 0 open("/usr/lib/locale/en_US/LC_NAME", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=67, ...}) = 0 old_mmap(NULL, 67, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40195000 close(3) = 0 open("/usr/lib/locale/en_US/LC_PAPER", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=24, ...}) = 0 old_mmap(NULL, 24, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40196000 close(3) = 0 open("/usr/lib/locale/en_US/LC_MESSAGES", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 close(3) = 0 open("/usr/lib/locale/en_US/LC_MESSAGES/SYS_LC_MESSAGES", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=42, ...}) = 0 old_mmap(NULL, 42, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40197000 close(3) = 0 open("/usr/lib/locale/en_US/LC_MONETARY", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=276, ...}) = 0 old_mmap(NULL, 276, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40198000 close(3) = 0 open("/usr/lib/locale/en_US/LC_COLLATE", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=21484, ...}) = 0 old_mmap(NULL, 21484, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40199000 close(3) = 0 open("/usr/lib/locale/en_US/LC_TIME", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=2441, ...}) = 0 old_mmap(NULL, 2441, PROT_READ, MAP_PRIVATE, 3, 0) = 0x4019f000 close(3) = 0 open("/usr/lib/locale/en_US/LC_NUMERIC", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=44, ...}) = 0 old_mmap(NULL, 44, PROT_READ, MAP_PRIVATE, 3, 0) = 0x401a0000 close(3) = 0 open("/usr/lib/locale/en_US/LC_CTYPE", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=104804, ...}) = 0 old_mmap(NULL, 104804, PROT_READ, MAP_PRIVATE, 3, 0) = 0x401a1000 close(3) = 0 fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0 open("smb.conf", O_RDONLY|O_LARGEFILE) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=1243, ...}) = 0 brk(0x804e000) = 0x804e000 read(3, "[global]\n\n workgroup = WORKGRP"..., 512) = 512 write(1, "[global]\n\n workgroup = WORKGRP"..., 512[global] workgroup = WORKGRP server string = SerVer hosts allow = 10.0.0. 0. load printers = yes printcap name = /etc/printcap printing = lprng max log size = 500 security = user socket options = TCP_NODELAY interfaces = 10.0.0.0/8 local master = yes os level = 33 domain master = yes preferred master = yes domain logons = yes dns proxy = no [homes] comment = Home Directories browseable = no writable = yes [printers] comment = Network Printers ) = 512 read(3, " path = /var/spool/samba\n br"..., 512) = 512 write(1, " path = /var/spool/samba\n br"..., 512 path = /var/spool/samba browseable = no guest ok = no writable = no printable = yes [myshare] comment = Common Storage path = /home/common valid users = user1 user2 user3 user4 public = yes writable = yes printable = no create mask = 0775 directory mask = 0775 [apache] comment = Apache tree guest account = apache path = /chroot/httpd/ only guest = yes public = yes writable = yes printable = no create mask = 0775 directory mask = 0) = 512 read(3, "775\n\n[clients]\n comment = Cli"..., 512) = 219 write(1, "775\n\n[clients]\n comment = Cli"..., 219775 [clients] comment = Client trees guest account = apache path = /home/clients only guest = yes public = yes writable = yes printable = no create mask = 0775 directory mask = 0775 ) = 219 read(3, "", 512) = 0 close(3) = 0 close(1) = 0 _exit(0) = ? [root][/etc/samba]: --- Uli Luckas <Uli.Luckas@abakusag.de> wrote:> Hi, > it looks like you have something really messed up on your system. > The size of the file is 1243 bytes (from strace) but 0 bytes are being read. > If you had no permission to read the strace would have looked like this: > open("/etc/samba/smb.conf", O_RDONLY|O_LARGEFILE) = -1 EACCES (Permission > denied) > > A quick look at the source code reveals: > /etc/samba/smb.conf is opened in file_load (lib/util_file.c) which is being > called from OpenConfFile (param/params.c). Then fd_load tries to read the > file into memory. > "Unable to open configuration file" is only being printed if file_load > returns NULL which is being called if fd_load returns NULL which it does as > the read returns 0 instead of 1243 (strace). > > This code is not verry complex but I really can't see how this can fail... > May be your filesystem is broken. Can you "strace cat /etc/samba/smb.conf" > and compare the open fstat and read calls? > > char *fd_load(int fd, size_t *size) > { > SMB_STRUCT_STAT sbuf; > char *p; > > if (sys_fstat(fd, &sbuf) != 0) return NULL; > > p = (char *)malloc(sbuf.st_size+1); > if (!p) return NULL; > > if (read(fd, p, sbuf.st_size) != sbuf.st_size) { > SAFE_FREE(p); > return NULL; > } > p[sbuf.st_size] = 0; > > if (size) *size = sbuf.st_size; > > return p; > } > > Uli__________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com