summaryrefslogtreecommitdiff
path: root/source3/lib/system.c
Commit message (Collapse)AuthorAgeFilesLines
* s3: VFS: Add SMB_VFS_FCNTLAnoop C S2019-10-081-0/+14
| | | | | | Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:lib: add update_stat_ex_from_saved_stat()Ralph Boehme2019-09-101-0/+20
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14121 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3: smbd: Add sys_mknodat() wrapper call.Jeremy Allison2019-08-221-0/+15
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* s3/lib: add update_stat_ex_file_id()Ralph Boehme2019-07-011-0/+6
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3/lib: add update_stat_ex_itime()Ralph Boehme2019-07-011-0/+7
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: add st_ex_file_id to struct stat_exRalph Boehme2019-07-011-0/+2
| | | | | | | | st_ex_file_id is an immutable, never reused numeric identifier for objects in a filesystem. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: add st_ex_itime to struct stat_exRalph Boehme2019-07-011-0/+3
| | | | | | | | st_ex_itime is an immutable original birth time aka instantiation time. Set when a file is created, never changes thereafter. May not be set by the client. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: convert struct stat_ex st_ex_calculated_birthtime bool to flagsRalph Boehme2019-07-011-5/+6
| | | | | | | Subsequent commits will add more flags, this paves the way. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:lib: Fix checking for config.h #define in system.cAndreas Schneider2018-12-161-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* s3:lib: Use #ifdef instead of #if for config.h definitionsAndreas Schneider2018-11-281-2/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* s3: VFS: Protect errno if sys_getwd() fails across free() call.Jeremy Allison2017-10-041-0/+4
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13069 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: VFS: Ensure sys_getwd() doesn't leak memory on error on really old systems.Jeremy Allison2017-10-041-1/+6
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13069 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* configure: Centralize check for posix_fallocateVolker Lendecke2017-08-241-1/+1
| | | | | | | | | | | | | This checks for posix_fallocate unless we are sitting on an ancient glibc. With this we don't need HAVE_BROKEN_POSIX_FALLOCATE anymore, HAVE_POSIX_FALLOCATE will only be defined if we have a valid [g]libc. ./configure tested on Debian, FreeBSD (which does have posix_fallocate) and OpenBSD (which does not have posix_fallocate). Also tested with changing the not have an old-enough glibc around. All did the right thing. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:lib: Fix incorrect logic in sys_broken_getgroups()Jeremy Allison2017-04-181-5/+7
| | | | | | | | | If setlen == 0 then the second argument must be ignored. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12747 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* lib: Extract sys_popen()Volker Lendecke2016-02-231-231/+0
| | | | | | | | | | | | This was added by Jeremy with 3cf31a194f5, do the (C) accordingly sys_popen is a pretty isolated functionality, and I'd like to use it soon without "includes.h", needed by "proto.h" Except for one malloc->talloc this is supposed to be a 1:1 copy Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* lib: Remove sys_waitpidVolker Lendecke2016-02-231-14/+1
| | | | | | | We have waitpid in libreplace Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3-lib: introduce sys_realpath()Uri Simchoni2016-01-271-0/+25
| | | | | | | | Add sys_realpath() function that captures the OS variations on realpath(). Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Convert all uint32/16/8 to _t in source3/lib.Richard Sharpe2015-05-131-4/+4
| | | | | Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Change all uses of uint32/16/8 in proto.h to uint32_t/16_t/8_t.Richard Sharpe2015-04-291-3/+3
| | | | | Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* system: add hole punch support to sys_fallocate()David Disseldorp2015-03-091-2/+9
| | | | | | | | If Samba is configured with FALLOC_FL_PUNCH_HOLE support, then allow sys_fallocate() to propogate the flag to syscall invocation. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3/vfs: change fallocate mode flags from enum->uint32_tDavid Disseldorp2015-03-091-10/+11
| | | | | | | | | | | | | | | | | | | | The Linux fallocate syscall offers a mode parameter which can take the following flags: FALLOC_FL_KEEP_SIZE FALLOC_FL_PUNCH_HOLE (since 2.6.38) FALLOC_FL_COLLAPSE_RANGE (since 3.15) FALLOC_FL_ZERO_RANGE (since 3.14) The flags are not exclusive, e.g. FALLOC_FL_PUNCH_HOLE must be specified alongside FALLOC_FL_KEEP_SIZE. Samba currently takes a vfs_fallocate_mode enum parameter for the VFS fallocate hook, taking either an EXTEND_SIZE or KEEP_SIZE value. This commit changes the fallocate hook such that it accepts a uint32_t flags parameter, in preparation for PUNCH_HOLE and ZERO_RANGE support. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib/system: remove useless HAVE_LINUX_FALLOCATE64 logicDavid Disseldorp2015-03-091-3/+1
| | | | | Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Split out sys_[read|write] & friendsVolker Lendecke2014-12-071-90/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Remove a few #ifdef EWOULDBLOCkVolker Lendecke2014-09-181-16/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* s3: nmbd: Fix bug 10633 - nmbd denial of serviceJeremy Allison2014-06-251-5/+2
| | | | | | | | | | | | | | | | | The Linux kernel has a bug in that it can give spurious wakeups on a non-blocking UDP socket for a non-deliverable packet. When nmbd was changed to use non-blocking sockets it became vulnerable to a spurious wakeup from poll/epoll. Fix sys_recvfile() to return on EWOULDBLOCK/EAGAIN. CVE-2014-0244 https://bugzilla.samba.org/show_bug.cgi?id=10633 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3: Add DAC_OVERRIDE capability supportAbhidnya Joshi2013-12-161-0/+4
| | | | | Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* debug: remove unused sys_adminlogDavid Disseldorp2013-11-201-25/+0
| | | | | | | | | | printing.c was the last user of this syslog wrapper. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Wed Nov 20 10:19:32 CET 2013 on sn-devel-104
* s3:lib/system fix build on AIX 7Christian Ambach2013-08-021-3/+12
| | | | | | | | | | | AIX uses struct stat64 with struct timespec64, so direct assignment does not work any more. Pair-Programmed-With: Volker Lendecke <vl@samba.org> Signed-off-by: Christian Ambach <ambi@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri Aug 2 09:47:43 CEST 2013 on sn-devel-104
* Remove dependency on detection of HAVE_DIRFD for use of fdopendir().Jeremy Allison2013-04-121-3/+1
| | | | | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Apr 12 16:21:10 CEST 2013 on sn-devel-104
* s3: in sys_popen(), add a debug message for failed forkMichael Adam2012-09-041-0/+1
| | | | | Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Tue Sep 4 22:17:30 CEST 2012 on sn-devel-104
* s3: in sys_popen(), add a debug message for failed extract_args()Michael Adam2012-09-041-0/+1
|
* s3: in sys_popen(), untangle function call from result checkMichael Adam2012-09-041-1/+3
|
* s3: in sys_popen(), untangle assigment from check and add a debug message in ↵Michael Adam2012-09-041-1/+4
| | | | failure case
* s3: in sys_popen(), improve call to pipe and report error to debugMichael Adam2012-09-041-1/+5
|
* s3: in sys_popen(), validate input before opening the pipe.Michael Adam2012-09-041-5/+5
|
* s3: in sys_popen(), fix a debug messageMichael Adam2012-09-041-1/+1
|
* s3: add a debug message for failed execv in sys_popen()Michael Adam2012-08-171-1/+6
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3-aio: Remove unused VFS functions and moreVolker Lendecke2012-07-181-148/+0
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: Make smbd/aio.c not depend on aio.h anymoreVolker Lendecke2012-07-181-0/+4
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* Replace all uses of setXX[ug]id() and setgroups with samba_setXX[ug]id() calls.Jeremy Allison2012-06-281-4/+5
| | | | | | Will allow thread-specific credentials to be added by modifying the central definitions. Deliberately left the setXX[ug]id() call in popt as this is not used in Samba.
* Revert "s3-lib Remove unused sys_fcntl_long()"Stefan Metzmacher2012-06-191-0/+14
| | | | | | | | This reverts commit 846a697e20478798288afb43cdb7a9f389a15c69. This is still used in source3/smbd/oplock_irix.c metze
* build: Rationalise AIO support in configure, ensure on by defaultAndrew Bartlett2012-06-061-3/+3
| | | | | | | | | With this change, the define to check for AIO is HAVE_AIO, consistant with other subsystems. It is now also on by default in the autoconf build, as it has been for waf. Andrew Bartlett
* lib/replace: xattr wrappers in lib/replace rather than source3/lib/system.cAndrew Bartlett2012-06-021-678/+0
| | | | | | | This also moves all the still-used configure tests etc. The unused OSF API is also removed at this time. Andrew Bartlett
* build: Remove SMB_OFF_T, replace with off_tAndrew Bartlett2012-04-061-5/+5
| | | | | | | | | Now that we always require a 64 bit off_t, we no longer need SMB_OFF_T. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Fri Apr 6 01:47:43 CEST 2012 on sn-devel-104
* s3-vfs: Remove unused lremovexattr call from VFS modules, system.c and configureAndrew Bartlett2012-04-051-37/+0
| | | | | | | If this is ever needed again, it would be more appropriate as an options argument to removexattr. Andrew Bartlett
* s3-vfs: Remove unused lsetxattr call from VFS modules, system.c and configureAndrew Bartlett2012-04-051-64/+0
| | | | | | | If this is ever needed again, it would be more appropriate as an options argument to listxattr. Andrew Bartlett
* s3-vfs: Remove unused llistxattr call from VFS modules, system.c and configureAndrew Bartlett2012-04-051-29/+0
| | | | | | | If this is ever needed again, it would be more appropriate as an options argument to listxattr. Andrew Bartlett
* s3-vfs: Remove unused lgetxattr call from VFS modules, system.c and configureAndrew Bartlett2012-04-051-51/+0
|
* build: Remove SMB_STRUCT_DIR defineAndrew Bartlett2012-04-051-1/+1
|
* build: Remove sys_rewinddir wrapperAndrew Bartlett2012-04-051-8/+0
|