[SOLVED] Is there a way to blacklist a specific file in a package from being updated by slackpkg?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Is there a way to blacklist a specific file in a package from being updated by slackpkg?
I have a file from the KDE package, kcheckpass, to which I have made some customizations. When doing `slackpkg upgrade` I do want all other KDE files to get updated, but not this one file.
The slackbuild for kcheckpass would need to be updated to install that one file as foo.new so that it could be merged later with 'slackpkg new-config'. Depending on what file this is there may be a better alternative solution or if not you could suggest this be done in this thread for current.
You can enter it in the /etc/slackpkg/blacklist file.
The file is very nicely annotated and slackpkg does indeed honor it.
Really? I just need to put the file name in /etc/slackpkg/blacklist? I've read the "annotations" and only see mention of packages, not files. ARE YOU SURE? phenixia2003, seemed to think not. If that is possible, what would the syntax be? The full pathname or just the filename?
I am curious to know why and how you customized a binary file
Indeed, I will tell you and perhaps it can be useful to others. I am using this computer as an Active Directory member. To do that, the AD Member requires PAM, which Slackware does not ship. To implement PAM I use Ivandi's PAM package for Slackware http://www.bisdesign.ca/ivandi/slackware/PAM-packages/. For a lengthy discussion on all that see thread https://www.linuxquestions.org/quest...mba-4175583996. Ivandi uses SLACKmate, not KDE and he does not have a PAM'd KDE in his package. So, I identified the module KDE uses for authentication when the desktop times-out: kcheckpass (see page 8 of the above reference LQ link for the discussion on this).
I've renamed the real kcheckpass to kcheckpass.kde and I've created a script, kcheckpass, to do AD Authentication directly using ntlm_auth. The script is as follows:
Code:
#!/bin/bash
# This script is run by KDE when the the screenlocker timeout expires and a password is requested.
# Determine if the user is a domain user or local user
x=`cut -d: -f1 /etc/passwd | grep $USER`
# If a local user, run the standard kcheckpass
if [ -n "$x" ]
then
`dirname $0`/kcheckpass.kde $*
rc=$?
exit $rc
fi
# get the file descriptor for retrieving the password entered
# This will be a command line argument "-S <fd>"
while [ 1 == 1 ]
do
if [ -z "$1" ] # no more args, bad!
then
exit 4
fi
x=`echo $1 | cut -c1-2`
if [ "$x" = "-S" ] # found the file descriptor parameter
then
fd="$2"
break
fi
shift
done
# Now, get password entered by user
passwd=`$(dirname $0)/getkcheckPW $fd`
x=`ntlm_auth --username="$USER" --password="$passwd" 2>&1`
rc=$?
y=`echo "$x" | grep PASSWORD_EXPIRED`
# If expired, let the user log in anyway. Otherwise, no way to change PW
# A subsequent login attempt will force it.
if [ -n "$y" ]; then rc=0; fi
# THE FOLLOWING APPEARS TO BE NOT NECESSARY. THE EXIT $rc
# CAUSES A PW CHANGE TO BE INITIATED.
##########################################################
# Login Failed. See if the problem is an expired password.
#if [ "$rc" != 0 ]
#then
# y=`echo "$x" | grep PASSWORD_EXPIRED`
# if [ -n "$y" ] # Yes, expired. Get new password
# then
# /user/util/bin/newpass "$USER" "$passwd"
# rc=$?
# fi
#fi
exit $rc
The executable getkcheckPW is a compiled C program, source:
Code:
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
main(int argc, char *argv[])
{
int fd; /* file descriptor */
int convGetHidden = 2; /* code give to (presumably) kscreenlocker_greet for type of ... */
int cnt;
int l; /* length of password */
char passwd[80]; /* buffer to hold returned password */
if (argc < 2) exit(-1); /* expecting file descriptor as arg */
fd = atoi(argv[1]);
write(fd, &convGetHidden, sizeof(convGetHidden)); /* conv_server type ... */
/* kcheckpass.c sends a prompt of zero length for convGetHidden */
cnt = 0;
write(fd, &cnt, sizeof(cnt));
cnt = read(fd, &l, sizeof(l)); /* Get length of entered password */
cnt = read(fd, passwd, l); /* Get password */
printf("%s\n", passwd);
exit(0);
}
Alternatively, I could have thrashed through figuring out how to PAMify KDE, but this script and C program seemed easier.
Quote:
If you really did that, just save it and restore it after having upgraded kde-workspace, that ships it.
Yes, that's likely the route I'll take.
And, my apologies, apparently I asked this question already and totally forgot about it; nor did I bother searching before posting the current question: https://www.linuxquestions.org/quest...ram-4175590670, with ponce and BCary mentioning the chattr solution. In re-reading that thread I realize that I *do* want the original kcheckpass to get updated (since I end up using it for local users), so my solution should be:
Really? I just need to put the file name in /etc/slackpkg/blacklist? I've read the "annotations" and only see mention of packages, not files. ARE YOU SURE? phenixia2003, seemed to think not. If that is possible, what would the syntax be? The full pathname or just the filename?
I think frankbell missed that you were talking about just a single file within a package. No, the blacklist won't support single files, only package names.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.