mirror of
https://github.com/samba-team/samba.git
synced 2025-08-04 08:22:08 +03:00
s3-eventlog: Make sure the eventlog directory exists.
Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
This commit is contained in:
committed by
Günther Deschner
parent
ae6947cc48
commit
6fd4724fb9
@ -340,6 +340,7 @@ ELOG_TDB *elog_open_tdb( const char *logname, bool force_clear, bool read_only )
|
||||
ELOG_TDB *tdb_node = NULL;
|
||||
char *eventlogdir;
|
||||
TALLOC_CTX *ctx = talloc_tos();
|
||||
bool ok;
|
||||
|
||||
/* check for invalid options */
|
||||
|
||||
@ -372,8 +373,10 @@ ELOG_TDB *elog_open_tdb( const char *logname, bool force_clear, bool read_only )
|
||||
/* make sure that the eventlog dir exists */
|
||||
|
||||
eventlogdir = state_path( "eventlog" );
|
||||
if ( !directory_exist( eventlogdir ) )
|
||||
mkdir( eventlogdir, 0755 );
|
||||
ok = directory_create_or_exist(eventlogdir, geteuid(), 0755);
|
||||
if (!ok) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* get the path on disk */
|
||||
|
||||
|
Reference in New Issue
Block a user