Re: [Samba] smbclient gives strange results

2009-09-14 Thread Nikhil
On Fri, Sep 4, 2009 at 9:01 PM, eje4 e...@cornell.edu wrote:


 Hello,

 I've been using Samba on a Sun server but we recently discontinued using
 the
 Sun and switched to using Samba on a RH linux server.  I can't get file
 sharing to work on the new server.  When I test the connection to the samba
 server (velar) by running smbclient //velar/homes -U eric I get an error
 message referring to NT_STATUS_BAD_NETWORK_NAME.  I can't find any reason
 for this error because all the names are correct, permissions are correct,
 etc.



My first guess would be whether the nmbd process is running on your host?
because that maintains the nameservice for samba process.

-- 
Nikhil

Want to win a laptop? : http://ezlaptop.com/?r=78878
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] Difference in Samba and CIFS interms of keeping the deleted files opened

2009-07-21 Thread Nikhil
On Tue, Jul 21, 2009 at 12:12 AM, Jeremy Allison j...@samba.org wrote:

  On Mon, Jul 20, 2009 at 10:14:49PM +0530, Nikhil wrote:
   Hi,
 
  We have a CIFS server running on a NetApp server and a Solaris host
 running
  Samba-3.3.2.
 
  When we mount both the filesystems to a Drive on a Windows using the net
 use
  command and then try to run a java program which basically does nothing
 but
  continuosly writes a data chunk to a file. On a side note, these same
  filesystems are accessible on a Solaris (unix) host too.
 
  When the java program is run and a file is being generated, I go to my
 unix
  terminal and happen to delete the file generated by the java program.
  Interestingly, there is an IOexception caught in the java program running
 on
  the Windows machine, when the file is deleted on the CIFS based
 filesystem
  (available on Solaris as a NFS filesystems) but there is no exception
 caught
  when the filesystem happens to be Samba (available on Solaris as /var , a
  regular partition).
 
  I delete the file from Unix as the process demands, but also there is no
 way
  to delete a in-use-file in Windows.
 
  I would like to understand the differences in Samba and CIFS in this
 context
  especially why is that so there is an IOexception for a CIFS based
  filesystem but not on the samba filesystem. This is reproducible at will.
  What could be wrong? What could be made to make samba filesystem also
 behave
  the same way to throw exceptions (Exceptions are good than that not at
 all
  knowing there is a file that is deleted but being still written onto.)

 Ok, I think the reason that you're having this problem is that
 you're running Samba on Solaris in this case, sad to say.

 I don't believe Sun have exposed kernel level oplock (lease) capability
 to user space processes, so Samba on Solaris has no way of knowing
 that a unix user deleted the file.

 Samba running on Linux, (or SGI Irix) has kernel level oplocks,
 so can detect access from the local filesystem. As the NetApp
 runs a custom kernel (derived a long time ago from FreeBSD I
 believe) then their CIFS implementation (like Samba on Linux)
 knows when a NFS user has modified the file.

 Jeremy.



Thanks Jeremy. Appreciate your response.

That actually sounds interesting... do we have this documented or referenced
as a bug somewhere that I can lookup?

What I see from the CIFS protocol:
-
When client B opens the file, the server must synchronize with client A
in case client A has any buffered locks.  Once it is synchronized,
client B's open request may be completed.  Client B, however, is
informed that he has a level II oplock, rather than an exclusive oplock
to the file.
In this case, no client that has the file open with a level II oplock
may buffer any lock information on the local client machine.  This
allows the server to guarantee that if any write operation is performed,
it need only notify the level II clients that the lock should be broken
without having to synchronize all of the accessors of the file.
The level II oplock may be broken to none, meaning that some client that
had the file opened has now performed a write operation to the file.


I do not understand whether Solaris fails to respect the level II oplock or
how does Samba can be made aware of the kernel level oplocks (is there a no
way?).

BTW, to check it myself on what you said I ran samba-3.0.25 on a Linux
machine with kernel version 2.4.21-47.0.1.ELsmp and ran smbd and then did
the same tests.
 - Ran java program on Windows which writes to the file continuously on a
