Skip to content

Commit 2c54453

Browse files
jcpunkFrostyX
authored andcommitted
permit dnf4 to check for reboot with non-root user
Resolves: #223 Signed-off-by: Pat Riehecky <riehecky@fnal.gov>
1 parent 8f21395 commit 2c54453

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tracer/controllers/default.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def create_reboot_required_file(self):
144144
If a reboot is needed, create a /run/reboot-required file.
145145
This is how Debian/Ubuntu distros does it.
146146
"""
147-
if self.applications.count_type(Applications.TYPES["STATIC"]):
147+
if os.getuid() == 0 and self.applications.count_type(Applications.TYPES["STATIC"]):
148148
with open("/run/reboot-required", "w") as fp:
149149
fp.write("Tracer says reboot is required for:\n")
150150
for app in self.applications.filter_types([Applications.TYPES["STATIC"]]).unique().sorted("name"):

tracer/packageManagers/rpm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def packages_newer_than(self, unix_time):
8282
try:
8383
packages = PackagesCollection()
8484
sqlite = self._database_file()
85-
conn = sqlite3.connect(sqlite)
85+
conn = sqlite3.connect('file:' + sqlite + '?mode=ro', uri=True)
8686
conn.row_factory = sqlite3.Row
8787
cursor = conn.cursor()
8888
cursor.execute(sql, [unix_time])

0 commit comments

Comments
 (0)