diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-07-29 03:08:05 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-07-29 03:08:05 +0000 |
commit | 64578c0589a3a741f81fb55c16eeb882128da00b (patch) | |
tree | 8b650156e44e4d39af8625185d857a88789b8074 /source3/locking/locking_slow.c | |
parent | c48b3fce6be6d5d952cbcda0ddae223dda5a576f (diff) | |
download | samba-64578c0589a3a741f81fb55c16eeb882128da00b.tar.gz samba-64578c0589a3a741f81fb55c16eeb882128da00b.tar.bz2 samba-64578c0589a3a741f81fb55c16eeb882128da00b.zip |
merge from the autoconf2 branch to the main branch
(This used to be commit 3bda7ac417107a7b01d91805ca71c4330657ed21)
Diffstat (limited to 'source3/locking/locking_slow.c')
-rw-r--r-- | source3/locking/locking_slow.c | 46 |
1 files changed, 7 insertions, 39 deletions
diff --git a/source3/locking/locking_slow.c b/source3/locking/locking_slow.c index 183acd1f44..1f8f962ac9 100644 --- a/source3/locking/locking_slow.c +++ b/source3/locking/locking_slow.c @@ -33,6 +33,9 @@ */ #include "includes.h" + +#ifndef FAST_SHARE_MODES + extern int DEBUGLEVEL; extern connection_struct Connections[]; extern files_struct Files[]; @@ -504,17 +507,8 @@ mode file %s (%s)\n", fname, strerror(errno))); return 0; } /* Now truncate the file at this point. */ -#ifdef FTRUNCATE_NEEDS_ROOT - become_root(False); -#endif /* FTRUNCATE_NEEDS_ROOT */ - if(ftruncate(fd, newsize)!= 0) { - -#ifdef FTRUNCATE_NEEDS_ROOT - unbecome_root(False); -#endif /* FTRUNCATE_NEEDS_ROOT */ - DEBUG(0,("ERROR: get_share_modes: failed to ftruncate share \ mode file %s to size %d (%s)\n", fname, newsize, strerror(errno))); if(*old_shares) @@ -526,10 +520,6 @@ mode file %s to size %d (%s)\n", fname, newsize, strerror(errno))); } } -#ifdef FTRUNCATE_NEEDS_ROOT - unbecome_root(False); -#endif /* FTRUNCATE_NEEDS_ROOT */ - if(buf) free(buf); @@ -670,27 +660,14 @@ mode file %s (%s)\n", fname, strerror(errno))); } /* Now truncate the file at this point. */ -#ifdef FTRUNCATE_NEEDS_ROOT - become_root(False); -#endif /* FTRUNCATE_NEEDS_ROOT */ - if(ftruncate(fd, newsize) != 0) { - -#ifdef FTRUNCATE_NEEDS_ROOT - unbecome_root(False); -#endif /* FTRUNCATE_NEEDS_ROOT */ - DEBUG(0,("ERROR: del_share_mode: failed to ftruncate share \ mode file %s to size %d (%s)\n", fname, newsize, strerror(errno))); if(buf) free(buf); return; } - -#ifdef FTRUNCATE_NEEDS_ROOT - unbecome_root(False); -#endif /* FTRUNCATE_NEEDS_ROOT */ } /******************************************************************* @@ -825,17 +802,8 @@ deleting it (%s).\n",fname, strerror(errno))); /* Now truncate the file at this point - just for safety. */ -#ifdef FTRUNCATE_NEEDS_ROOT - become_root(False); -#endif /* FTRUNCATE_NEEDS_ROOT */ - if(ftruncate(fd, header_size + (SMF_ENTRY_LENGTH*num_entries))!= 0) { - -#ifdef FTRUNCATE_NEEDS_ROOT - unbecome_root(False); -#endif /* FTRUNCATE_NEEDS_ROOT */ - DEBUG(0,("ERROR: set_share_mode: failed to ftruncate share \ mode file %s to size %d (%s)\n", fname, header_size + (SMF_ENTRY_LENGTH*num_entries), strerror(errno))); @@ -844,10 +812,6 @@ mode file %s to size %d (%s)\n", fname, header_size + (SMF_ENTRY_LENGTH*num_entr return False; } -#ifdef FTRUNCATE_NEEDS_ROOT - unbecome_root(False); -#endif /* FTRUNCATE_NEEDS_ROOT */ - if(buf) free(buf); @@ -1093,3 +1057,7 @@ struct share_ops *locking_slow_init(int ronly) return &share_ops; } +#else + int locking_slow_dummy_procedure(void) +{return 0;} +#endif /* !FAST_SHARE_MODES */ |