Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pam-auth-update
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Denis Pynkin
pam-auth-update
Commits
76caa895
Commit
76caa895
authored
6 years ago
by
Denis Pynkin
Browse files
Options
Downloads
Patches
Plain Diff
Do not include package on removal
parent
8c1aba71
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/common_conf.c
+6
-1
6 additions, 1 deletion
src/common_conf.c
src/pam-auth-update.c
+1
-1
1 addition, 1 deletion
src/pam-auth-update.c
src/parse_args.c
+3
-1
3 additions, 1 deletion
src/parse_args.c
src/parse_args.h
+1
-1
1 addition, 1 deletion
src/parse_args.h
with
11 additions
and
4 deletions
src/common_conf.c
+
6
−
1
View file @
76caa895
...
...
@@ -140,7 +140,7 @@ static int conf_files_filter(const struct dirent *entry){
return
(
st
.
st_mode
&
S_IFREG
);
}
int
read_common_conf
()
{
int
read_common_conf
(
args_t
*
args
)
{
char
fname
[
FILENAME_SIZE
];
DIR
*
dir
;
int
entries
;
...
...
@@ -156,6 +156,11 @@ int read_common_conf() {
if
(
configs
[
entries
]
->
d_name
==
NULL
)
continue
;
/* Do not read the config on package removal */
if
(
args
->
remove
&&
strcmp
(
configs
[
entries
]
->
d_name
,
args
->
package_name
)
==
0
)
continue
;
snprintf
(
fname
,
sizeof
(
fname
),
"%s/%s"
,
configdir
,
configs
[
entries
]
->
d_name
);
DBGPRINT
(
"Config found: %s
\n
"
,
fname
);
free
(
configs
[
entries
]);
...
...
This diff is collapsed.
Click to expand it.
src/pam-auth-update.c
+
1
−
1
View file @
76caa895
...
...
@@ -34,7 +34,7 @@ int main(int argc, char **argv) {
if
(
init_common_conf
()){
exit
(
1
);
}
if
(
read_common_conf
()){
if
(
read_common_conf
(
&
args
)){
exit
(
1
);
}
...
...
This diff is collapsed.
Click to expand it.
src/parse_args.c
+
3
−
1
View file @
76caa895
...
...
@@ -6,6 +6,7 @@
#include
<getopt.h>
#include
<string.h>
#include
<stdlib.h>
#include
<pam-auth-update.h>
#include
<parse_args.h>
...
...
@@ -74,7 +75,8 @@ int parse_args(args_t *args, int argc, char **argv){
}
/* get the name of package from environment */
if
(
args
->
package
)
{
if
(
args
->
package
||
args
->
remove
)
{
args
->
package_name
=
getenv
(
"DPKG_MAINTSCRIPT_NAME"
);
}
/* Set default system values if not set via command line */
...
...
This diff is collapsed.
Click to expand it.
src/parse_args.h
+
1
−
1
View file @
76caa895
...
...
@@ -13,7 +13,7 @@ typedef struct args {
int
force
;
int
remove
;
int
package
;
char
package_name
[
256
]
;
char
*
package_name
;
}
args_t
;
int
parse_args
(
args_t
*
args
,
int
argc
,
char
**
argv
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment