File attributes in Samba

Hello everybody,

I know that there are a lot of information written about the subject. I’ve read many sources and did a number of experiments, but unfortunately I still cannot solve the puzzle. It looks like I’m missing something basic.

I installed Samba 2.2.4 on QNX 6.2. Configuration is pretty simple:

[global]
workgroup = QNX
netbios name = CVS
unix extensions = Yes
case sensitive = Yes
map archive = No
create mask = 0777

[abc]
path = /home/abc
writable = Yes

I want to connect to the server from QNX and from Win, but I’m mostly concerned about keeping there QNX files. Generally speaking I want to put there a file with -rwxrw-rw- attributes, see the same attributes there and take it back with the same attributes.

Now I observe the following behavior. I mount “abc” service as /fs/abc on client computer (QNX 6.2). Then I copy “hello” file with -rwx-rw-rw- attributes to /fs/abc. When I do ls -l /fs/abc/hello I see -rwxrwxrwx. When I do ls -l /home/abc/hello I see -rw-rw-rw.

When I copy the file back to client disk (new location) the attributes are amazingly restored to their original state.

Is there anything I can do with configuration to see proper attributes at least from client? As you can see in my smb.conf, I try to preserve all attributes with “create mask = 0777” and don’t care about DOS attributes mapping.

Thanks,

Serge

Are you making sure to use “cp -p” to do the copying?

dB

Serge Yuschenko <nospam@forums.openqnx.com> wrote in message
news:26294097.1047061734756.JavaMail.fliu@tiger…

Hello everybody,

I know that there are a lot of information written about the subject. I’ve
read many sources and did a number of experiments, but unfortunately I still

cannot solve the puzzle. It looks like I’m missing something basic.

I installed Samba 2.2.4 on QNX 6.2. Configuration is pretty simple:

[global]
workgroup = QNX
netbios name = CVS
unix extensions = Yes
case sensitive = Yes
map archive = No
create mask = 0777

[abc]
path = /home/abc
writable = Yes

I want to connect to the server from QNX and from Win, but I’m mostly
concerned about keeping there QNX files. Generally speaking I want to put

there a file with -rwxrw-rw- attributes, see the same attributes there and
take it back with the same attributes.

Now I observe the following behavior. I mount “abc” service as /fs/abc on
client computer (QNX 6.2). Then I copy “hello” file with -rwx-rw-rw-

attributes to /fs/abc. When I do ls -l /fs/abc/hello I see -rwxrwxrwx. When
I do ls -l /home/abc/hello I see -rw-rw-rw.

When I copy the file back to client disk (new location) the attributes are
amazingly restored to their original state.

Is there anything I can do with configuration to see proper attributes at
least from client? As you can see in my smb.conf, I try to preserve all

attributes with “create mask = 0777” and don’t care about DOS attributes
mapping.

Thanks,

Serge

Are you making sure to use “cp -p” to do the copying?

dB

Yes. I do use “cp -p”. After a couple more experiments it seems to me that the problem is not caused by Samba server, but QNX smb/cifs client.

Let me show you what I do. At first I got connected to Samba server from QNX 6.2 computer:

fs-cifs -a //CVS:192.9.200.100:/abc /fs/abc abc

Then I took a file:

ls -l /home/localabc/hello

-rwxrw-rw- 1 abc users … hello

and copied it to the server

cp -p /home/localabc/hello /fs/abc

ls -l /fs/abc/hello

-rwxrwxrwx 1 root root … hello

The path for “abc” service on the server is /home/abc, so I go to the server and check what is there:

ls -l /home/abc/hello

-rw-rw-rw- 1 abc users … hello

On the client I try to get my file back:

cp -p /fs/abc/hello /tmp

ls -l /tmp/hello

-rwxrwxrwx 1 abc users … hello

Then I repeat all the same steps from QNX4 client.

SMBfsys &
smb_user abc
smb_mount //CVS:192.9.200.100/abc /abc

cp -p /home/abc/hello /abc

ls -l /abc/hello

-rw-rw-rw- 1 root root … hello

On the server:

ls -l /home/abc/hello

-rw-rw-rw- 1 abc users … hello

After copying back:

cp -p /abc/hello /tmp

ls -l /tmp/hello

-rw-rw-rw- 1 root root … hello

Apparently QNX4 client doesn’t remember neither attributes nor owner.

Thanks,

Serge

I don’t have any experience with setting up Samba servers, but one thing
that immediately occurs to me here is to wonder what kind of filesystem
yours is using. If it is a DOS (FAT32) filesys, perhaps the behaviour you
are seeing is just caused by defaults filling in for where information is
not preserved.

dB

Serge Yuschenko <nospam@forums.openqnx.com> wrote in message
news:5174563.1047323701291.JavaMail.fliu@tiger…

Are you making sure to use “cp -p” to do the copying?

dB


Yes. I do use “cp -p”. After a couple more experiments it seems to me that
the problem is not caused by Samba server, but QNX smb/cifs client.

Let me show you what I do. At first I got connected to Samba server from
QNX 6.2 computer:

fs-cifs -a //CVS:192.9.200.100:/abc /fs/abc abc

Then I took a file:

ls -l /home/localabc/hello

-rwxrw-rw- 1 abc users … hello

and copied it to the server

cp -p /home/localabc/hello /fs/abc

ls -l /fs/abc/hello

-rwxrwxrwx 1 root root … hello

The path for “abc” service on the server is /home/abc, so I go to the
server and check what is there:

