From: Volker Lendecke Date: Thu, 18 Dec 2025 14:36:23 +0000 (+0100) Subject: lib: Fix some whitespace X-Git-Tag: tdb-1.4.15~181 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f761a956bef95d75f71311b8ac554641c7102a2;p=thirdparty%2Fsamba.git lib: Fix some whitespace Signed-off-by: Volker Lendecke Reviewed-by: Anoop C S --- diff --git a/lib/util/fsusage.c b/lib/util/fsusage.c index d769b452eaa..f71a2aed50a 100644 --- a/lib/util/fsusage.c +++ b/lib/util/fsusage.c @@ -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 . */ @@ -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) diff --git a/source3/include/fake_file.h b/source3/include/fake_file.h index f688ed296fd..20825069ea0 100644 --- a/source3/include/fake_file.h +++ b/source3/include/fake_file.h @@ -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 . */ diff --git a/source3/include/smb.h b/source3/include/smb.h index bd7abd7f364..070872deea8 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -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 . */ @@ -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 diff --git a/source3/include/smb_acls.h b/source3/include/smb_acls.h index 7203dd27d75..97b7a5333e8 100644 --- a/source3/include/smb_acls.h +++ b/source3/include/smb_acls.h @@ -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 . */ diff --git a/source3/lib/smbrun.c b/source3/lib/smbrun.c index 8e3675fdc22..f9c6f8761c6 100644 --- a/source3/lib/smbrun.c +++ b/source3/lib/smbrun.c @@ -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); diff --git a/source3/lib/util_sec.c b/source3/lib/util_sec.c index 2dab2855858..8fe0efa0bf4 100644 --- a/source3/lib/util_sec.c +++ b/source3/lib/util_sec.c @@ -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); } diff --git a/source3/smbd/statvfs.c b/source3/smbd/statvfs.c index 03dacc4ccc7..513df290415 100644 --- a/source3/smbd/statvfs.c +++ b/source3/smbd/statvfs.c @@ -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 . */ @@ -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 diff --git a/source4/libcli/smb2/smb2_calls.h b/source4/libcli/smb2/smb2_calls.h index b6c08c2325f..9e8aa55568a 100644 --- a/source4/libcli/smb2/smb2_calls.h +++ b/source4/libcli/smb2/smb2_calls.h @@ -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 . */ @@ -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;