samba exported filesystem from a Linux box
 - on the Linux terminal, I go and delete the file
 - Windows does NOT recognise that there is a opened file deleted and the
Java program does NOT thrown any exception... sadly.

So, I do not have a Linux box with kernel -2.6, so if that means to say that
Linux kernel has introduced kernel level oplocks facility in the 2.6 kernel
then I would have to try that...

Thanks.
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] Difference in Samba and CIFS interms of keeping the deleted files opened

2009-07-21 Thread Nikhil
On Tue, Jul 21, 2009 at 12:10 PM, Nikhil mnik...@gmail.com wrote:



 On Tue, Jul 21, 2009 at 12:12 AM, Jeremy Allison j...@samba.org wrote:

  On Mon, Jul 20, 2009 at 10:14:49PM +0530, Nikhil wrote:
   Hi,
 
  We have a CIFS server running on a NetApp server and a Solaris host
 running
  Samba-3.3.2.
 
  When we mount both the filesystems to a Drive on a Windows using the net
 use
  command and then try to run a java program which basically does nothing
 but
  continuosly writes a data chunk to a file. On a side note, these same
  filesystems are accessible on a Solaris (unix) host too.
 
  When the java program is run and a file is being generated, I go to my
 unix
  terminal and happen to delete the file generated by the java program.
  Interestingly, there is an IOexception caught in the java program
 running on
  the Windows machine, when the file is deleted on the CIFS based
 filesystem
  (available on Solaris as a NFS filesystems) but there is no exception
 caught
  when the filesystem happens to be Samba (available on Solaris as /var ,
 a
  regular partition).
 
  I delete the file from Unix as the process demands, but also there is no
 way
  to delete a in-use-file in Windows.
 
  I would like to understand the differences in Samba and CIFS in this
 context
  especially why is that so there is an IOexception for a CIFS based
  filesystem but not on the samba filesystem. This is reproducible at
 will.
  What could be wrong? What could be made to make samba filesystem also
 behave
  the same way to throw exceptions (Exceptions are good than that not at
 all
  knowing there is a file that is deleted but being still written onto.)

 Ok, I think the reason that you're having this problem is that
 you're running Samba on Solaris in this case, sad to say.

 I don't believe Sun have exposed kernel level oplock (lease) capability
 to user space processes, so Samba on Solaris has no way of knowing
 that a unix user deleted the file.

 Samba running on Linux, (or SGI Irix) has kernel level oplocks,
 so can detect access from the local filesystem. As the NetApp
 runs a custom kernel (derived a long time ago from FreeBSD I
 believe) then their CIFS implementation (like Samba on Linux)
 knows when a NFS user has modified the file.

 Jeremy.



 Thanks Jeremy. Appreciate your response.

 That actually sounds interesting... do we have this documented or
 referenced as a bug somewhere that I can lookup?

 What I see from the CIFS protocol:
 -
 When client B opens the file, the server must synchronize with client A
 in case client A has any buffered locks.  Once it is synchronized,
 client B's open request may be completed.  Client B, however, is
 informed that he has a level II oplock, rather than an exclusive oplock
 to the file.
 In this case, no client that has the file open with a level II oplock
 may buffer any lock information on the local client machine.  This
 allows the server to guarantee that if any write operation is performed,
 it need only notify the level II clients that the lock should be broken
 without having to synchronize all of the accessors of the file.
 The level II oplock may be broken to none, meaning that some client that
 had the file opened has now performed a write operation to the file.
 

 I do not understand whether Solaris fails to respect the level II oplock or
 how does Samba can be made aware of the kernel level oplocks (is there a no
 way?).

 BTW, to check it myself on what you said I ran samba-3.0.25 on a Linux
 machine with kernel version 2.4.21-47.0.1.ELsmp and ran smbd and then did
 the same tests.
  - Ran java program on Windows which writes to the file continuously on a
 samba exported filesystem from a Linux box
  - on the Linux terminal, I go and delete the file
  - Windows does NOT recognise that there is a opened file deleted and the
 Java program does NOT thrown any exception... sadly.

 So, I do not have a Linux box with kernel -2.6, so if that means to say
 that Linux kernel has introduced kernel level oplocks facility in the 2.6
 kernel then I would have to try that...

 Thanks.



 Jeremy,

