LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-22-2017, 12:33 PM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Rep: Reputation: 177Reputation: 177
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.

Is there a way to blacklist a single file?
 
Old 09-22-2017, 12:38 PM   #2
phenixia2003
Senior Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 1,052

Rep: Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008
Hello,

No. slackpkg has no control over files in packages. Only installpkg could do that, but it does not include such a feature.

--
SeB
 
Old 09-22-2017, 12:45 PM   #3
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Rep: Reputation: Disabled
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.

https://www.linuxquestions.org/quest...-a-4175561577/
 
Old 09-22-2017, 01:05 PM   #4
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
Code:
didier[~]$ file /usr/lib64/kde4/libexec/kcheckpass 
/usr/lib64/kde4/libexec/kcheckpass: setuid, setgid ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, stripped
didier[~]$
I am curious to know why and how you customized a binary file

If you really did that, just save it and restore it after having upgraded kde-workspace, that ships it.
 
1 members found this post helpful.
Old 09-22-2017, 02:10 PM   #5
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Rep: Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161
Quote:
Is there a way to blacklist a single file?
chattr +i /usr/bin/kcheckpass
 
2 members found this post helpful.
Old 09-23-2017, 09:00 PM   #6
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,323
Blog Entries: 28

Rep: Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141
You can enter it in the /etc/slackpkg/blacklist file.

The file is very nicely annotated and slackpkg does indeed honor it.
 
Old 09-23-2017, 09:39 PM   #7
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Original Poster
Rep: Reputation: 177Reputation: 177
Quote:
Originally Posted by frankbell View Post
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?
Quote:
Originally Posted by Didier Spaier View Post
Code:
didier[~]$ file /usr/lib64/kde4/libexec/kcheckpass 
/usr/lib64/kde4/libexec/kcheckpass: setuid, setgid ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, stripped
didier[~]$
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:
  1. Rename or move my kcheckpass script.
  2. Rename kcheckpass.kde back to kcheckpass.
  3. Do the upgrade.
  4. Reverse steps 1 and 2.

Last edited by mfoley; 09-23-2017 at 10:06 PM.
 
1 members found this post helpful.
Old 09-23-2017, 10:19 PM   #8
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by mfoley View Post
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.
 
  


Reply

Tags
blacklist, slackpkg



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] slackpkg blacklist for pi(3) Tonus Slackware - ARM 5 04-07-2016 02:35 AM
[SOLVED] slackpkg blacklist question Woodsman Slackware 3 10-23-2013 04:37 PM
[SOLVED] aaa_elflibs not blacklisted in /etc/slackpkg/blacklist dmslack Slackware 3 10-22-2013 05:33 AM
Blacklist package group from slackpkg Phorize Slackware 2 08-19-2013 04:34 AM
[SOLVED] regex in blacklist for slackpkg - how to use it? markush Slackware 2 03-30-2011 05:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration