The branch, master has been updated
       via  7d8354c smbd: Change logging when SET_OFFLINE is not supported
      from  1a6eac2 s4:samldb LDB module - permit "userAccountControl" 
modifications without acct. type

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 7d8354c719fa620a580f6d7d322ca80185c50c7e
Author: Christof Schmitt <christof.schm...@us.ibm.com>
Date:   Wed Jun 5 17:08:03 2013 -0700

    smbd: Change logging when SET_OFFLINE is not supported
    
    A client can send a request to set the OFFLINE attribute. In the default
    code this is not supported and triggers a log message each time. Change
    this to only log with level 0 when an actual errors occurs, and log
    ENOTSUP with level 10.
    
    Signed-off-by: Christof Schmitt <christof.schm...@us.ibm.com>
    
    Reviewed-by: Andrew Bartlett <abart...@samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abart...@samba.org>
    Autobuild-Date(master): Thu Jun  6 04:30:26 CEST 2013 on sn-devel-104

-----------------------------------------------------------------------

Summary of changes:
 source3/smbd/dosmode.c |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index 04d27c7..a6ad107 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -732,16 +732,21 @@ int file_set_dosmode(connection_struct *conn, struct 
smb_filename *smb_fname,
 
        old_mode = dos_mode(conn, smb_fname);
 
-       if (dosmode & FILE_ATTRIBUTE_OFFLINE) {
-               if (!(old_mode & FILE_ATTRIBUTE_OFFLINE)) {
-                       lret = SMB_VFS_SET_OFFLINE(conn, smb_fname);
-                       if (lret == -1) {
-                               DEBUG(0, ("set_dos_mode: client has asked to "
-                                         "set FILE_ATTRIBUTE_OFFLINE to "
-                                         "%s/%s but there was an error while "
-                                         "setting it or it is not "
-                                         "supported.\n", parent_dir,
-                                         smb_fname_str_dbg(smb_fname)));
+       if ((dosmode & FILE_ATTRIBUTE_OFFLINE) &&
+           !(old_mode & FILE_ATTRIBUTE_OFFLINE)) {
+               lret = SMB_VFS_SET_OFFLINE(conn, smb_fname);
+               if (lret == -1) {
+                       if (errno == ENOTSUP) {
+                               DEBUG(10, ("Setting FILE_ATTRIBUTE_OFFLINE for "
+                                          "%s/%s is not supported.\n",
+                                          parent_dir,
+                                          smb_fname_str_dbg(smb_fname)));
+                       } else {
+                               DEBUG(0, ("An error occurred while setting "
+                                         "FILE_ATTRIBUTE_OFFLINE for "
+                                         "%s/%s: %s", parent_dir,
+                                         smb_fname_str_dbg(smb_fname),
+                                         strerror(errno)));
                        }
                }
        }


-- 
Samba Shared Repository

Reply via email to