I looked at the enabling kernel oplocks in the samba configuration file and
I have enabled kernel oplocks = yes in the [global] section on both of
Linux-2.6.18-92 and Linux-2.4.21-47.0.1.ELsmp kernel machines running the
samba and I notice that the behaviour is not as what is said. I still do not
see the exception being NOT caught on Windows java program when I delete the
file from a Unix terminal.

Any idea, where I could be going wrong?
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] Difference in Samba and CIFS interms of keeping the deleted files opened

2009-07-21 Thread Nikhil
On Tue, Jul 21, 2009 at 5:06 PM, Gerald Carter je...@plainjoe.org wrote:

 Nikhil,

  I looked at the enabling kernel oplocks in the samba configuration file
 and
  I have enabled kernel oplocks = yes in the [global] section on both of
  Linux-2.6.18-92 and Linux-2.4.21-47.0.1.ELsmp kernel machines running the
  samba and I notice that the behaviour is not as what is said. I still do
 not
  see the exception being NOT caught on Windows java program when I delete
 the
  file from a Unix terminal.
 
  Any idea, where I could be going wrong?

 It sounds more like smbd maintains the opens file descriptor
 as long as the client has an open file handle.  Standard
 POSIX semantics allow you to delete open files with the inode
 finally being released after the last open fd is closed.
 I could speculate that it may be less to do with CIFS and more
 to do with the server OS.  But that is pure speculation.

 Have you looked at a network trace to see which SMB op caused
 the IO Exception?  Does truncating rather than removing the
 file change the application behavior?




 cheers, jerry
 --
 =
 http://www.plainjoe.org/
 What man is a man who does not make the world better?  --Balian



Hi Jeremy,

Yeah.. I tried oplocking thing (btw, is there any set-direct-go howto on
oplocking configuration parameters to be used smb.conf?) and checked via the
smbstatus that the file is being into the samba lock.
But when I rm the file from the Unix terminal, the windows program does not
detect the file deletion.

 it may be less to do with CIFS and more to do with the server OS.  But
that is pure speculation.
agreed. I am running Solaris-10 where kernel oplock is not available, so
will rule that out.
I have linux box with 2.6 kernel and kernel oplocks=yes set in smb.conf; but
that still does not help in getting the sync set.

 Does truncating rather than removing the file change the application
behavior?
Interesting. I do /bin/cp -f /dev/null /var/tmp/test.log and I notice that
ls -l does not show that the file is truncated at all even though I do
it multiple times; ls -l still does not show that the file is truncated. Am
I missing something that why is rm command or deleting the file behaviour
would differ?


BTW, this is the output of testparam -s -v | grep -i lock output:

Load smb config files from /var/samba/smb.conf
Processing section [homes]
Processing section [printers]
Processing section [tmpdir]
Loaded services file OK.
Server role: ROLE_STANDALONE
kernel oplocks = Yes
lock spin time = 200
oplock break wait time = 0
lock directory = /var/samba/locks
usershare path = /var/samba/locks/usershares
block size = 1024
veto oplock files =
blocking locks = Yes
fake oplocks = No
locking = Yes
oplocks = Yes
level2 oplocks = Yes
oplock contention limit = 2
posix locking = Yes
strict locking = Yes
 Can you please let me know if any of the parameters need something
else/need not put?

Thanks again, Jeremy.
-- 
Nikhil
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


[Samba] Difference in Samba and CIFS interms of keeping the deleted files opened

2009-07-20 Thread Nikhil
 Hi,

We have a CIFS server running on a NetApp server and a Solaris host running
Samba-3.3.2.

When we mount both the filesystems to a Drive on a Windows using the net use
command and then try to run a java program which basically does nothing but
continuosly writes a data chunk to a file. On a side note, these same
filesystems are accessible on a Solaris (unix) host too.

When the java program is run and a file is being generated, I go to my unix
terminal and happen to delete the file generated by the java program.
Interestingly, there is an IOexception caught in the java program running on
the Windows machine, when the file is deleted on the CIFS based filesystem
(available on Solaris as a NFS filesystems) but there is no exception caught
when the filesystem happens to be Samba (available on Solaris as /var , a
regular partition).

