Project

General

Profile

Feature #11027

method to delete local SMB users

Added by Gordon Ross 5 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Start date:
2019-05-15
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

If we add a local user (in /etc/passwd) and then do:
smbadm enable-user $U
passwd $U (set a password)
we'll have an SMB user (in /var/smb/smbpasswd)

If we then delete the user from /etc/passwd
the SMB user stays (in /var/smb/smbpasswd)

We should have a method to remove such users,
both at the command line, and programatically. i.e.
smbadm delete-user ...

Affected Components:
smbsrv

History

#1

Updated by Gordon Ross 5 months ago

  • Description updated (diff)
  • Status changed from New to In Progress

Proposed design:

1: new operation code for smb_pwd_setcntl(), called like:
error = smb_pwd_setcntl(user, SMB_PWC_DELETE);
This operation removes the user line from /var/smb/smbpasswd

2: new smbadm sub-command
smbadm delete-user $U
Similar to smbadm-disable user, calls:
error = smb_pwd_setcntl(user, SMB_PWC_DELETE);

Tested per description
Fix in production since late 2017

#2

Updated by Electric Monk 2 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit ef4cfbfda6599ba454267385722705117460a9c8

commit  ef4cfbfda6599ba454267385722705117460a9c8
Author: Matt Barden <matt.barden@nexenta.com>
Date:   2019-08-10T14:06:00.000Z

    11027 method to delete local SMB users
    Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
    Reviewed by: Evan Layton <evan.layton@nexenta.com>
    Approved by: Garrett D'Amore <garrett@damore.org>

Also available in: Atom PDF