summaryrefslogtreecommitdiffstats
path: root/source3/lib/system.c
Commit message (Collapse)AuthorAgeFilesLines
* s3-talloc Change TALLOC_ARRAY() to talloc_array()Andrew Bartlett2011-06-091-1/+1
| | | | | Using the standard macro makes it easier to move code into common, as TALLOC_ARRAY isn't standard talloc.
* Change sys_getcd() to take no arguments and always return malloc'ed memory ↵Jeremy Allison2011-06-011-7/+34
| | | | | | (or NULL). Part of the efforts to remove PATH_MAX on modern systems.
* lib/util Move sys_memalign into lib/util/system.cAndrew Bartlett2011-05-311-36/+0
|
* Fold null terminator into listlen length, change to strlcpy.Jeremy Allison2011-05-041-6/+4
|
* s3-system: move LOCK_ defines to lib/system.cGünther Deschner2011-05-031-0/+9
| | | | Guenther
* lib/util Move more network utility functions from source3 into lib/utilAndrew Bartlett2011-05-031-71/+0
| | | | | | This will help with the merge of the interfaces layer. Andrew Bartlett
* s3-includes: only include system/filesys.h when needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3-includes: only include system/passwd.h when needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3-includes: only include system/capability.h when needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3-includes: only include system/syslog.h when needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* lib/util/util_pw: share sys_get{pw,gr} group of calls.Günther Deschner2011-03-301-44/+0
| | | | Guenther
* dirfd doesn't exist in some platforms.Jeremy Allison2011-02-261-2/+4
| | | | | | | | | | | | | | | Hack that should get the buildfarm back to green. Ensure dirfd() needs to be defined before we properly return fdopendir. This will do until we get a proper dirfd() defined in libreplace. From http://www.gnu.org/software/hello/manual/gnulib/dirfd.html This function is missing on some platforms: AIX 7.1, HP-UX 11, OSF/1 5.1, Solaris 10, mingw. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat Feb 26 04:19:55 CET 2011 on sn-devel-104
* s3: move some defines to a better place.Günther Deschner2011-02-141-0/+11
| | | | Guenther
* s3-system: fix malloc/talloc mismatch in sys_popen().Günther Deschner2011-02-101-1/+1
| | | | Guenther
* Fix up some buildfarm warnings.Jeremy Allison2011-02-091-1/+1
|
* Add fdopendir().Jeremy Allison2011-02-081-0/+16
|
* Added call out to a Linux-compatible fallocate() when we need to extend a fileJeremy Allison2010-12-211-0/+35
| | | | | | | allocation extent without changing end-of-file size. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Tue Dec 21 02:41:24 CET 2010 on sn-devel-104
* s3: FreeBSD has getpeereid(), use itVolker Lendecke2010-12-191-0/+4
|
* Fix read/write calls over sockets to cope with EAGAIN/EWOULDBLOCK for ↵Jeremy Allison2010-12-151-10/+38
| | | | non-blocking sockets.
* s3: Fix a C++ warningVolker Lendecke2010-08-011-1/+1
|
* s3: fix calculation of st_blocks in init_stat_ex_from_statBjörn Jacke2010-06-091-1/+1
| | | | | | | this is just relevant for the very rare systems that don't have the st_blocks struct member. This is a fixup of the fix for bug 7474. Thanks to Joachim Schmitz for spotting this!
* s3: fix build on platforms without st_blocks and st_blksize stat struct membersBjörn Jacke2010-06-071-0/+9
| | | | This fixes bug 7474.
* Revert "Fix bug #7067 - Linux asynchronous IO (aio) can cause smbd to fail ↵Karolin Seeger2010-03-081-61/+4
| | | | | | | | | to respond to a read or write." This reverts commit a6ae7a552f851a399991262377cc0e062e40ac20. This fixes bug #7222 (All users have full rigths on all shares) (CVE-2010-0728). (cherry picked from commit 1c9494c76cc9686c61e0966f38528d3318f3176f)
* s3: optimize strict allocate for XFS on IRIXBjörn Jacke2010-02-181-0/+25
|
* Fix bug #7067 - Linux asynchronous IO (aio) can cause smbd to fail to ↵Jeremy Allison2010-01-261-4/+61
| | | | | | | | | respond to a read or write. Only works on Linux kernels 2.6.26 and above. Grants CAP_KILL capability to allow Linux threads under different euids to send signals to each other. Jeremy.
* s3: make sys_posix_fallocate more genericBjörn Jacke2009-12-081-4/+4
| | | | this is in preparation for other preallocation methods to be introduced.
* s3: Fix explicit stat64 supportVolker Lendecke2009-12-051-3/+12
|
* s3: check if glibc has broken posix_fallocateBjörn Jacke2009-12-041-1/+1
|
* s3: prefer posix_fallocate for doing "strict allocate"Björn Jacke2009-12-021-0/+14
| | | | | | | | | | | | | | | | posix_fallocate is more efficient than manual zero'ing the file. When preallocation in kernel space is supported it's extremely fast. Support for preallocation at fs layer via posix_fallocate and fallocate at kernel site can be found in Linux kernel 2.6.23/glibc 2.10 with ext4, XFS and OCFS2. Other systems that I know of which support fast preallocation in kernel space are AIX 6.1 with JFS2 and recent Solaris versions with ZFS maybe UFS2, too. People who have a system with preallocation in kernel space might want to set "strict allocate = yes". This reduces file fragentation and it's also safer for setups with quota being turned on. As of today most systems still don't have preallocation in kernel space, and that's why "strict allocate = no" will stay the default for now.
* s3: Pass the "fake dir create times" parameter to sys_*statVolker Lendecke2009-11-291-10/+14
| | | | Step 0 to restore it as a per-share paramter
* Remove "store create time" code, cause create time to be storedJeremy Allison2009-11-171-0/+7
| | | | | | | | | | | | in the "user.DOSATTRIB" EA. From the docs: In Samba 3.5.0 and above the "user.DOSATTRIB" extended attribute has been extended to store the create time for a file as well as the DOS attributes. This is done in a backwards compatible way so files created by Samba 3.5.0 and above can still have the DOS attribute read from this extended attribute by earlier versions of Samba, but they will not be able to read the create time stored there. Storing the create time separately from the normal filesystem meta-data allows Samba to faithfully reproduce NTFS semantics on top of a POSIX filesystem. Passes make test but will need more testing. Jeremy.
* s3: Fix a memleak in sys_popenVolker Lendecke2009-11-151-0/+1
| | | | Found with "dfree command" set
* s3: Add access_mask to the flock VFS callAbhidnya P Chirmule2009-10-061-1/+1
|
* Refactor the use of create_time and change time to goJeremy Allison2009-08-101-2/+2
| | | | | through functions. Will aid in making us pass RAW-SETFILEINFO. Jeremy.
* Fix a typo reading uninitialized memory. Caught by valgrind.Jeremy Allison2009-07-171-3/+1
| | | | Jeremy.
* Rename update_stat_ex_writetime() -> update_stat_ex_mtime()Jeremy Allison2009-07-081-2/+2
| | | | | to better describe what we're doing here. Jeremy
* The migration to struct stat_ex broke the calculation ofJeremy Allison2009-07-081-14/+58
| | | | | | | | | | | | | | | | create time from the existing timestamps (for systems that need to do this). Once the write time is changed via a sticky write, the create time might need to be recalculated. To do this I needed to add a bool into struct stat_ex to remember if the st_ex_btime field was calculated, or read from the OS. Also fixed the returning of modified write timestamps in the return from NTCreateX, SMBattr and SMBattrE (which weren't taking into account the modified timestamp stored in the open file table). Attempting to fix an issue with Excel 2003 and offline files. Volker and Metze, please review. Jeremy
* When faking a create time, use the full timespec values, not time_t.Jeremy Allison2009-07-081-61/+63
| | | | Jeremy.
* s3: correct check for usleep value boundariesBjörn Jacke2009-06-031-1/+1
|
* Attempt to fix the build on NetBSDVolker Lendecke2009-05-261-0/+6
|
* Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STATVolker Lendecke2009-05-261-9/+216
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces struct stat_ex { dev_t st_ex_dev; ino_t st_ex_ino; mode_t st_ex_mode; nlink_t st_ex_nlink; uid_t st_ex_uid; gid_t st_ex_gid; dev_t st_ex_rdev; off_t st_ex_size; struct timespec st_ex_atime; struct timespec st_ex_mtime; struct timespec st_ex_ctime; struct timespec st_ex_btime; /* birthtime */ blksize_t st_ex_blksize; blkcnt_t st_ex_blocks; }; typedef struct stat_ex SMB_STRUCT_STAT; It is really large because due to the friendly libc headers playing macro tricks with fields like st_ino, so I renamed them to st_ex_xxx. Why this change? To support birthtime, we already have quite a few #ifdef's at places where it does not really belong. With a stat struct that we control, we can consolidate the nanosecond timestamps and the birthtime deep in the VFS stat calls. At this moment it is triggered by a request to support the birthtime field for GPFS. GPFS does not extend the system level struct stat, but instead has a separate call that gets us the additional information beyond posix. Without being able to do that within the VFS stat calls, that support would have to be scattered around the main smbd code. It will very likely break all the onefs modules, but I think the changes will be reasonably easy to do.
* Fix some nonempty blank linesVolker Lendecke2009-05-141-23/+23
|
* Refactored sys_fork() and sys_pid() into shared util librarySteven Danneman2009-02-231-29/+0
| | | | | | | | | | This fixes a bug in 116ce19b, where we didn't clear the pid cache in become_daemon() and thus the /var/run/smbd.pid didn't match the actual pid of the parent process. Currently S4 will clear the pid cache on fork but doesn't yet take advantage of the pid cache by using sys_pid() instead of the direct get_pid().
* More warning fixes for Solaris.Jeremy Allison2009-02-231-2/+1
| | | | Jeremy.
* Add code to test write_data_iov a bitVolker Lendecke2008-12-291-0/+11
|
* Add sys_writevVolker Lendecke2008-12-291-0/+14
|
* Merge branch 'master' of /home/jelmer/samba3Jelmer Vernooij2008-11-011-153/+0
|\ | | | | | | | | | | | | | | | | Conflicts: lib/replace/README lib/replace/libreplace.m4 lib/replace/replace.c source3/include/proto.h source3/lib/system.c
| * Remove sys_dl*() - stubs are already provided by libreplace.Jelmer Vernooij2008-11-011-40/+0
| |
| * Remove sys_chroot() - libreplace already provides an alternative.Jelmer Vernooij2008-11-011-18/+0
| |
| * Move sys_realpath() to libreplace.Jelmer Vernooij2008-11-011-15/+0
| |