Problem: DOSEMU ignores Linux user file access settings
Hallo!
I have big problem with file access privilegues. I don't know how to
solve it. Or how to force DOSEMU to respect Linux file access settings?
DOSEMU uses one strict policy when creating new file from inside
emulated environment: It creates new file with 600 attrib mask and user-only gid/uid. DOSEMU fully IGNORES both bash.profile setting, and folder's SetUid/SetGid setting!! And this is the reason of my big problem.
I have DOSEMU 1.2rc1 installed on the one machine (server) and
second computer is connected as thin client, so the DOSEMU runs only locally on the server, on local drive, local directory on Linux filesystem to avoid any network-drive related problems (elegant solution, there isn't difference between "tru local" and "remote X" session -both are in fact local on server).
I need two users to run simultaneously one copy of Clipper database
program. If I manually add both users to the same workgroup (name it 'ambul') and set group attribute of the files and folders they should have access, and set correct attributes (770), the program runs smoothly (expecting the sometimes slow feeling because of that stupid "what's the time?" loop typical for Clipper). As long as they work with only existing files with correct attributes set, it works perfectly.
But once the program creates new file under one user's session (what
sometimes happens during some actions such as print or so), the program in second user's session claims error opening the file and crashes. The same when reindexing the database (it creates new .ntx files with the crippled privilegues too). It dosen't matter, which one is the "first" user. The program under the first session creates a new file and DOSEMU gives the file 600 (rw user-only) permissions, no matter that bash.profile says that user's new files must be created with 770 mask (rwxrwx---), and the folder has SetGid attribute set, so that all created files should have Group attribute set to the same value as the parent directory has.
My first approach was to search for some setting in .dosemurc to do
this, but I cannot find such setting that would force DOSEMU to respect Linux file access rights management when creating new file.
Thent I thought that logging the both sessions under the same
username could solve the problem. Not good solution, but better than nothing. This cannot work, however. Both users want to print to their printers, and the printers are defined thru .dosemurc files in their home directories. Once I run both users under the same login name, they both use the same .dosemurc settings file and thus BOTH PRINT ON THE SAME NETWORK PRINTER! Running one of DOSEMU session from other home directory dosen't help either, because DOSEMU takes .dosemurc strictly from user's home directory and this way the printing is directed to only one printer.
Please hlep. How to force DOSEMU to respect Linux file access
management?
Sincerely
Peter
Quoted 1 line
Both users want to print to their printers, and the printers are defined thru .dosemurc files in their home directories. Once I run both users under the same login name, they both use the same .dosemurc settings file and thus BOTH PRINT ON THE SAME NETWORK PRINTER! Running one of DOSEMU session from other home directory dosen't help either, because DOSEMU takes .dosemurc strictly from user's home directory and this way the printing is directed to only one printer.
See the -f parameter for dosemu.bin to use a different .dosemurc, and start each dosemu client with a different .dosemurc, which contains only a line like $_printer = "rlp_1"
Sincerely,
Zsolt
Quoted 4 lines · Mgr. Peter Tuharsky
DOSEMU uses one strict policy when creating new file from inside
emulated environment: It creates new file with 600 attrib mask and user-only gid/uid. DOSEMU fully IGNORES both bash.profile setting, and folder's SetUid/SetGid setting!! And this is the reason of my big problem.
no, DOSEMU doesn't ignore them. Be careful here. What is your umask setting from bash.profile? Try a simple
umask
to be sure about that (in Linux)
If it's 007 then new DOSEMU files (with archive bit set) are normally created as
-rw-rw----
Also DOSEMU doesn't do chown on files so I can't see how it could ignore setgid attributes on directories -- the files will have the same owner/group as a simple file created with
echo hello > file
would do. Try this command in Linux *and* in DOSEMU in the same directory and look at the permissions.
Quoted 3 lines
directory dosen't help either, because DOSEMU takes .dosemurc strictly from user's home directory and this way the printing is directed to only one printer.
Try -f. Also the environment variable dosemu__printer can do the trick as long as you do *not* define it in .dosemurc.
Bart
Re: Problem: DOSEMU ignores Linux user file access settings -solved
Thank You very much.
I tested the way You suggested and I figured out that fault was mine. Maybe it was matter of too much stress :o)
The bash.profile umask was set ok, but when I ran DOSEMU directly from X and not from terminal, the bash.profile was of course not interpreted. Solution was quite simple -add umask command to dosemu start script.
Your help was valuable cause I was able to find and solve problem thanks to Your advice.
Thanks to You all that answered my question. Also thanks to DOSEMU team for their great work!
Sincerely Peter
Quoted 42 lines · Bart Oldeman
Quoted 6 lines · Mgr. Peter Tuharsky
DOSEMU uses one strict policy when creating new file from inside
emulated environment: It creates new file with 600 attrib mask and user-only gid/uid. DOSEMU fully IGNORES both bash.profile setting, and folder's SetUid/SetGid setting!! And this is the reason of my big problem.no, DOSEMU doesn't ignore them. Be careful here. What is your umask setting from bash.profile? Try a simple
umask
to be sure about that (in Linux)If it's 007 then new DOSEMU files (with archive bit set) are normally created as
-rw-rw----Also DOSEMU doesn't do chown on files so I can't see how it could ignore setgid attributes on directories -- the files will have the same owner/group as a simple file created with
echo hello > file
would do. Try this command in Linux *and* in DOSEMU in the same directory and look at the permissions.Quoted 5 lines
directory dosen't help either, because DOSEMU takes .dosemurc strictly from user's home directory and this way the printing is directed to only one printer.
Try -f. Also the environment variable
dosemu__printercan do the trick as long as you do *not* define it in .dosemurc.Bart