Smbd Samba Failing


u9i

Call me Uni
Joined
Jun 27, 2008
Messages
761
Age
47
Location
Faroe Islands
Website
riotdigital.com
Hi,

i've been trying to get the samba daemon running, but it seems to fail because it does not have write access to the file system.

Console output:
Code:
root@wiz:/# smbd -i 
  smbd version 2.2.5 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2002
  Failed to open /usr/local/samba/private/secrets.tdb
  load_client_codepage: filename /usr/local/samba/lib/codepages/codepage.850 does not exist.
  load_unicode_map: filename /usr/local/samba/lib/codepages/unicode_map.850 does not exist.
  load_unicode_map: filename /usr/local/samba/lib/codepages/unicode_map.ISO8859-1 does not exist.
  ERROR: can't open /usr/local/samba/var/locks/smbd.pid: Error was Read-only file system

So i figured i would make a symbolic link to the /var directory somewhere, so that /usr/local/samba/var/locks/smbd.pid would be writable. Of course, i cannot make this link because the filesystem is readonly. I tried remounting it as read/write using:

Code:
root@wiz:/# mount -o remount,rw /dev/root /

But this doesn't seem to give me write access to the filesystem either. Where/when does it get mounted as readonly in the first place? The fstab file and mtab files contain only:

/dev/root / ext2 defaults 0 0

and

/dev/mmcblk0p1 /mnt/sd vfat iocharset=utf8,noatime,async 0 0

respectively.

Can anyone help me with this? How can i remount the filesystem as writable? Or, the simpler solution, is there a way of getting smbd to use the /var directory instead of /usr/local/samba/var?

Thanks
Uni
 
Update: I made some progress, but now i hit a brick wall. I have made a copy of the config file to the sd card, and start smbd with that file. In the config file i can set "pid directory" (and lock directory) to use the /var folder, however, i now get this error:

Code:
pdb_generate_sam_sid: Failed to store generated machine SID.
ERROR: Samba cannot create a SAM SID

Reading up a little i have found that i need to change the "private dir" setting, however smbd does not recognize this parameter. I suspect it is because it is an old version. The private directory is infact part of the ./configure script and so is compiled into the executable, so i cannot change it.

The only solution i see now is being able to make the filesystem writable...

Anyone?

:)
 
Haven't played with samba myselve, but if it really is cooked into the executable, and the dir is a string you should be able to modify the directory using an hex editor and first finding and then changing the path and replacing the file...

Will try it out sometime when i get sometime
 
Brilliant idea. I'll try. It didn't even occur to me. Is it correct however, that i must not change the size of the file, right? So i can only make a shorter path than the already compiled-in one and pad it with NULLs?

/Uni

EDIT: Oh yes, that did the trick. I am now browsing the sd card through windows share. Now, i just need to fix the write-permissions, and I can upload the modified daemon and a script to start it :)

Thanks joyrider
 
u9i said:
Brilliant idea. I'll try. It didn't even occur to me. Is it correct however, that i must not change the size of the file, right? So i can only make a shorter path than the already compiled-in one and pad it with NULLs?

/Uni

EDIT: Oh yes, that did the trick. I am now browsing the sd card through windows share. Now, i just need to fix the write-permissions, and I can upload the modified daemon and a script to start it :)

Thanks joyrider

nice to hear it worked :) Any ETA on the release, it might come in handy for me as well, no need to upload files anymore to the caanoo i'll just run em straight from the samba share... :)

About the length of the file, if you wanna do a quick *hack*, yes you can not exceed the current length of the path, It must be equal length or lower right padded with 00's yes. It should be possible to make it bigger also but that's not as simple as what you just did, it probably contains some CRC checks somewhere or some length info of the string somewhere it could be that the length is stored just before the string. I have no idea how a PE file is structured but if the length of the string is placed before the actuall string, you could try to change that as well although there might be another section that contains the length of the whole string section so that one might have to be edited as well then ... I think a linux executable file's structure is quite documented so can't be too hard but might take more time :)

It's a nice trick that works on most executables, even on windows ;) Some game's contain level passwords or level select passwords as well (i made the same mistake once with my PuzzleLand game :)) If you don't want this to happen you can't use constant strings in your sources (like don't use Password = "hello world"; but use some encryption or XOR way to store them so they are not that easily readable ;)) can't be too hard to create an encryption / decryption scheme (which i did in the sookoban game, it's kinda evil as well, if it detects you messed with progress file it'll reset your game status to the initial status :x)
 
Last edited by a moderator:
Hehe i think you missunderstood. The server is running on the caanoo, so you actually still have to copy the files over. But it can now be done over network. I have uploaded it. Check the news section.

But your idea is better. Mount my dev directory on the caanoo, so i can run the game directly on the caanoo across the network. That way i only compile on my desktop, and then click run directly from caanoo. I'm gonna look into that :)
 
u9i said:
Hehe i think you missunderstood. The server is running on the caanoo, so you actually still have to copy the files over. But it can now be done over network. I have uploaded it. Check the news section.

But your idea is better. Mount my dev directory on the caanoo, so i can run the game directly on the caanoo across the network. That way i only compile on my desktop, and then click run directly from caanoo. I'm gonna look into that :)

Well i'd prefer that way as well, but it's a step forward to have the samba deamon running on the caanoo :) if everything is in place i think we only need smbfs & smbclient to get it going (not sure if it needs extra kernel modules, cause if it does we need the kernel sources and i don't know if they have been released yet) ... it has been done on the gp2x in the old days (don't know about the wizz), and i used that quite a lot :)
 
Last edited by a moderator:
Back
Top