I delete the file from Unix as the process demands, but also there is no way
to delete a in-use-file in Windows.

I would like to understand the differences in Samba and CIFS in this context
especially why is that so there is an IOexception for a CIFS based
filesystem but not on the samba filesystem. This is reproducible at will.
What could be wrong? What could be made to make samba filesystem also behave
the same way to throw exceptions (Exceptions are good than that not at all
knowing there is a file that is deleted but being still written onto.)

I would be willing to work and share the procedure to reproduce this
behaviour with anyone aware of the Samba/CIFS protocols.

-- 
Nikhil
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] Differences in Samba and CIFS in terms of keeping the deleted files open?

2009-07-20 Thread Nikhil
I see there are some bugzilla links open but not really sure if they conform
to the same behaviour what I see.

http://www.mail-archive.com/samba@lists.samba.org/msg94854.html
 https://bugzilla.samba.org/show_bug.cgi?id=5315
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6213298
http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=991fdfd56a9fccbbb8cdf50d6de3?bug_id=4313887
http://jcp.org/en/jsr/detail?id=203






On Mon, Jul 20, 2009 at 9:59 PM, Nikhil mnik...@gmail.com wrote:

 Hi,

 We have a CIFS server running on a NetApp server and a Solaris host running
 Samba-3.3.2.

 When we mount both the filesystems to a Drive on a Windows using the net
 use command and then try to run a java program which basically does nothing
 but continuosly writes a data chunk to a file. On a side note, these same
 filesystems are accessible on a Solaris (unix) host too.

 When the java program is run and a file is being generated, I go to my unix
 terminal and happen to delete the file generated by the java program.
 Interestingly, there is an IOexception caught in the java program running on
 the Windows machine, when the file is deleted on the CIFS based filesystem
 (available on Solaris as a NFS filesystems) but there is no exception caught
 when the filesystem happens to be Samba (available on Solaris as /var , a
 regular partition).

 I delete the file from Unix as the process demands, but also there is no
 way to delete a in-use-file in Windows.

 I would like to understand the differences in Samba and CIFS in this
 context especially why is that so there is an IOexception for a CIFS based
 filesystem but not on the samba filesystem. This is reproducible at will.
 What could be wrong? What could be made to make samba filesystem also
 behave the same way to throw exceptions (Exceptions are good than that not
 at all knowing there is a file that is deleted but being still written
 onto.)

 I would be willing to work and share the procedure to reproduce this
 behaviour with anyone aware of the Samba/CIFS protocols.

 --
 Nikhil




-- 
Nikhil

Google is Great !
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


RE: [Samba] Internet access control through samba ?

2004-06-14 Thread Nikhil Parva
try squid and squid guard...

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Jeremias Müller
Sent: Monday, June 14, 2004 4:47 AM
To: Samba
Subject: [Samba] Internet access control through samba ?


Hi,
is there a possibility to use a samba pdc for internet access control ?
I want only machines, which are logged in to the domain, to have
internet access.
Currently everybody can use the Internet through the masquerading
functionality
on the server(also pdc).

Thanks Jeremias M.
--
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba


RE: [Samba] Restricting ACL Modification?

2004-06-12 Thread Nikhil Parva
try sudo 


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Matthias Spork
Sent: Saturday, June 12, 2004 6:08 AM
To: Joshua Schmidlkofer
Cc: Samba List
Subject: Re: [Samba] Restricting ACL Modification?


Hello Joshua,

Joshua Schmidlkofer schrieb:

 Howdy Everyone,

   Is there anyway to restrict _who_ has the ability to modify ACLs for 
 a share?  I have a number of users with poor auditory comprehension 
 skills.  Hence, numerous stupid modifications to permissions rather 
 than working with me to adjust group membership.   Is there anyway to 
 restrict the ability of users to change the ACLs?


it is a great way to discard the ACL-Support on your share with *nt acl 
support = no and create an other share to edit the ACL's.

matze
*

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba