Samba setting

I have a pc running Linux and Samba, then I export HDD to
NT machines. Here is output of ls in NT:

C:\> ls -l U:/home/yan/a.c
-rwxrwxrwa   1 <unavail>       <unavail>            85 Sep 16 19:28 u:/home/yan/a.c

But if I use the same command (ls.exe) for other files in NT machines, the <unavail> field will be filled by owner's name and group.

My question is how to set Samba to let it give same result
as NT.

The background for my question:
I am using NuTCracker (a simulation of UNIX?) in my NT machine, so I have ls.exe, chmod.exe and so on.
I want to use RCS for files in Samba harddisk, but RCS
gives an error when it tries to call chmod() system call.
chmod.exe also give same error message as chmod() if the
file is located on Samba harddisk:
     Error: The request for network is not supported.
But if the file is on NT harddisk (local or remote), chmod.exe
works well as well as RCS.
By invistigate the reason, I found the security attribute
of samba files is different from that of NT files.
So I think if I can change some setting in samba, then I can get same result as from NT harddisk.

Please give me some ideas.

Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

alexbikConnect With a Mentor Commented:

What you are trying won't work. With samba, a share is mounted as a specific user. Which user this is (and what his/her rights will be) is determined at mount time, not afterwards. That means that all files on that share, seen from the client side, will have the same owner. There's nothing you can do about that. If you want to be able to change owners of files that are on remote filesystems, you will definitively need a different protocol, NFS for instance.

I expect the file has an owner/group for which no name appears in /etc/passwd.

yan051197Author Commented:
Thanks for your quick response.

But that file has valid user/group in /etc/passwd.
Here is output of Linux ls:
home:/home1/public/home/yan# ls -l
total 112
drwxr-xr-x   2 pcuser   users        1024 Sep 17 15:34 RCS/
-rwxr--r--   1 pcuser   users          85 Sep 16 19:28 a.c*
-rwxr--r--   1 pcuser   users        7680 Sep 16 19:40 a.exe*
-rwxr--r--   1 pcuser   users         323 Sep 16 19:39 a.o*
-rwxr--r--   1 pcuser   users        7680 Sep 16 19:39 a.out*

But the username/group do not exist in NT system,
should I add username/group in NT?
Then how to mapping NT's user/group to UNIX?

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

You're MUCH better off using CVS in that kind of environment.  You can migrate to CVS from RCS while still keeping the RCS files; I highly reccomend it.  It will actually avoid all those problems as well as allowing much faster compiles (since you get a copy of the source on a local disk if you want it).

yan051197Author Commented:
I will find CVS now and to try to use it in my environment.
But we are using NT, so I am afriad no CVS version for NT.

Of COURSE there is a version of CVS for NT.

yan051197Author Commented:
Thank you very much.
I have downloaded from that site and I will install it now.
That company olny sell CD-ROM to U.S.A. But I am in Japan.

I think your problem is because Samba was meant to sharing Linux with Windows users, but you are using non NT, or Windows commands from what Linux thinks is a Windows share. If you issue the same commands from NT's native system commands it should work, but in order for the Unix type commands to work from the NT box, the programmers would have to know that you were going to use them that way so they could have written them to work that way. If you were on a true Unix platform, it would work because you would not be using samba.  You can Telnet in and use whatever you like, but the interface you are trying to make happen was not meant to be.  
This is only my opinion, and as such, is subject to change in proportion to my level of knowledge at any given momement.
yan051197Author Commented:
Thanks for joe_massimino.
Perhaps my question was not clear.
The problem in fact also occur in native NT environment.
If we use NT Explorer for any file in another NT share,
then we can see the "Security" tab (page) from the properties menu, so you can set the ACL, etc.
But if we use NT Explorer for any file in Samba share,
we can not see the "Security" tab (page) from the properties
Samba is desgined to appear as a NT machine, so I think it should
act same as other NT shares, the key point maybe how to set some
parameters in smb.conf?

Bye the way, I decided to use CVS as recommended by JYOUNGMAN,
and I hope CVS will work happy with Samba.

Thanks again.

beside CVS vs. RCS, back to the initial question, did you try following in  smb.conf

  force user  = %U
  force group = %G
All Courses

From novice to tech pro — start learning today.