Hello everyone, First I would like to thank Andrew, Luke and others working on Samba for this great product! We use it on our server for more that 2 years now with no problem. One little bug I found, but it is not very important, since there is a workaround. If you specify a magic script on one of the shares (it is in our homes section now), then the magic script does not seem to run, if you create (copy) it in the root directory of that share, but it works just fine if you put it into any of the subdirectories of that share. We depend on magic scripts, because our librarian does not know Unix, but still needs to update sometimes the library databases on our WWW server, and I do not want to give her explicit file access to that directory (i.e. a share, where she could write). So I created a small script that does all the works for her on the Unix machine, and it is run using the magic script. All this I experienced with Samba 1.9.17p2. With best regards, Geza ************************************************************************* * Name: Geza Makay * * Institute: Jozsef Attila University of Szeged * * Mail: Bolyai Institute, Aradi vertanuk tere 1. * * H-6720, Szeged, Hungary * * Tel: (62) 454-091 (Hungary's code: 36) * * Fax/Message: (62) 326-246 (Hungary's code: 36) * * E-mail: makayg@math.u-szeged.hu * * World Wide Web: http://www.math.u-szeged.hu/ * ************************************************************************* * "To err is human, but to really mess things up you need a computer." * *************************************************************************
Geza Makay <makayg@math.u-szeged.hu> writes:> Hello everyone, > > First I would like to thank Andrew, Luke and others working on Samba for > this great product! We use it on our server for more that 2 years now with > no problem. > One little bug I found, but it is not very important, since there is a > workaround. If you specify a magic script on one of the shares (it is in > our homes section now), then the magic script does not seem to run, if you > create (copy) it in the root directory of that share, but it works just > fine if you put it into any of the subdirectories of that share. We depend > on magic scripts, because our librarian does not know Unix, but still needs > to update sometimes the library databases on our WWW server, and I do not > want to give her explicit file access to that directory (i.e. a share, > where she could write). So I created a small script that does all the works > for her on the Unix machine, and it is run using the magic script. All this > I experienced with Samba 1.9.17p2.[ ... ] The reason for this behaviour can be found in the function check_magic in server.c which is responsible for finding out if a filename is the name of a magic script and if yes to execute the script. The filename of the script is cleaned from any leading slashes and dots as a name relative to the shared directory. If it matches the magic script parameter it is executed using "/bin/sh" with the current directory set to the share's root. If you do not have "." in your path, it cannot be found, but a file in a subdirectory, like "subdir/magic", can be. I sent a patch correcting this (it simply prepends "./" to the magic script file before execution) to samba-bugs, but unfortunately that coincided with the emergence of the password buffer overrun bug which was of course much more urgent. The fix for it also interfered with my patch (there was a strcpy at work there, Andrew replaced each strcpy with another function which checks for overruns), so I guess it got lost in the noise. -- Joerg Lenneis email: lenneis@wu-wien.ac.at
At 10:50 PM 10/30/97 +0100, you wrote:>> One little bug I found, but it is not very important, since there is a >> workaround. If you specify a magic script on one of the shares (it is in >> our homes section now), then the magic script does not seem to run, if you >> create (copy) it in the root directory of that share, but it works just >> fine if you put it into any of the subdirectories of that share. We depend >> on magic scripts, because our librarian does not know Unix, but still needs >> to update sometimes the library databases on our WWW server, and I do not >> want to give her explicit file access to that directory (i.e. a share, >> where she could write). So I created a small script that does all the works >> for her on the Unix machine, and it is run using the magic script. All this >> I experienced with Samba 1.9.17p2. > >The reason for this behaviour can be found in the function check_magic >in server.c which is responsible for finding out if a filename is the >name of a magic script and if yes to execute the script. The filename >of the script is cleaned from any leading slashes and dots as a >name relative to the shared directory. If it matches the magic script >parameter it is executed using "/bin/sh" with the current directory >set to the share's root. If you do not have "." in your path, it >cannot be found, but a file in a subdirectory, like "subdir/magic", >can be.I do have a '.' in my path, and Samba (even with large log level) does not say that it could not start the script. I think it is not quite unresonable, if I assume, that when Samba (or any program) wants to start another, and it knows the exact location of the other program, then it would start it with the full path of the other program rather than depending on path or other settings of the host machine. At least that is what I would have done. But again, it is not very important, since there is a workaround. Geza ************************************************************************* * Name: Geza Makay * * Institute: Jozsef Attila University of Szeged * * Mail: Bolyai Institute, Aradi vertanuk tere 1. * * H-6720, Szeged, Hungary * * Tel: (62) 454-091 (Hungary's code: 36) * * Fax/Message: (62) 326-246 (Hungary's code: 36) * * E-mail: makayg@math.u-szeged.hu * * World Wide Web: http://www.math.u-szeged.hu/ * ************************************************************************* * "To err is human, but to really mess things up you need a computer." * *************************************************************************