ls -l /home/abc/hello

-rw-rw-rw- 1 abc users … hello

On the client I try to get my file back:

cp -p /fs/abc/hello /tmp

ls -l /tmp/hello

-rwxrwxrwx 1 abc users … hello

Then I repeat all the same steps from QNX4 client.

SMBfsys &
smb_user abc
smb_mount //CVS:192.9.200.100/abc /abc

cp -p /home/abc/hello /abc

ls -l /abc/hello

-rw-rw-rw- 1 root root … hello

On the server:

ls -l /home/abc/hello

-rw-rw-rw- 1 abc users … hello

After copying back:

cp -p /abc/hello /tmp

ls -l /tmp/hello

-rw-rw-rw- 1 root root … hello

Apparently QNX4 client doesn’t remember neither attributes nor owner.

Thanks,

Serge

I don’t have any experience with setting up Samba
servers, but one thing
that immediately occurs to me here is to wonder what
kind of filesystem
yours is using. If it is a DOS (FAT32) filesys,
perhaps the behaviour you
are seeing is just caused by defaults filling in for
where information is
not preserved.

dB

Do you mean “fstype” parameter in smb.conf ? I tried all 3 types (NTFS, FAT, Samba). Haven’t noticed any difference (at least concerning file attributes and ownership).

Thanks anyway,

Serge

No, I really mean what kind of filesystem underlies the Samba server. I
assume the Samba server itself is only able to reflect the capabilities of
the underlying filesystem that it is using, so if the filesystem doesn’t
maintain Unix permissions bits (for example) or group ids, then the Samba
server has to throw away information when files are stored on that
filesystem. Similarly, either the Samba server or its client has to make up
that kind of information based on defaults when the client presents a
Unix-style view of those files. Commands like cp are then at the mercy of
that partly invented view.

dB

Serge Yuschenko <nospam@forums.openqnx.com> wrote in message
news:1238829.1047411722920.JavaMail.fliu@tiger…

I don’t have any experience with setting up Samba
servers, but one thing
that immediately occurs to me here is to wonder what
kind of filesystem
yours is using. If it is a DOS (FAT32) filesys,
perhaps the behaviour you
are seeing is just caused by defaults filling in for
where information is
not preserved.

dB


Do you mean “fstype” parameter in smb.conf ? I tried all 3 types (NTFS,
FAT, Samba). Haven’t noticed any difference (at least concerning file

attributes and ownership).

Thanks anyway,

Serge

The Samba server is working on QNX 6.2. I believe the /home directory is not in packaging fs, so it has to be QNX4.

No, I really mean what kind of filesystem underlies
the Samba server. I
assume the Samba server itself is only able to
reflect the capabilities of
the underlying filesystem that it is using, so if the
filesystem doesn’t
maintain Unix permissions bits (for example) or group
ids, then the Samba
server has to throw away information when files are
stored on that
filesystem. Similarly, either the Samba server or
its client has to make up
that kind of information based on defaults when the
client presents a
Unix-style view of those files. Commands like cp are
then at the mercy of
that partly invented view.

dB

Serge Yuschenko <> nospam@forums.openqnx.com> > wrote in
message
news:1238829.1047411722920.JavaMail.fliu@tiger…
I don’t have any experience with setting up Samba
servers, but one thing
that immediately occurs to me here is to wonder
what
kind of filesystem
yours is using. If it is a DOS (FAT32) filesys,
perhaps the behaviour you
are seeing is just caused by defaults filling in
for
where information is
not preserved.

dB


Do you mean “fstype” parameter in smb.conf ? I
tried all 3 types (NTFS,
FAT, Samba). Haven’t noticed any difference (at least
concerning file
attributes and ownership).

Thanks anyway,

Serge

You can find out for sure about your /home directory’s filesystem type using
“df -g /home”. Beyond that, unless you are up against some fundamental
limitations in the version of Samba you are using (though I assume you would
have checked for that before posting your article in the first place), or
some configuration problem, I really don’t know what could be wrong.

dB

Serge Yuschenko <nospam@forums.openqnx.com> wrote in message
news:17043623.1047481910627.JavaMail.fliu@tiger…

The Samba server is working on QNX 6.2. I believe the /home directory is
not in packaging fs, so it has to be QNX4.

No, I really mean what kind of filesystem underlies
the Samba server. I
assume the Samba server itself is only able to
reflect the capabilities of
the underlying filesystem that it is using, so if the
filesystem doesn’t
maintain Unix permissions bits (for example) or group
ids, then the Samba
server has to throw away information when files are
stored on that
filesystem. Similarly, either the Samba server or
its client has to make up
that kind of information based on defaults when the
client presents a
Unix-style view of those files. Commands like cp are
then at the mercy of
that partly invented view.

dB

Serge Yuschenko <> nospam@forums.openqnx.com> > wrote in
message
news:1238829.1047411722920.JavaMail.fliu@tiger…
I don’t have any experience with setting up Samba
servers, but one thing
that immediately occurs to me here is to wonder
what
kind of filesystem
yours is using. If it is a DOS (FAT32) filesys,
perhaps the behaviour you
are seeing is just caused by defaults filling in
for
where information is
not preserved.

dB


Do you mean “fstype” parameter in smb.conf ? I
tried all 3 types (NTFS,
FAT, Samba). Haven’t noticed any difference (at least
concerning file
attributes and ownership).

Thanks anyway,

Serge
\