]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib: Fix some whitespace
authorVolker Lendecke <vl@samba.org>
Thu, 18 Dec 2025 14:36:23 +0000 (15:36 +0100)
committerVolker Lendecke <vl@samba.org>
Wed, 7 Jan 2026 09:57:40 +0000 (09:57 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
lib/util/fsusage.c
source3/include/fake_file.h
source3/include/smb.h
source3/include/smb_acls.h
source3/lib/smbrun.c
source3/lib/util_sec.c
source3/smbd/statvfs.c
source4/libcli/smb2/smb2_calls.h

index d769b452eaad704116453c038ee806f04358ee82..f71a2aed50a1beecbaf7404e17459e8fd982c030 100644 (file)
@@ -1,18 +1,18 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
    functions to calculate the free disk space
    Copyright (C) Andrew Tridgell 1998-2000
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
@@ -20,7 +20,7 @@
 #include "replace.h"
 #include "lib/util/samba_util.h"
 #include "system/filesys.h"
+
 /**
  * @file
  * @brief Utility functions for getting the amount of free disk space
@@ -48,7 +48,7 @@ static uint64_t adjust_blocks(uint64_t blocks, uint64_t fromsize, uint64_t tosiz
  * Retrieve amount of free disk space.
  * this does all of the system specific guff to get the free disk space.
  * It is derived from code in the GNU fileutils package, but has been
- * considerably mangled for use here 
+ * considerably mangled for use here
  *
  * results are returned in *dfree and *dsize, in 512 byte units
 */
@@ -61,25 +61,25 @@ _PUBLIC_ int sys_fsusage(const char *path, uint64_t *dfree, uint64_t *dsize)
        if (statfs (path, &fsd, sizeof (struct statfs)) != 0)
                return -1;
 #endif /* STAT_STATFS3_OSF1 */
-       
+
 #ifdef STAT_STATFS2_FS_DATA    /* Ultrix */
-#define CONVERT_BLOCKS(B) adjust_blocks ((uint64_t)(B), (uint64_t)1024, (uint64_t)512) 
+#define CONVERT_BLOCKS(B) adjust_blocks ((uint64_t)(B), (uint64_t)1024, (uint64_t)512)
        struct fs_data fsd;
-       
+
        if (statfs (path, &fsd) != 1)
                return -1;
-       
+
        (*dsize) = CONVERT_BLOCKS (fsd.fd_req.btot);
        (*dfree) = CONVERT_BLOCKS (fsd.fd_req.bfreen);
 #endif /* STAT_STATFS2_FS_DATA */
-       
+
 #ifdef STAT_STATFS2_BSIZE      /* 4.3BSD, SunOS 4, HP-UX, AIX */
 #define CONVERT_BLOCKS(B) adjust_blocks ((uint64_t)(B), (uint64_t)fsd.f_bsize, (uint64_t)512)
        struct statfs fsd;
-       
+
        if (statfs (path, &fsd) < 0)
                return -1;
-       
+
 #ifdef STATFS_TRUNCATES_BLOCK_COUNTS
        /* In SunOS 4.1.2, 4.1.3, and 4.1.3_U1, the block counts in the
           struct statfs are truncated to 2GB.  These conditions detect that
@@ -93,17 +93,17 @@ _PUBLIC_ int sys_fsusage(const char *path, uint64_t *dfree, uint64_t *dsize)
        }
 #endif /* STATFS_TRUNCATES_BLOCK_COUNTS */
 #endif /* STAT_STATFS2_BSIZE */
-       
+
 
 #ifdef STAT_STATFS2_FSIZE      /* 4.4BSD */
 #define CONVERT_BLOCKS(B) adjust_blocks ((uint64_t)(B), (uint64_t)fsd.f_fsize, (uint64_t)512)
-       
+
        struct statfs fsd;
-       
+
        if (statfs (path, &fsd) < 0)
                return -1;
 #endif /* STAT_STATFS2_FSIZE */
-       
+
 #ifdef STAT_STATFS4            /* SVR3, Dynix, Irix, AIX */
 # if _AIX || defined(_CRAY)
 #  define CONVERT_BLOCKS(B) adjust_blocks ((uint64_t)(B), (uint64_t)fsd.f_bsize, (uint64_t)512)
@@ -118,7 +118,7 @@ _PUBLIC_ int sys_fsusage(const char *path, uint64_t *dfree, uint64_t *dsize)
 #   endif
 #  endif
 # endif
-       
+
        struct statfs fsd;
 
        if (statfs (path, &fsd, sizeof fsd, 0) < 0)
index f688ed296fdf6529e1197aa8c80cd2dfa5945d3d..20825069ea09070e0d5019314f1e88054c99a591 100644 (file)
@@ -1,18 +1,18 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
    FAKE FILE support, for faking up special files windows want access to
    Copyright (C) Stefan (metze) Metzmacher     2003
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
index bd7abd7f36452a694bb35ebaf870b81dd0ddd3d7..070872deea845974fd7c5cdc48c9fc661dd99bcd 100644 (file)
@@ -1,24 +1,24 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
    SMB parameters and setup, plus a whole lot more.
-   
+
    Copyright (C) Andrew Tridgell              1992-2000
    Copyright (C) John H Terpstra              1996-2002
    Copyright (C) Luke Kenneth Casson Leighton 1996-2000
    Copyright (C) Paul Ashton                  1998-2000
    Copyright (C) Simo Sorce                   2001-2002
    Copyright (C) Martin Pool                 2002
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
@@ -306,7 +306,7 @@ struct interface {
 
 /* the desired access to use when opening a pipe */
 #define DESIRED_ACCESS_PIPE 0x2019f
+
 /* Mapping of access rights to UNIX perms. */
 #define UNIX_ACCESS_RWX                FILE_GENERIC_ALL
 #define UNIX_ACCESS_R          FILE_GENERIC_READ
@@ -429,7 +429,7 @@ struct interface {
  *               it to 6.1 to mimic Win2K8R2.
  *
  */
+
 #define SAMBA_MAJOR_NBT_ANNOUNCE_VERSION 0x06
 #define SAMBA_MINOR_NBT_ANNOUNCE_VERSION 0x01
 
index 7203dd27d75975ee5d5d4e4e8619f4fc24bf257f..97b7a5333e8d6078a9d5f7eb27e0101daff2120e 100644 (file)
@@ -1,18 +1,18 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
    Portable SMB ACL interface
    Copyright (C) Jeremy Allison 2000
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
index 8e3675fdc221e92e73bba0a8d5458aa23adbcd20..f9c6f8761c685926410ee1b8dd17284272367c37 100644 (file)
@@ -97,7 +97,7 @@ static int smbrun_internal(const char *cmd, int *outfd, bool sanitize,
         */
 
        saved_handler = CatchChildLeaveStatus();
-                                       
+
        if ((pid=fork()) < 0) {
                DEBUG(0,("smbrun: fork failed with error %s\n", strerror(errno) ));
                (void)CatchSignal(SIGCLD, saved_handler);
@@ -115,7 +115,7 @@ static int smbrun_internal(const char *cmd, int *outfd, bool sanitize,
                int status=0;
                pid_t wpid;
 
-               
+
                /* the parent just waits for the child to exit */
                while((wpid = waitpid(pid,&status,0)) < 0) {
                        if(errno == EINTR) {
@@ -149,13 +149,13 @@ static int smbrun_internal(const char *cmd, int *outfd, bool sanitize,
 
                return status;
        }
-       
+
        (void)CatchChild();
-       
+
        /* we are in the child. we exec /bin/sh to do the work for us. we
           don't directly exec the command we want because it may be a
           pipeline or anything else the config file specifies */
-       
+
        /* point our stdout at the file we want output to go into */
        if (outfd) {
                close(1);
@@ -204,7 +204,7 @@ static int smbrun_internal(const char *cmd, int *outfd, bool sanitize,
 
                SAFE_FREE(newcmd);
        }
-       
+
        /* not reached */
        exit(83);
        return 1;
@@ -241,7 +241,7 @@ int smbrunsecret(const char *cmd, const char *secret)
        gid_t gid = current_user.ut.gid;
        int ifd[2];
        void (*saved_handler)(int);
-       
+
        /*
         * Lose any elevated privileges.
         */
@@ -262,7 +262,7 @@ int smbrunsecret(const char *cmd, const char *secret)
         */
 
        saved_handler = CatchChildLeaveStatus();
-                                       
+
        if ((pid=fork()) < 0) {
                DEBUG(0, ("smbrunsecret: fork failed with error %s\n", strerror(errno)));
                (void)CatchSignal(SIGCLD, saved_handler);
@@ -277,7 +277,7 @@ int smbrunsecret(const char *cmd, const char *secret)
                pid_t wpid;
                size_t towrite;
                ssize_t wrote;
-               
+
                close(ifd[0]);
                /* send the secret */
                towrite = strlen(secret);
@@ -312,13 +312,13 @@ int smbrunsecret(const char *cmd, const char *secret)
 
                return status;
        }
-       
+
        (void)CatchChild();
-       
+
        /* we are in the child. we exec /bin/sh to do the work for us. we
           don't directly exec the command we want because it may be a
           pipeline or anything else the config file specifies */
-       
+
        close(ifd[1]);
        close(0);
        if (dup2(ifd[0], 0) != 0) {
@@ -346,7 +346,7 @@ int smbrunsecret(const char *cmd, const char *secret)
           2 point to /dev/null from the startup code */
        closefrom(3);
 
-       execl("/bin/sh", "sh", "-c", cmd, NULL);  
+       execl("/bin/sh", "sh", "-c", cmd, NULL);
 
        /* not reached */
        exit(82);
index 2dab285585897cf96f0635fba29068c2d8a4b5b8..8fe0efa0bf4f0f893032a337d8ae73d4f6298a3e 100644 (file)
@@ -163,15 +163,15 @@ static void assert_gid(gid_t rgid, gid_t egid)
 }
 
 /****************************************************************************
- Gain root privilege before doing something. 
+ Gain root privilege before doing something.
  We want to end up with ruid==euid==0
 ****************************************************************************/
 void gain_root_privilege(void)
-{      
+{
 #if defined(USE_SETRESUID) || defined(HAVE_LINUX_THREAD_CREDENTIALS)
        samba_setresuid(0,0,0);
 #endif
-    
+
 #if USE_SETEUID
        samba_seteuid(0);
 #endif
@@ -224,7 +224,7 @@ void gain_root_group_privilege(void)
 /****************************************************************************
  Set effective uid, and possibly the real uid too.
  We want to end up with either:
-  
+
    ruid==uid and euid==uid
 
  or
@@ -331,7 +331,7 @@ void restore_re_uid(void)
 }
 
 /****************************************************************************
- save the real and effective gid for later restoration. Used by the 
+ save the real and effective gid for later restoration. Used by the
  getgroups code
 ****************************************************************************/
 void save_re_gid(void)
@@ -442,7 +442,7 @@ void become_user_permanently(uid_t uid, gid_t gid)
        samba_setuidx(ID_EFFECTIVE, uid);
        samba_setuid(uid);
 #endif
-       
+
        assert_uid(uid, uid);
        assert_gid(gid, gid);
 }
@@ -565,7 +565,7 @@ int main(void)
                exit(1);
 #endif
 
-               /* if not running as root then at least check to see if we get ENOSYS - this 
+               /* if not running as root then at least check to see if we get ENOSYS - this
                   handles Linux 2.0.x with glibc 2.1 */
                 fprintf(stderr,"not running as root: checking for ENOSYS\n");
                exit(have_syscall());
@@ -595,7 +595,7 @@ int main(void)
 /****************************************************************************
 Check if we are setuid root.  Used in libsmb and smbpasswd paranoia checks.
 ****************************************************************************/
-bool is_setuid_root(void) 
+bool is_setuid_root(void)
 {
        return (geteuid() == (uid_t)0) && (getuid() != (uid_t)0);
 }
index 03dacc4ccc7e6c86bda69c178b15907e8897a8bc..513df29041528e56da06340c0f15d0b117f4adb2 100644 (file)
@@ -1,20 +1,20 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
    VFS API's statvfs abstraction
    Copyright (C) Alexander Bokovoy                     2005
    Copyright (C) Steve French                          2005
    Copyright (C) James Peach                           2006
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
@@ -158,7 +158,7 @@ static int posix_statvfs(const char *path, struct vfs_statvfs_struct *statbuf)
 }
 #endif
 
-/* 
+/*
  sys_statvfs() is an abstraction layer over system-dependent statvfs()/statfs()
  for particular POSIX systems. Due to controversy of what is considered more important
  between LSB and FreeBSD/POSIX.1 (IEEE Std 1003.1-2001) we need to abstract the interface
index b6c08c2325fa0e4c5da0c604ada5d511fc051d89..9e8aa55568a1eaaf784806abf399407b79b5d52d 100644 (file)
@@ -1,20 +1,20 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
 
-   SMB2 client calls 
+   SMB2 client calls
 
    Copyright (C) Andrew Tridgell 2005
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
@@ -24,7 +24,7 @@
 struct smb2_negprot {
        struct {
                uint16_t dialect_count;    /* size of dialects array */
-               uint16_t security_mode;    /* 0==signing disabled   
+               uint16_t security_mode;    /* 0==signing disabled
                                              1==signing enabled */
                uint16_t reserved;
                uint32_t capabilities;