Skip to content

Commit

Permalink
INI: remove unused helpers
Browse files Browse the repository at this point in the history
Btw, `sss_ini_get_mtime()` could access uninitialized 'self->cstat'
  • Loading branch information
alexey-tikhonov committed Oct 23, 2024
1 parent 88b55de commit 99e6242
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 37 deletions.
1 change: 0 additions & 1 deletion src/tests/cmocka/test_config_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ struct sss_ini {
struct ref_array *ra_error_list;
struct ini_cfgobj *sssd_config;
struct value_obj *obj;
const struct stat *cstat;
struct ini_cfgfile *file;
bool main_config_exists;
};
Expand Down
24 changes: 0 additions & 24 deletions src/util/sss_ini.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ struct sss_ini {
struct ref_array *ra_error_list;
struct ini_cfgobj *sssd_config;
struct value_obj *obj;
const struct stat *cstat;
struct ini_cfgfile *file;
bool main_config_exists;
};
Expand Down Expand Up @@ -192,29 +191,6 @@ static int sss_ini_access_check(struct sss_ini *self)



/* Get cstat */

int sss_ini_get_stat(struct sss_ini *self)
{
self->cstat = ini_config_get_stat(self->file);

if (!self->cstat) return EIO;

return EOK;
}



/* Get mtime */

int sss_ini_get_mtime(struct sss_ini *self,
size_t timestr_len,
char *timestr)
{
return snprintf(timestr, timestr_len, "%llu",
(long long unsigned)self->cstat->st_mtime);
}

/* Get file_exists */

bool sss_ini_exists(struct sss_ini *self)
Expand Down
12 changes: 0 additions & 12 deletions src/util/sss_ini.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,6 @@ int sss_ini_open(struct sss_ini *self,
*/
bool sss_ini_exists(struct sss_ini *self);

/**
* @brief get Cstat structure of the ini file
*/
int sss_ini_get_stat(struct sss_ini *self);

/**
* @brief Get mtime of the ini file
*/
int sss_ini_get_mtime(struct sss_ini *self,
size_t timestr_len,
char *timestr);

/**
* @brief Get pointer to list of snippet parsing errors
*/
Expand Down

0 comments on commit 99e6242

Please sign in to comment.