summaryrefslogtreecommitdiffstats
path: root/source3/lib/system.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
| |
| * Move sys_lchown() to libreplace.Jelmer Vernooij2008-11-011-19/+0
| |
| * Move sys_symlink() to libreplace.Jelmer Vernooij2008-11-011-14/+0
| |
| * Move sys_readlink() to libreplace.Jelmer Vernooij2008-11-011-14/+0
| |
| * Move sys_link to libreplace.Jelmer Vernooij2008-11-011-14/+0
| |
| * Move sys_chown() to rep_chown().Jelmer Vernooij2008-11-011-19/+0
| |
* | Use dup2() replacement from libreplace.Jelmer Vernooij2008-11-011-10/+0
|/
* Fix Bug #5285. (libcap header mismatch)Günther Deschner2008-05-281-0/+5
| | | | | | | | | | Can someone with gpfs available test this ? The only codepath using this function is the modules/gpfs.c module. The fix resolves at least the build issues Samba has with recent kernel / libcap versions by using the portable cap_get_proc()/cap_set_proc() interface (instead of using capget/capset). Guenther (This used to be commit 177955141247a4eb56ba0d82dc1add7f52175c40)
* Some systems do not have XATTR_ definedVolker Lendecke2008-01-201-5/+0
| | | | (This used to be commit 2cac1d3919a96c480f34c93d8b9b07782d46ed23)
* Many systems don't have sa_len as part of struct sockaddr.Jeremy Allison2007-12-091-1/+1
| | | | | | | Revert 5c347cb46d85d04bbba7c99dca7ff9628f977d84 "Choose a better default for sockaddr length.". Jeremy. (This used to be commit 677ac6adc38b0747f825ee597e0502277a8f74b1)
* Choose a better default for sockaddr length.James Peach2007-12-091-1/+1
| | | | (This used to be commit 5c347cb46d85d04bbba7c99dca7ff9628f977d84)
* Fix connect(2) callers to use correct sockaddr size.James Peach2007-12-091-0/+18
| | | | | | | | | | Some systems (eg Mac OSX 10.5) require the length passed to match the socket address family. This introduces sys_connect() that does the right thing, and replaces all uses oc connect(2) with sys_connect(). Note that there are some LGPL callers that still call connect(2) directly. (This used to be commit e1bfdc17c49da582cdf907e260301ab1946b2ed3)
* Don't build rpctorture anymore - not maintained. Just remove.Jeremy Allison2007-12-071-1/+0
| | | | | | | Remove all vestiges of pstring (except for smbctool as noted in previous commit). Jeremy (This used to be commit 4c32a22ac50ada3275d2ffba3c1aa08bee7d1549)
* Remove workaround for broken capabilites.h from lib/system.c - now in ↵Michael Adam2007-12-031-18/+0
| | | | | | | lib/replace. Michael (This used to be commit a3fbb5323222334c86c0dc360df8c6a39039bbe6)
* 1. lib/system.c (xattr code for Solaris) could not beTomoki AONO2007-11-261-3/+6
| | | | | | built against c90 compilers. (declaration after statement.) Sample patch attached. (This used to be commit 102a247df99967f25dbaf40c9be2d48a8e15c64c)
* Always define PATH_MAX. Makes code simpler (removesJeremy Allison2007-11-101-4/+0
| | | | | | a bunch of #defines). Remove pstring from msdfs.c. Jeremy. (This used to be commit e203ba22275320808bc11b17361ad1f2d5b0b897)
* remove faked_create_user() BUILD_FARM hack as we have nss_wrapper nowStefan Metzmacher2007-11-091-77/+0
| | | | | metze (This used to be commit fc98c1904865608509a01911afa46de74873ef41)
* Fix Solaris by ensuring we use the IPv4 or IPv6 lengthJeremy Allison2007-11-021-0/+24
| | | | | | in any getnameinfo calls. Jeremy (This used to be commit 4d7badb0c44f287034f58d9a412e662c0fbecdc9)
* RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison2007-10-181-2/+2
| | | | | | | | bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
* Move to protocol independent code in most of lib/util_sock.cJeremy Allison2007-10-151-43/+0
| | | | | | | | | | We don't use gethostbyname any more except in one case where we're looking for host aliases (I don't know how to do that with getaddrinfo yet). New function should be getaddrinfo(). Next step will be fixing lib/access.c, and then changing libsmb/namequery.c to cope with IPv6 address returns. Jeremy. (This used to be commit 4a56b697b6adcf095e25895c4a9ba3192ed34124)
* r25505: Add a replacement (IPv4 only) implementation of getaddrinfo/freeaddrinfoJeremy Allison2007-10-101-4/+4
| | | | | | | | | under the 2 clause *BSD license for future use in IPv6 code. Original code was from PostgreSQL and I've maintained their license even though I've rewritten large parts of it (I probably should donate this back to them). Jeremy. (This used to be commit 760d993340a966269d71acfb7a6b5e4d3776ac5d)
* r25172: Remove commented out code we will never enable.Jeremy Allison2007-10-101-172/+0
| | | | | Jeremy. (This used to be commit 6032fbc358c5015b2b6a23e13d978bf41ef9e5f3)
* r25117: The mega-patch Jerry was waiting for. Remove all pstrings fromJeremy Allison2007-10-101-0/+4
| | | | | | | | | the main server code paths. We should now be able to cope with paths up to PATH_MAX length now. Final job will be to add the TALLOC_CTX * parameter to unix_convert to make it explicit (for Volker). Jeremy. (This used to be commit 7f0db75fb0f24873577dcb758a2ecee74fdc4297)
* r24547: Fix #4897, patch from David S. Collier-Brown <davecb@spamcop.net> -- ↵Volker Lendecke2007-10-101-6/+6
| | | | | | Thanks! (This used to be commit 4a90264d173ef5a870f2a44554c3bb9e738e98fb)
* r24304: patch from Bjoern JAcke <bj@SerNet.DE>:Stefan Metzmacher2007-10-101-0/+242
| | | | | | | | attached patches add EA support for Solaris. If no one disagrees, can someone check this in please? metze (This used to be commit 81e5afc363e1f0bdc4768c0f5c696f4152fe5b44)
* r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell2007-10-101-2/+1
| | | | (This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)
* r23779: Change from v2 or later to v3 or later.Jeremy Allison2007-10-101-1/+1
| | | | | Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
* r23658: One pstring a day....Volker Lendecke2007-10-101-16/+39
| | | | | | This one was particularly tasty, it was a static one. So 1k less footprint per process. (This used to be commit 83865e32889e2d29086ae9d9701713fc74b09175)
* r23576: Fix some confusion between HAVE_BROKEN_GETGROUPS and USE_BSD_SETGROUPS.James Peach2007-10-101-4/+4
| | | | (This used to be commit 8f6cf4b8c2568c737fa31494b844ae021a42a4fc)
* r23566: Fix the sys_bsd_setgroups function. The actual workaround was inactive.Michael Adam2007-10-101-3/+1
| | | | | Michael (This used to be commit 4b5d9b2ba773e6ce57c38e3c0d5af72ad5a98b51)
* r23475: Fix the prototype for sys_broken_setgroups and log *BSD group listJames Peach2007-10-101-2/+2
| | | | | truncation a bit more verbosely. (This used to be commit e3ea997289f9f2613c304c016b42b2d35af48c84)
* r23470: Fix supplementary group list truncation for *BSD. We need to passJames Peach2007-10-101-2/+8
| | | | | | the correct group list length and only truncate to NGROUPS_MAX if it is too long. (This used to be commit 07f562be7a64a2ded7ec0e6f5910447dc5b8b85f)
* r23393: Support BSD group semantics by making sure that the effective GID is ↵James Peach2007-10-101-25/+101
| | | | | | | always passed as the first GID when calling setgroups(2). (This used to be commit 6ebaf856c1d27f2fbfa0444a5c6c17c4331d2780)
* r23105: Add lchown to the vfs layer. We need this in the POSIX code.Jeremy Allison2007-10-101-0/+19
| | | | | Jeremy. (This used to be commit 932523cbb508db869b726768e86bfa8e248f768b)