Declare argument of nss_init const
nss_init() does not modify its path argument, thus declare it const. Also drop superfluous prototype. nss.c:54:31: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 54 | nsswitch_path = NSSWITCH; | ^
This commit is contained in:
parent
946eb84182
commit
119cee142e
|
@ -38,7 +38,7 @@ static void nss_exit(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// nsswitch_path is an argument only to support testing.
|
// nsswitch_path is an argument only to support testing.
|
||||||
void nss_init(char *nsswitch_path) {
|
void nss_init(const char *nsswitch_path) {
|
||||||
FILE *nssfp = NULL;
|
FILE *nssfp = NULL;
|
||||||
char *line = NULL, *p, *token, *saveptr;
|
char *line = NULL, *p, *token, *saveptr;
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
|
|
|
@ -242,7 +242,7 @@ extern /*@null@*//*@only@*/struct passwd *get_my_pwent (void);
|
||||||
|
|
||||||
/* nss.c */
|
/* nss.c */
|
||||||
#include <libsubid/subid.h>
|
#include <libsubid/subid.h>
|
||||||
extern void nss_init(char *nsswitch_path);
|
extern void nss_init(const char *nsswitch_path);
|
||||||
extern bool nss_is_initialized(void);
|
extern bool nss_is_initialized(void);
|
||||||
|
|
||||||
struct subid_nss_ops {
|
struct subid_nss_ops {
|
||||||
|
|
|
@ -17,7 +17,5 @@ extern struct map_range *get_map_ranges(int ranges, int argc, char **argv);
|
||||||
extern void write_mapping(int proc_dir_fd, int ranges,
|
extern void write_mapping(int proc_dir_fd, int ranges,
|
||||||
struct map_range *mappings, const char *map_file, uid_t ruid);
|
struct map_range *mappings, const char *map_file, uid_t ruid);
|
||||||
|
|
||||||
extern void nss_init(char *nsswitch_path);
|
|
||||||
|
|
||||||
#endif /* _ID_MAPPING_H_ */
|
#endif /* _ID_MAPPING_H_ */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user